Ticket #356 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

ia32: floating-point-overflow not signaled on EXP

Reported by: rme Owned by: 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

comment:1 Changed 6 years ago by rme

  • Owner changed from gb to rme

comment:2 Changed 6 years ago 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.

comment:3 Changed 6 years ago by gb

  • Owner changed from gb to rme
  • Status changed from assigned to new

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

comment:4 Changed 6 years ago 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.

comment:5 Changed 6 years ago by rme

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

Some other approach will be needed on Linux.

comment:6 Changed 6 years ago 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.

comment:7 Changed 6 years ago by rme

  • Status changed from new to assigned

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

comment:8 Changed 6 years ago by rme

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.