[llvm] r298559 - [ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)
Artyom Skrobov via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 16:12:59 PDT 2017
Author: askrobov
Date: Wed Mar 22 18:12:59 2017
New Revision: 298559
URL: http://llvm.org/viewvc/llvm-project?rev=298559&view=rev
Log:
[ARM] simplifying t2_so_imm_neg as suggested by Eli Friedman in D31242 (NFC)
Modified:
llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
Modified: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td?rev=298559&r1=298558&r2=298559&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td (original)
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td Wed Mar 22 18:12:59 2017
@@ -110,11 +110,8 @@ def t2_so_imm_notSext : Operand<i32>, Pa
// t2_so_imm_neg - Match an immediate that is a negation of a t2_so_imm.
def t2_so_imm_neg_asmoperand : AsmOperandClass { let Name = "T2SOImmNeg"; }
-def t2_so_imm_neg : Operand<i32>, PatLeaf<(imm), [{
- int64_t Value = N->getZExtValue();
- if (Value == 1LL<<31) return false; // INT_MIN cannot be negated
- Value = -(int)Value;
- return Value && ARM_AM::getT2SOImmVal(Value) != -1;
+def t2_so_imm_neg : Operand<i32>, ImmLeaf<i32, [{
+ return Imm && ARM_AM::getT2SOImmVal(-(uint32_t)Imm) != -1;
}], t2_so_imm_neg_XFORM> {
let ParserMatchClass = t2_so_imm_neg_asmoperand;
}
More information about the llvm-commits
mailing list