From: Uncle George <gatgul@voicenet.com>
To: Jay.Estabrook@compaq.com
Cc: axp-list@redhat.com, Richard Henderson <rth@twiddle.net>
Subject: a CVTST/s of +INF doesn't work :-{
Date: Sun, 12 Dec 1999 19:58:00 -0500 [thread overview]
Message-ID: <38544497.C881C81B@voicenet.com> (raw)
In-Reply-To: 199912101725.MAA00952@linux04.mro.dec.com
[-- Attachment #1: Type: text/plain, Size: 676 bytes --]
it seems that the comparison of a (float) 0 with a (float) +INF does not work
with linux-2.2.13.
the cvtst/s instruction ( which in itself it very strangely assembled - which
appears, when hand disassembled to be a CVTxS form of instruction rather than the
expected CVTxT ) does not convert the (float) +inf to a (double) +inf.
the the (float)inf becomes a (double) 0.
Attached is a simple program that exhibits the problem.
gat
BTW There seems to be some sorta madness with respect to the CVT instructs, that
defies my logic. Do I need to become also cerebrally damaged to understand this
:-/
ie a cvtst/s != the assembler version != whats in memory != what I understand.
[-- Attachment #2: a.c --]
[-- Type: text/plain, Size: 429 bytes --]
int compare ( float, float );
main() {
union
{
float f;
int i;
double d;
long l;
} ll, rr, dd;
float l, r;
int i;
double d;
ll.i = 0;
rr.i = 0x7f800000;
d = rr.f;
dd.d = d;
printf("l = %g, r = %g, d = (%lx, %g)\n", ll.f, rr.f, dd.l, dd.d );
i = compare( ll.f,rr.f );
printf("i = %d\n", i);
}
compare( float l, float r )
{
if ( l < r )
return 1;
else
if ( l > r )
return -1;
else
return 0;
}
next parent reply other threads:[~1999-12-13 2:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <199912101725.MAA00952@linux04.mro.dec.com>
1999-12-13 0:58 ` Uncle George [this message]
1999-12-13 2:36 ` a CVTST/s of +INF doesn't work :-{ Brad Lucier
1999-12-13 14:41 ` Uncle George
1999-12-13 17:42 Brad Lucier
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox