aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-20 17:19:40 +0000
committerDan Gohman <gohman@apple.com>2008-12-20 17:19:40 +0000
commitb12b1a27f50628f5bd895de5278f70a8c905ca0a (patch)
tree0b1143b623dc63c0f7c1edadb99e02342bbb010d /lib
parentedf22b97d0d525ed4ec89eda1708c24c45c54b57 (diff)
downloadexternal_llvm-b12b1a27f50628f5bd895de5278f70a8c905ca0a.zip
external_llvm-b12b1a27f50628f5bd895de5278f70a8c905ca0a.tar.gz
external_llvm-b12b1a27f50628f5bd895de5278f70a8c905ca0a.tar.bz2
Fix fast-isel to not emit invalid assembly when presented with a
constant shift count that doesn't fit in the shift instruction's immediate field. This fixes PR3242. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61281 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86FastISel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index c4b45bf..a81ecfe 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -893,7 +893,7 @@ bool X86FastISel::X86SelectShift(Instruction *I) {
if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
unsigned ResultReg = createResultReg(RC);
BuildMI(MBB, TII.get(OpImm),
- ResultReg).addReg(Op0Reg).addImm(CI->getZExtValue());
+ ResultReg).addReg(Op0Reg).addImm(CI->getZExtValue() & 0xff);
UpdateValueMap(I, ResultReg);
return true;
}