* a cvtts/s of a denorm ->0.0
@ 2000-09-29 18:24 Uncle George
2000-10-01 21:35 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: Uncle George @ 2000-09-29 18:24 UTC (permalink / raw)
To: axp-list
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
It seems that the conversion of a double/denorm value into a
float/denorm gets truncated into 0.0 . In the attached example, the
(correct) double result of the fmod , get chopped ( ie cvtts/s ) into
0.0 and stored in c.
I was expecting to see the float denorm of 0x1 back.
/gat
[-- Attachment #2: fmod.c --]
[-- Type: text/plain, Size: 796 bytes --]
main()
{
extern double fmod( double a, double b );
float a, b, c;
union {
float f;
int i;
} u;
long fpcr;
asm( "excb; mf_fpcr %0" : "=f"(fpcr));
printf(" fpcr = %p\n", fpcr );
#if 1
fpcr |= (1L << 47); /* DNOD Not avail in 21264(a) */
fpcr &= ~(1L << 48 ); /* DNZ idenormal Operands to Zero */
fpcr |= (1L << 49); /* DNOD Not avail in 21264(a) */
fpcr &= ~(1L << 60 ); /* UNDZ underflow to zero OFF */
fpcr |= (1L << 61); /* UNFD underflow disable ON */
/* fpcr |= (1L << 62); UNFD */
asm volatile ( "mt_fpcr %0 ; excb" : : "f"(fpcr));
#endif
asm( "excb; mf_fpcr %0" : "=f"(fpcr));
printf(" fpcr = %p\n", fpcr );
u.i = 1;
a = u.f;
u.i = 0xff800000;
b = u.f;
c = fmod( a, b );
}
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: a cvtts/s of a denorm ->0.0
2000-09-29 18:24 a cvtts/s of a denorm ->0.0 Uncle George
@ 2000-10-01 21:35 ` Richard Henderson
2000-10-03 10:22 ` Uncle George
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2000-10-01 21:35 UTC (permalink / raw)
To: axp-list
On Fri, Sep 29, 2000 at 01:24:03PM -0500, Uncle George wrote:
> It seems that the conversion of a double/denorm value into a
> float/denorm gets truncated into 0.0.
Of course. That's the way rounding works.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: a cvtts/s of a denorm ->0.0
2000-10-01 21:35 ` Richard Henderson
@ 2000-10-03 10:22 ` Uncle George
0 siblings, 0 replies; 3+ messages in thread
From: Uncle George @ 2000-10-03 10:22 UTC (permalink / raw)
To: axp-list
I guess a much larger picture should be examined.
Shouldn't the fp results match those from the linux/i386 port ?
right now I know that a 0.0/denorm is a nan on linux/alpha. is is 0.0 on
an i386
This can be changed to look just like the i386 by setting a bit in the
FPCR register, but its not just done ( probably not even explained !)
I also remem there was a rounding switch in the gcc/egcs ( egcs more
likely ). I dont/didn't see it in help. One of those alpha rounding
modes requires both the FPCR set, as well as a bit | 2 set in the fp
instructions to get going. I'm not just sure what FP rounding mode will
give me results that are just like the i386.
So should alpha programs under alpha/linux produce the same FP results
as the i386/linux ( under the same conditions ( ie 64 bit float number
(& not the 80bit thats possible on the i386 ))
/gat
Richard Henderson wrote:
> On Fri, Sep 29, 2000 at 01:24:03PM -0500, Uncle George wrote:
> > It seems that the conversion of a double/denorm value into a
> > float/denorm gets truncated into 0.0.
>
> Of course. That's the way rounding works.
>
> r~
>
> _______________________________________________
> Axp-list mailing list
> Axp-list@redhat.com
> https://listman.redhat.com/mailman/listinfo/axp-list
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-10-03 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-09-29 18:24 a cvtts/s of a denorm ->0.0 Uncle George
2000-10-01 21:35 ` Richard Henderson
2000-10-03 10:22 ` Uncle George
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox