diff options
author | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-06-18 16:30:06 +0200 |
---|---|---|
committer | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-06-18 16:30:06 +0200 |
commit | a8e8c4f433fb3cce354950ba72136b84abb78015 (patch) | |
tree | c1b93c2399e0474da011b9aaaa324d4bd14b919e /src/arch/x86/isa/microops | |
parent | c9c02efb99c0a982c116c7d1d8ed9a984c174198 (diff) | |
download | gem5-a8e8c4f433fb3cce354950ba72136b84abb78015.tar.xz |
x86: Fix loading of floating point constants
This changeset actually fixes two issues:
* The lfpimm instruction didn't work correctly when applied to a
floating point constant (it did work for integers containing the
bit string representation of a constant) since it used
reinterpret_cast to convert a double to a uint64_t. This caused a
compilation error, at least, in gcc 4.6.3.
* The instructions loading floating point constants in the x87
processor didn't work correctly since they just stored a truncated
integer instead of a double in the floating point register. This
changeset fixes the old microcode by using lfpimm instruction
instead of the limm instructions.
Diffstat (limited to 'src/arch/x86/isa/microops')
-rw-r--r-- | src/arch/x86/isa/microops/limmop.isa | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/x86/isa/microops/limmop.isa b/src/arch/x86/isa/microops/limmop.isa index 9e88e4b94..2c61aaa45 100644 --- a/src/arch/x86/isa/microops/limmop.isa +++ b/src/arch/x86/isa/microops/limmop.isa @@ -140,8 +140,8 @@ let {{ self.dest = dest if isinstance(imm, (int, long)): imm = "ULL(%d)" % imm - if isinstance(imm, float): - imm = "reinterpret_cast<uint64_t>((double)(%d))" + elif isinstance(imm, float): + imm = "getDoubleBits(%.16f)" % imm self.imm = imm self.dataSize = dataSize |