summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FastISel.cpp
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
commitab316350bfe4b17b404cace73c0d77f0d6d09a63 (patch)
treef0746e4e04a7c311f3e118c826d35e4e0fc33952 /llvm/lib/Target/X86/X86FastISel.cpp
parenta12f1159729aacff516d9f3fa1d6bc3bea1a49d4 (diff)
downloadbcm5719-llvm-ab316350bfe4b17b404cace73c0d77f0d6d09a63.tar.gz
bcm5719-llvm-ab316350bfe4b17b404cace73c0d77f0d6d09a63.zip
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. llvm-svn: 61281
Diffstat (limited to 'llvm/lib/Target/X86/X86FastISel.cpp')
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index c4b45bf431e..a81ecfeace1 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud