9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] broken floating point exceptions and fpregs
@ 2013-05-24 21:29 cinap_lenrek
  2013-05-25  2:10 ` cinap_lenrek
  2013-05-25 13:47 ` erik quanstrom
  0 siblings, 2 replies; 15+ messages in thread
From: cinap_lenrek @ 2013-05-24 21:29 UTC (permalink / raw)
  To: 9fans

the sse change broke floating point exception handling.

from /sys/src/9/pc/main.c:^matherror()
	/*
	 *  save floating point state to check out error
	 */
	fpenv(&up->fpsave);
	mathnote();

this is wrong, because fpenv() will store the enviroment
in x87 format, but mathnote() uses mathstate() which intreprets
the FPsave structure depending on if sse was enabled or not.

a fix for this was just commited in 9front which passes the
status word and fppc explicitely to mathnode() and uses
mathnote(up->fpsave.status, up->fpsave.pc); in matherror()
and the values extracted by mathstate() in mathemu().

the 2nd problem is how we'r going to handle the fpregs file
in devproc. as this change changes the format. fpr() in acid
returns garbage right now. any thoughts on it how to move
forward on this?

--
cinap



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

end of thread, other threads:[~2013-05-27  5:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-24 21:29 [9fans] broken floating point exceptions and fpregs cinap_lenrek
2013-05-25  2:10 ` cinap_lenrek
2013-05-25 13:47 ` erik quanstrom
2013-05-25 13:58   ` Kurt H Maier
2013-05-25 15:02     ` erik quanstrom
2013-05-25 15:40       ` Kurt H Maier
2013-05-25 15:59         ` erik quanstrom
2013-05-25 19:21       ` Francisco J Ballesteros
2013-05-26  6:00         ` lucio
2013-05-26  8:40           ` Francisco J Ballesteros
2013-05-26  5:57       ` lucio
2013-05-27  3:51         ` Anthony Sorace
2013-05-27  5:35           ` lucio
2013-05-25 14:54   ` cinap_lenrek
2013-05-25 15:00     ` 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).