public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: negation of float on H8300
@ 2002-08-09  2:11 Sanjiv Kumar Gupta, Noida
  0 siblings, 0 replies; 7+ messages in thread
From: Sanjiv Kumar Gupta, Noida @ 2002-08-09  2:11 UTC (permalink / raw)
  To: Jim Wilson, Alan Lehotsky
  Cc: Andreas Schwab, Peter Barada, aph, dhananjayd, gnuh8, gcc

>Not if it's a signalling NaN.  If the chip only supports QNaNs, then
>you might be able to get away with it.

>Flipping the sign bit is correct even for a signalling NaN.  See item 2 in
>the Appendix of IEEE Std 754-1985 (Binary Floating-Point Arithmetic).
>See also item 2 in the Appendix of IEEE Std 854-1987 (Radix-Independent
>Floating-Point Arithmetic).

>Jim

I'll try to write out a patch for this soon.

Regards
Sanjiv

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: negation of float on H8300
  2002-08-08  6:43     ` Alan Lehotsky
@ 2002-08-08  7:56       ` Jim Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Jim Wilson @ 2002-08-08  7:56 UTC (permalink / raw)
  To: Alan Lehotsky
  Cc: Andreas Schwab, Sanjiv Kumar Gupta, Noida, Peter Barada, aph,
	dhananjayd, gnuh8, gcc

>Not if it's a signalling NaN.  If the chip only supports QNaNs, then
>you might be able to get away with it.

Flipping the sign bit is correct even for a signalling NaN.  See item 2 in
the Appendix of IEEE Std 754-1985 (Binary Floating-Point Arithmetic).
See also item 2 in the Appendix of IEEE Std 854-1987 (Radix-Independent
Floating-Point Arithmetic).

Jim

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: negation of float on H8300
  2002-08-08  0:19   ` Andreas Schwab
  2002-08-08  6:17     ` Jeff Law
@ 2002-08-08  6:43     ` Alan Lehotsky
  2002-08-08  7:56       ` Jim Wilson
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Lehotsky @ 2002-08-08  6:43 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Sanjiv Kumar Gupta, Noida, Peter Barada, aph, dhananjayd, gnuh8, gcc

At 9:19 AM +0200 8/8/02, Andreas Schwab wrote:

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: negation of float on H8300
  2002-08-08  0:19   ` Andreas Schwab
@ 2002-08-08  6:17     ` Jeff Law
  2002-08-08  6:43     ` Alan Lehotsky
  1 sibling, 0 replies; 7+ messages in thread
From: Jeff Law @ 2002-08-08  6:17 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Alan Lehotsky, Sanjiv Kumar Gupta, Noida, Peter Barada, aph,
	dhananjayd, gnuh8, gcc

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: negation of float on H8300
  2002-08-07 19:31 ` Alan Lehotsky
@ 2002-08-08  0:19   ` Andreas Schwab
  2002-08-08  6:17     ` Jeff Law
  2002-08-08  6:43     ` Alan Lehotsky
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Schwab @ 2002-08-08  0:19 UTC (permalink / raw)
  To: Alan Lehotsky
  Cc: Sanjiv Kumar Gupta, Noida, Peter Barada, aph, dhananjayd, gnuh8, gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

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?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: negation of float on H8300
  2002-08-07  0:24 Sanjiv Kumar Gupta, Noida
@ 2002-08-07 19:31 ` Alan Lehotsky
  2002-08-08  0:19   ` Andreas Schwab
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Lehotsky @ 2002-08-07 19:31 UTC (permalink / raw)
  To: Sanjiv Kumar Gupta, Noida; +Cc: Peter Barada, aph, dhananjayd, gnuh8, gcc

At 12:48 PM +0530 8/7/02, Sanjiv Kumar Gupta, Noida wrote:

^ permalink raw reply	[flat|nested] 7+ messages in thread

* negation of float on H8300
@ 2002-08-07  0:24 Sanjiv Kumar Gupta, Noida
  2002-08-07 19:31 ` Alan Lehotsky
  0 siblings, 1 reply; 7+ messages in thread
From: Sanjiv Kumar Gupta, Noida @ 2002-08-07  0:24 UTC (permalink / raw)
  To: Peter Barada, aph; +Cc: dhananjayd, gnuh8, gcc

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?

Regards
Sanjiv

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-08-09  2:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-09  2:11 negation of float on H8300 Sanjiv Kumar Gupta, Noida
  -- strict thread matches above, loose matches on Subject: below --
2002-08-07  0:24 Sanjiv Kumar Gupta, Noida
2002-08-07 19:31 ` Alan Lehotsky
2002-08-08  0:19   ` Andreas Schwab
2002-08-08  6:17     ` Jeff Law
2002-08-08  6:43     ` Alan Lehotsky
2002-08-08  7:56       ` Jim Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).