Optimize redundant sign extends and negation of predicates.
[oota-llvm.git] / lib / Target / Hexagon / HexagonImmediates.td
index 1e3fcb862a32e796d31f3f23cd3d7b324aaf1159..0422a4312bbcd784637e5c5c6615117dae96dcc7 100644 (file)
@@ -52,12 +52,12 @@ def s10Imm : Operand<i32> {
   let PrintMethod = "printHexagonImmOperand";
 }
 
-def s8Imm : Operand<i32> {
+def s9Imm : Operand<i32> {
   // For now, we use a generic print function for all operands.
   let PrintMethod = "printHexagonImmOperand";
 }
 
-def s9Imm : Operand<i32> {
+def s8Imm : Operand<i32> {
   // For now, we use a generic print function for all operands.
   let PrintMethod = "printHexagonImmOperand";
 }
@@ -197,6 +197,11 @@ def u2Imm : Operand<i32> {
   let PrintMethod = "printHexagonImmOperand";
 }
 
+def u1Imm : Operand<i32> {
+  // For now, we use a generic print function for all operands.
+  let PrintMethod = "printHexagonImmOperand";
+}
+
 def n8Imm : Operand<i32> {
   // For now, we use a generic print function for all operands.
   let PrintMethod = "printHexagonImmOperand";
@@ -207,6 +212,11 @@ def m6Imm : Operand<i32> {
   let PrintMethod = "printHexagonImmOperand";
 }
 
+def nOneImm : Operand<i32> {
+  // For now, we use a generic print function for all operands.
+  let PrintMethod = "printHexagonNOneImmOperand";
+}
+
 //
 // Immediate predicates
 //
@@ -489,3 +499,10 @@ def n8ImmPred  : PatLeaf<(i32 imm), [{
   int64_t v = (int64_t)N->getSExtValue();
   return (-255 <= v && v <= 0);
 }]>;
+
+def nOneImmPred  : PatLeaf<(i32 imm), [{
+  // nOneImmPred predicate - True if the immediate is -1.
+  int64_t v = (int64_t)N->getSExtValue();
+  return (-1 == v);
+}]>;
+