[llvm] r254719 - [Hexagon] Using multiply instead of shift on signed number which can be UB
Colin LeMahieu via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 4 07:48:45 PST 2015
Author: colinl
Date: Fri Dec 4 09:48:45 2015
New Revision: 254719
URL: http://llvm.org/viewvc/llvm-project?rev=254719&view=rev
Log:
[Hexagon] Using multiply instead of shift on signed number which can be UB
Modified:
llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
Modified: llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp?rev=254719&r1=254718&r2=254719&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp Fri Dec 4 09:48:45 2015
@@ -554,13 +554,13 @@ public:
void adds4_6ImmOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
- Inst.addOperand(MCOperand::createImm(CE->getValue() << 6));
+ Inst.addOperand(MCOperand::createImm(CE->getValue() * 64));
}
void adds3_6ImmOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
- Inst.addOperand(MCOperand::createImm(CE->getValue() << 6));
+ Inst.addOperand(MCOperand::createImm(CE->getValue() * 64));
}
StringRef getToken() const {
More information about the llvm-commits
mailing list