[RFC] MIPS ABI Extension for IEEE Std 754 Non-Compliant Interlinking

Maciej W. Rozycki macro@imgtec.com
Fri Nov 20 17:17:00 GMT 2015

On Tue, 17 Nov 2015, Joseph Myers wrote:

> >  Any or all of these options may have effects beyond propagating the IEEE
> > Std 754 compliance mode down to the assembler and the linker.  In
> > particular `-mieee=strict' is expected to guarantee code generated to
> > fully comply to IEEE Std 754 rather than only as far as NaN representation
> > is concerned.
> "guarantee" seems rather strong given the various known issues with (lack 
> of) Annex F support in GCC.

 Well, but aren't these current implementation shortcomings (i.e. bugs) 
rather than a design principle?  I can weaken the language here, but if 
the former is the case, then I think we don't need to factor in the 
existence of bugs into an interface specification.

> Do you have any actual configuration in mind it would affect, 
> MIPS-specific or otherwise?  For non-architecture-specific things, -std= 
> options for C standards conformance are meant to enable whatever options 
> are required (e.g. they disable the default -ffp-contract=fast), without 
> affecting things not required by the standards by default (so they don't 
> enable -frounding-math or -fsignaling-nans, for example).

 The target audience for the `-mieee=strict' option is in my idea a 
non-technical user, say a physicist, who does not necessarily know or is 
fluent with the guts of computer hardware and who has the need to build 
and reliably run their software which uses IEEE Std 754 arithmetic.  
Rather than giving such a user necessarily lengthy explanations as to the 
complexity of the situation I'd prefer to give them this single option to 
guarantee (modulo bugs, as noted above) that a piece of software built 
with this option will either produce correct (as in "standard-compliant") 
results or refuse to run.

 There is also a corresponding `--with-ieee=strict' configure-time option 
for users who want to build their own compiler system which guarantees 
such compliance by default.

 I think the `-std=' options are a little bit too broad in that they 
control more than just the IEEE Std 754 aspect of standards compliance.  
Of course the setting of `-mieee=' may in fact be a one-way dependency of 
`-std=', up to a further override.  I haven't implemented such a 
dependency in my prototype, however I think it might be a good idea to 
have it.

 What I have implemented is a dependency between `-mieee=' and the 
internal option to control the compliance mode for NaN encodings.  That 
has encountered an unexpected complication though which I was not able to 
resolve without turning the option handling machinery upside down, and I 
found that code really hard to follow.  So I decided to defer it as not 
the main scope of the matter and proceed with the rest of the feature.  
Once the option handling has been sorted out, a similar dependency can be 
introduced between `-std=' and `-mieee='.

 I'll post the details of the option handling issue with the GCC patches.

 Does this answer address your concerns?


More information about the Binutils mailing list