* [9fans] kw floating point emulation problem?
@ 2010-04-12 1:35 erik quanstrom
0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2010-04-12 1:35 UTC (permalink / raw)
To: 9fans
gs when compiled on arm for arm doesn't work.
gs when compiled on 386 for arm does work.
i boiled down the problem case to this wierd define
from /sys/src/cmd/gs/src/ztype.c
; cat p2.c
#include <u.h>
#include <libc.h>
#define ALT_MIN_LONG (-1L << (sizeof(long) * 8L - 1))
void
main(void)
{
print("%lx\n", ALT_MIN_LONG);
print("%lx\n", 0x80000000L);
print("%g\n", ALT_MIN_LONG*1.);
print("%g\n", 0x80000000UL*1.);
exits("");
}
; cpu -c '5c -FVTw p2.c && 5l p2.5' && 5.out # cpu is a 386
-80000000
-80000000
-2.147484e+09
2.147484e+09
; 5c -FVTw p2.c && 5l p2.5 && 5.out
-80000000
-80000000
6.442451e+09
-2.147484e+09
a little debugging in scon.c yields:
CAST [l->vconst 2147483648] -> n->fconst 6.442451e+09
for /sys/src/cmd/cc/scon.c:51,59
case OCAST:
if(et == TVOID)
return;
et = l->type->etype;
if(isf) {
if(typefd[et])
>> d = l->fconst;
else
d = l->vconst;
- erik
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-12 1:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-12 1:35 [9fans] kw floating point emulation problem? erik quanstrom
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 NNTP newsgroup(s).