9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] NaN(2)
@ 2007-02-20 23:55 Joel Salomon
  2007-02-21  0:00 ` Joel C. Salomon
  2007-02-21  5:50 ` Russ Cox
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Salomon @ 2007-02-20 23:55 UTC (permalink / raw)
  To: 9fans

My system doesn’t seem to like it when I call NaN(2):

cpu% cat tnan.c
#include <u.h>
#include <libc.h>

void
main(int, char**)
{
	double d = NaN();
	print("d = %f\n", d);

	exits(0);
}
cpu% 8c -FVw tnan.c
cpu% 8l tnan.8
cpu% 8.out
8.out 55798: suicide: sys: fp: invalid operation fppc=0x10a4 status=0x8081 pc=0x00001028
cpu% acid 55798
/proc/55798/text:386 plan 9 executable

/sys/lib/acid/port
/sys/lib/acid/386
acid: stk()
main()+0x8 /usr/chesky/src/hak/lex/tnan.c:7
_main+0x31 /sys/src/libc/386/main9.s:16
acid: asm(main)
main 0x00001020	SUBL	$0x1c,SP
main+0x3 0x00001023	CALL	NaN(SB)
main+0x8 0x00001028	FMOVDP	F0,d+0x14(SP)
…

Why is this happening?

Also, what is Intel’s name for the FMOVDP instruction?

--Joel



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

end of thread, other threads:[~2007-02-21  5:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-20 23:55 [9fans] NaN(2) Joel Salomon
2007-02-21  0:00 ` Joel C. Salomon
2007-02-21  0:20   ` Joel Salomon
2007-02-21  1:00     ` erik quanstrom
2007-02-21  2:26       ` Joel Salomon
2007-02-21  4:18         ` erik quanstrom
2007-02-21  4:35           ` Joel C. Salomon
2007-02-21  5:10           ` Joel C. Salomon
2007-02-21  5:50 ` Russ Cox

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).