This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: negation of float on H8300
- From: Jeff Law <law at porcupine dot slc dot redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Alan Lehotsky <apl at alum dot mit dot edu>, "Sanjiv Kumar Gupta, Noida" <sanjivg at noida dot hcltech dot com>, Peter Barada <pbarada at mail dot wm dot sps dot mot dot com>, aph at cambridge dot redhat dot com, dhananjayd at kpit dot com, gnuh8 at gnuh8 dot org dot uk, gcc at gcc dot gnu dot org
- Date: Thu, 08 Aug 2002 07:21:41 -0600
- Subject: Re: negation of float on H8300
- Reply-to: law at redhat dot com
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