Skip to content

Commit

Permalink
for RP2350 default to no inline float instruction.
Browse files Browse the repository at this point in the history
use -f compiler option to enable inline floats instructions
  • Loading branch information
lurk101 committed Sep 5, 2024
1 parent 2d83f93 commit 5725a57
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cc/cc.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static int rtf UDATA, rtt UDATA; // return flag and return type for current
static int loc UDATA; // local variable offset
static int lineno UDATA; // current line number
static int src_opt UDATA; // print source and assembly flag
static int inline_float_opt = 1; // generate inline float instructions flag
static int inline_float_opt UDATA; // generate inline float instructions flag
static int nopeep_opt UDATA; // turn off peep-hole optimization
static int uchar_opt UDATA; // use unsigned character variables
static int* n UDATA; // current position in emitted abstract syntax tree
Expand Down Expand Up @@ -4379,13 +4379,19 @@ static void show_externals(int i) {
static void help(char* lib) {
if (!lib) {
printf("\n"
"usage: cc [-s] [-u] [-n] [-f] [-h [lib]] [-D [symbol[ = value]]]\n"
"usage: cc [-s] [-u] [-n]"
#if PICO2350
" [-f]"
#endif
" [-h [lib]] [-D [symbol[ = value]]]\n"
" [-o filename] filename\n"
" -s display disassembly and quit.\n"
" -o name of executable output file.\n"
" -u treat char type as unsigned.\n"
" -n turn off peep-hole optimization\n"
" -f do not use inline float operators\n"
#if PICO2350
" -f use inline float instructions\n"
#endif
" -D symbol [= value]\n"
" define symbol for limited pre-processor, can repeat.\n"
" -h [lib name]\n"
Expand Down Expand Up @@ -4515,8 +4521,10 @@ int cc(int mode, int argc, char** argv) {
goto done;
} else if ((*argv)[1] == 's') {
src_opt = 1;
#if PICO2350
} else if ((*argv)[1] == 'f') {
inline_float_opt = 0;
inline_float_opt = 1;
#endif
} else if ((*argv)[1] == 'n') {
nopeep_opt = 1;
} else if ((*argv)[1] == 'o') {
Expand Down

0 comments on commit 5725a57

Please sign in to comment.