This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: negation of float on H8300


In message <je3ctp7r7f.fsf@sykes.suse.de>, Andreas Schwab writes:
 >Alan Lehotsky <apl@alum.mit.edu> writes:
 >
 >|> At 12:48 PM +0530 8/7/02, Sanjiv Kumar Gupta, Noida wrote:
 >|> >Hi all,
 >|> >
 >|> >I see a libcall ___negsf2 is being used by gcc for negation of floats on
 >|> >H8300. Can't we just flip the first bit using bit insns provided in H8300
 >?
 >|> 
 >|> That wouldn't handle NaNs correctly (assuming the H8300 is IEEE FP
 >|> compliant...)
 >
 >But a negative NaN is still a NaN, isn't it?
Yes.  Bit twiddling to implement fneg has been recognized as IEEE FP compliant
for some time now.  I'm pretty sure we've got threads on this in our archives
somewhere.

In fact, the IEEE semantics for FP negation strongly encourage implementation
via bit twiddling.  You can't implement FP negation using subtraction and
get IEEE compliance.  Search the archives for a rather interesting discussion
on this topic and how it relates to the PA port ;-)

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]