From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 27132 invoked from network); 13 Dec 1999 02:05:40 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 13 Dec 1999 02:05:40 -0000 Received: from voicenet.com (mail12.voicenet.com [207.103.0.6]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id VAA27185 for ; Sun, 12 Dec 1999 21:05:39 -0500 Received: (qmail 12321 invoked from network); 13 Dec 1999 02:05:37 -0000 Received: from dialpool0437-pri.voicenet.com (HELO voicenet.com) (209.71.85.232) by mail12.voicenet.com with SMTP; 13 Dec 1999 02:05:37 -0000 Sender: gat@mail.redhat.com Message-ID: <38544497.C881C81B@voicenet.com> Date: Sun, 12 Dec 1999 19:58:00 -0500 From: Uncle George Organization: Big-Endian X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.36 i686) MIME-Version: 1.0 To: Jay.Estabrook@compaq.com CC: axp-list@redhat.com, Richard Henderson Subject: a CVTST/s of +INF doesn't work :-{ References: <199912101725.MAA00952@linux04.mro.dec.com> Content-Type: multipart/mixed; boundary="------------25391A7AC71AA0937EAE82A0" This is a multi-part message in MIME format. --------------25391A7AC71AA0937EAE82A0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. --------------25391A7AC71AA0937EAE82A0 Content-Type: text/plain; charset=us-ascii; name="a.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.c" 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; } --------------25391A7AC71AA0937EAE82A0--