projects
/
gem5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
506bf83
)
X86: Fix the sign extension microop so it extends zeros correctly.
author
Gabe Black
<gblack@eecs.umich.edu>
Mon, 27 Aug 2007 03:37:41 +0000
(20:37 -0700)
committer
Gabe Black
<gblack@eecs.umich.edu>
Mon, 27 Aug 2007 03:37:41 +0000
(20:37 -0700)
--HG--
extra : convert_revision :
9d7ca286ba7709175fa75226320601acce4ced98
src/arch/x86/isa/microops/regop.isa
patch
|
blob
|
history
diff --git
a/src/arch/x86/isa/microops/regop.isa
b/src/arch/x86/isa/microops/regop.isa
index 608b86a70f27bf3c2c2f96c30b811da0ce9cb202..b91c77c2126da14c218c31e3a902da9383c599ef 100644
(file)
--- a/
src/arch/x86/isa/microops/regop.isa
+++ b/
src/arch/x86/isa/microops/regop.isa
@@
-661,8
+661,10
@@
let {{
defineMicroRegOpImm('Sext', '''
IntReg val = psrc1;
int sign_bit = bits(val, imm8-1, imm8-1);
- val = sign_bit ? (val | ~mask(imm8)) : val;
- DestReg = merge(DestReg, val, dataSize);''')
+ uint64_t maskVal = mask(imm8);
+ val = sign_bit ? (val | ~maskVal) : (val & maskVal);
+ DestReg = merge(DestReg, val, dataSize);
+ ''')
defineMicroRegOpImm('Zext', 'DestReg = bits(psrc1, imm8-1, 0);')
}};