[mips-gnu-discuss] IEEE math support

Joseph S. Myers joseph at codesourcery.com
Wed Sep 28 16:51:28 UTC 2011


On Wed, 28 Sep 2011, Martin Herrman wrote:

> I want to compile the rrdtool software
> (http://oss.oetiker.ch/rrdtool/) which requires that the compiler
> supports IEEE math. In the documentation I found that when the target

"supports IEEE math" can have many possible meanings; it's difficult to 
give a meaningful answer without a detailed explanation of the 
requirements of the particular code, but in general the support levels on 
i386 and MIPS are similar.

> is an i386 system, the -mieee-fp argument supports it. For MIPS target
> architecture, such an option is not documented.
> 
> Is that correct, or do I misunderstand the documentation?

The -mieee-fp option does very little on i386.  Within the compiler it's 
enabled by default, so the only effect is to link with -lieee at link 
time, and in turn what that does is disable setting errno for various 
mathematical library functions (but probably not consistently) while 
leaving them setting the exceptions they would do anyway.  Code using 
-mieee-fp on i386 is probably using it based on some vague idea that it 
sounds good, rather than because of any need for its actual, limited, 
effects.

> Is there any solution available (without a total rewrite of the
> rrdtool source code)?

You can always link with -lieee if the effects of that are genuinely 
required.  If your MIPS processor has hardware floating point support then 
you will have exceptions and rounding modes working (subject to all the 
same compiler limitations as apply on all targets, not just MIPS), 
although some exceptional cases may rely on kernel emulation.

-- 
Joseph S. Myers
joseph at codesourcery.com


More information about the mips-gnu-discuss mailing list