Ticket #356 (closed defect: fixed)

Opened 3 months ago

Last modified 2 months ago

ia32: floating-point-overflow not signaled on EXP

Reported by: rme Assigned to: rme
Priority: minor Milestone: IA-32 port
Component: Runtime (threads, GC) Version: trunk
Keywords: Cc:

Description

From the test suite:

(EXP (+ (LOG MOST-POSITIVE-SINGLE-FLOAT) 100))
(EXP (+ (LOG MOST-POSITIVE-DOUBLE-FLOAT) 100))

Both should signal floating-point-overflow, but instead return "1E++0" and "2E++0"

Change History

10/16/08 18:02:37 changed by rme

  • owner changed from gb to rme.

10/16/08 18:19:12 changed by gb

  • owner changed from rme to gb.
  • status changed from new to assigned.

Hmm. It's not clear why we're looking at mxcsr bits after calling #_expf, unless we're really sure that #_expf is using SSE2 and not the x87.

10/16/08 18:20:19 changed by gb

  • owner changed from gb to rme.
  • status changed from assigned to new.

Whoops; didn't mean to steal this ...

10/16/08 20:38:16 changed by rme

On Darwin, exp() and expf() appear (from looking at disassembler output) not to use the x87 unit. Probably they are the routines from the msun library as found in FreeBSD. I'd expect the mxcsr bits would tell the true story there.

On Linux (at least with our current compiler flags), exp() and expf() are implemented with x87 instructions.

10/16/08 21:36:26 changed by rme

r11110 fixes this for Darwin, whose exp() and expf() don't use the x87.

Some other approach will be needed on Linux.

10/16/08 23:23:59 changed by gb

If I read the diagrams correctly, the low 6 ("exception occurred") bits in the MXCSR have the same meaning as the low 6 bits in the x87 status register, so we may be able to get away with just storing the x87 status word in the TCR.

11/04/08 21:52:06 changed by rme

  • status changed from new to assigned.

Should now work on Linux (at least) as of r11294.

11/10/08 14:17:49 changed by rme

  • status changed from assigned to closed.
  • resolution set to fixed.