"Maciej W. Rozycki" <ma...@codesourcery.com> writes: >> The patch mostly looks good apart from that, but please use a single >> enum for the 2008/legacy thing, both in mips.h and mips.opt. > > Also mips.c and mips.md (and last but not least mips-opts.h). Done.
I wasn't trying to list all the places that use the C enum. I said mips.opt because I thought we should be able to use a single mips.opt Enum too, a bit like we share mips_arch_opt_value for both -march= and -mtune=. > Please also note that the writability of the individual new (HAS2008) > FCSR bits is optional e.g. a conforming processor may have NAN2008 > hardwired to 1 and ABS2008 hardwired to 0 (or likewise with NAN2008 > writable). OK, I'd missed that this was allowed, sorry. It just seems really unfortunate... >> > +# Return 1 if this is a MIPS target supporting -mnan=. >> > +# Old versions of binutils may not support this option. >> > + >> > +proc check_effective_target_mips_nan { } { >> > + if { ![istarget mips*-*-*] } { >> > + return 0 >> > + } >> > + return [check_no_compiler_messages mips_nan object { >> > + int dummy; >> > + } "-mnan=2008"] >> > +} >> >> The tests you added are dg-do compile tests, which stop after assembly >> generation, so this guard shouldn't be needed. > > It is needed in case the compiler was built without support for this > option i.e. configured against old binutils. I verified that it indeed > triggered in this case: > > Executing on host: mips-linux-gnu-gcc -fno-diagnostics-show-caret > -fdiagnostics-color=never -mnan=2008 -c -o mips_nan21474.o mips_nan21474.c > (timeout = 300) > mips-linux-gnu-gcc: error: unrecognized command line option '-mnan=2008' > compiler exited with status 1 > output is: > mips-linux-gnu-gcc: error: unrecognized command line option '-mnan=2008' That seems like bad practice though. In other cases we leave the assembler to report options that it doesn't understand. I think that's better because it's then clearer that the assembler needs to be upgraded. Within config/mips, the configure test should just control whether it's safe to use .nan when no -mnan option has been given. (This is what we did for -mmicromips vs ".set nomicromips" FWIW.) Richard