summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-05-12 00:51:35 -0700
committerGabe Black <gblack@eecs.umich.edu>2010-05-12 00:51:35 -0700
commitc4497dbf031ab250c1c1702f6952917d1de3f565 (patch)
treeabda6081a72ea935b502e5ed7e71054eca8f54c0
parentcc76842f830f15b12c0f4a64e90fe3ca9e35a45a (diff)
downloadgem5-c4497dbf031ab250c1c1702f6952917d1de3f565.tar.xz
X86: Make the cvti2f microop sign extend its integer source correctly.
The code was using the wrong bit as the sign bit. Other similar bits of code seem to be correct.
-rw-r--r--src/arch/x86/isa/microops/mediaop.isa3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/arch/x86/isa/microops/mediaop.isa b/src/arch/x86/isa/microops/mediaop.isa
index 900c166f8..9a2707b59 100644
--- a/src/arch/x86/isa/microops/mediaop.isa
+++ b/src/arch/x86/isa/microops/mediaop.isa
@@ -1294,7 +1294,8 @@ let {{
int srcLoIndex = srcStart + (i + 0) * srcSizeBits;
uint64_t argBits = bits(FpSrcReg1.uqw, srcHiIndex, srcLoIndex);
- int64_t sArg = argBits | (0 - (argBits & (ULL(1) << srcHiIndex)));
+ int64_t sArg = argBits |
+ (0 - (argBits & (ULL(1) << (srcSizeBits - 1))));
double arg = sArg;
if (destSize == 4) {