summaryrefslogtreecommitdiff
path: root/src/arch/x86/isa/main.isa
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-09-30 12:00:20 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-09-30 12:00:20 +0200
commit654d1e675a3dc1f598aeadb0824bdb3357820a59 (patch)
treee249108fcd6737dda985b993c95d926a33abca21 /src/arch/x86/isa/main.isa
parentc299dcedc6d73aab56d9c659623d7112c2e9c4bb (diff)
downloadgem5-654d1e675a3dc1f598aeadb0824bdb3357820a59.tar.xz
x86: Add support for loading 32-bit and 80-bit floats in the x87
The x87 FPU supports three floating point formats: 32-bit, 64-bit, and 80-bit floats. The current gem5 implementation supports 32-bit and 64-bit floats, but only works correctly for 64-bit floats. This changeset fixes the 32-bit float handling by correctly loading and rounding (using truncation) 32-bit floats instead of simply truncating the bit pattern. 80-bit floats are loaded by first loading the 80-bits of the float to two temporary integer registers. A micro-op (cvtint_fp80) then converts the contents of the two integer registers to the internal FP representation (double). Similarly, when storing an 80-bit float, there are two conversion routines (ctvfp80h_int and cvtfp80l_int) that convert an internal FP register to 80-bit and stores the upper 64-bits or lower 32-bits to an integer register, which is the written to memory using normal integer stores.
Diffstat (limited to 'src/arch/x86/isa/main.isa')
0 files changed, 0 insertions, 0 deletions