Skip to content

Commit 5725a57

Browse files
committed
for RP2350 default to no inline float instruction.
use -f compiler option to enable inline floats instructions
1 parent 2d83f93 commit 5725a57

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

cc/cc.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ static int rtf UDATA, rtt UDATA; // return flag and return type for current
268268
static int loc UDATA; // local variable offset
269269
static int lineno UDATA; // current line number
270270
static int src_opt UDATA; // print source and assembly flag
271-
static int inline_float_opt = 1; // generate inline float instructions flag
271+
static int inline_float_opt UDATA; // generate inline float instructions flag
272272
static int nopeep_opt UDATA; // turn off peep-hole optimization
273273
static int uchar_opt UDATA; // use unsigned character variables
274274
static int* n UDATA; // current position in emitted abstract syntax tree
@@ -4379,13 +4379,19 @@ static void show_externals(int i) {
43794379
static void help(char* lib) {
43804380
if (!lib) {
43814381
printf("\n"
4382-
"usage: cc [-s] [-u] [-n] [-f] [-h [lib]] [-D [symbol[ = value]]]\n"
4382+
"usage: cc [-s] [-u] [-n]"
4383+
#if PICO2350
4384+
" [-f]"
4385+
#endif
4386+
" [-h [lib]] [-D [symbol[ = value]]]\n"
43834387
" [-o filename] filename\n"
43844388
" -s display disassembly and quit.\n"
43854389
" -o name of executable output file.\n"
43864390
" -u treat char type as unsigned.\n"
43874391
" -n turn off peep-hole optimization\n"
4388-
" -f do not use inline float operators\n"
4392+
#if PICO2350
4393+
" -f use inline float instructions\n"
4394+
#endif
43894395
" -D symbol [= value]\n"
43904396
" define symbol for limited pre-processor, can repeat.\n"
43914397
" -h [lib name]\n"
@@ -4515,8 +4521,10 @@ int cc(int mode, int argc, char** argv) {
45154521
goto done;
45164522
} else if ((*argv)[1] == 's') {
45174523
src_opt = 1;
4524+
#if PICO2350
45184525
} else if ((*argv)[1] == 'f') {
4519-
inline_float_opt = 0;
4526+
inline_float_opt = 1;
4527+
#endif
45204528
} else if ((*argv)[1] == 'n') {
45214529
nopeep_opt = 1;
45224530
} else if ((*argv)[1] == 'o') {

0 commit comments

Comments
 (0)