Update the .cvs files.
[oota-llvm.git] / lib / Target / CellSPU / SPUOperands.td
index 2a3551d4f64383c4e09955278943d0fdc82ab4c0..d17faac861fbfc3142e181b4fa3345ff0cc13122 100644 (file)
@@ -63,7 +63,7 @@ def HI16_vec : SDNodeXForm<scalar_to_vector, [{
 // simm7 predicate - True if the immediate fits in an 7-bit signed
 // field.
 def simm7: PatLeaf<(imm), [{
-  int sextVal = ((((int) N->getValue()) << 25) >> 25);
+  int sextVal = int(N->getSignExtended());
   return (sextVal >= -64 && sextVal <= 63);
 }]>;
 
@@ -76,9 +76,8 @@ def uimm7: PatLeaf<(imm), [{
 // immSExt8 predicate - True if the immediate fits in an 8-bit sign extended
 // field.
 def immSExt8  : PatLeaf<(imm), [{
-  int Value = (int) N->getValue();
-  int Value8 = (Value << 24) >> 24;
-  return (Value < 0xff && (Value8 >= -128 && Value8 < 127));
+  int Value = int(N->getSignExtended());
+  return (Value >= -(1 << 8) && Value <= (1 << 8) - 1);
 }]>;
 
 // immU8: immediate, unsigned 8-bit quantity
@@ -141,7 +140,7 @@ def imm18  : PatLeaf<(imm), [{
 }]>;
 
 def lo16 : PatLeaf<(imm), [{
-  // hi16 predicate - returns true if the immediate has all zeros in the
+  // lo16 predicate - returns true if the immediate has all zeros in the
   // low order bits and is a 32-bit constant:
   if (N->getValueType(0) == MVT::i32) {
     uint32_t val = N->getValue();
@@ -155,13 +154,23 @@ def hi16 : PatLeaf<(imm), [{
   // hi16 predicate - returns true if the immediate has all zeros in the
   // low order bits and is a 32-bit constant:
   if (N->getValueType(0) == MVT::i32) {
-    uint32_t val = N->getValue();
+    uint32_t val = uint32_t(N->getValue());
     return ((val & 0xffff0000) == val);
+  } else if (N->getValueType(0) == MVT::i64) {
+    uint64_t val = N->getValue();
+    return ((val & 0xffff0000ULL) == val);
   }
 
   return false;
 }], HI16>;
 
+def bitshift : PatLeaf<(imm), [{
+  // bitshift predicate - returns true if 0 < imm <= 7 for SHLQBII
+  // (shift left quadword by bits immediate)
+  int64_t Val = N->getValue();
+  return (Val > 0 && Val <= 7);
+}]>;
+
 //===----------------------------------------------------------------------===//
 // Floating point operands:
 //===----------------------------------------------------------------------===//
@@ -447,6 +456,10 @@ def s10imm : Operand<i16> {
   let PrintMethod = "printS10ImmOperand";
 }
 
+def s10imm_i8: Operand<i8> {
+  let PrintMethod = "printS10ImmOperand";
+}
+
 def s10imm_i32: Operand<i32> {
   let PrintMethod = "printS10ImmOperand";
 }
@@ -492,7 +505,15 @@ def s16imm_f64: Operand<f64> {
   let PrintMethod = "printS16ImmOperand";
 }
 
-def u16imm : Operand<i32> {
+def u16imm_i64 : Operand<i64> {
+  let PrintMethod = "printU16ImmOperand";
+}
+
+def u16imm_i32 : Operand<i32> {
+  let PrintMethod = "printU16ImmOperand";
+}
+
+def u16imm : Operand<i16> {
   let PrintMethod = "printU16ImmOperand";
 }
 
@@ -538,8 +559,9 @@ def rotNeg7imm_i16 : Operand<i16> {
   let PrintMethod = "printROTNeg7Imm";
 }
 
-// Floating point immediate operands
-def f32imm : Operand<f32>;
+def rotNeg7imm_i8 : Operand<i8> {
+  let PrintMethod = "printROTNeg7Imm";
+}
 
 def target : Operand<OtherVT> {
   let PrintMethod = "printBranchOperand";