Rename sat_shift operand to shift_imm, in preparation for using it for other
authorBob Wilson <bob.wilson@apple.com>
Mon, 16 Aug 2010 18:27:34 +0000 (18:27 +0000)
committerBob Wilson <bob.wilson@apple.com>
Mon, 16 Aug 2010 18:27:34 +0000 (18:27 +0000)
instructions besides saturate instructions.  No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111168 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMInstrThumb2.td
lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp
lib/Target/ARM/AsmPrinter/ARMInstPrinter.h
utils/TableGen/EDEmitter.cpp

index ded9800052e19cf3380ffc190c0a33dddc4940d3..fc1508670ded767f5fb087a915a9340e393cf848 100644 (file)
@@ -124,7 +124,7 @@ namespace {
                                         raw_ostream &O);
     void printMemBOption(const MachineInstr *MI, int OpNum,
                          raw_ostream &O);
-    void printSatShiftOperand(const MachineInstr *MI, int OpNum,
+    void printShiftImmOperand(const MachineInstr *MI, int OpNum,
                               raw_ostream &O);
 
     void printThumbS4ImmOperand(const MachineInstr *MI, int OpNum,
@@ -680,7 +680,7 @@ ARMAsmPrinter::printMemBOption(const MachineInstr *MI, int OpNum,
   O << ARM_MB::MemBOptToString(val);
 }
 
-void ARMAsmPrinter::printSatShiftOperand(const MachineInstr *MI, int OpNum,
+void ARMAsmPrinter::printShiftImmOperand(const MachineInstr *MI, int OpNum,
                                          raw_ostream &O) {
   unsigned ShiftOp = MI->getOperand(OpNum).getImm();
   ARM_AM::ShiftOpc Opc = ARM_AM::getSORegShOp(ShiftOp);
@@ -694,7 +694,7 @@ void ARMAsmPrinter::printSatShiftOperand(const MachineInstr *MI, int OpNum,
     O << ", asr #";
     break;
   default:
-    assert(0 && "unexpected shift opcode for saturate shift operand");
+    assert(0 && "unexpected shift opcode for shift immediate operand");
   }
   O << ARM_AM::getSORegOffset(ShiftOp);
 }
index aeaf3428720bafb8cb06ab95b09d3a1e78483051..6fa99aec3f3a8e6768827e79a75313d1f1d6109f 100644 (file)
@@ -296,6 +296,13 @@ def pclabel : Operand<i32> {
   let PrintMethod = "printPCLabel";
 }
 
+// shift_imm: An integer that encodes a shift amount and the type of shift
+// (currently either asr or lsl) using the same encoding used for the
+// immediates in so_reg operands.
+def shift_imm : Operand<i32> {
+  let PrintMethod = "printShiftImmOperand";
+}
+
 // shifter_operand operands: so_reg and so_imm.
 def so_reg : Operand<i32>,    // reg reg imm
              ComplexPattern<i32, 3, "SelectShifterOperandReg",
@@ -1805,11 +1812,7 @@ def USADA8 : AI<(outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$acc),
 
 // Signed/Unsigned saturate -- for disassembly only
 
-def sat_shift : Operand<i32> {
-  let PrintMethod = "printSatShiftOperand";
-}
-
-def SSAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, sat_shift:$sh),
+def SSAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh),
               SatFrm, NoItinerary, "ssat", "\t$dst, $bit_pos, $a$sh",
               [/* For disassembly only; pattern left blank */]> {
   let Inst{27-21} = 0b0110101;
@@ -1823,7 +1826,7 @@ def SSAT16 : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a), SatFrm,
   let Inst{7-4} = 0b0011;
 }
 
-def USAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, sat_shift:$sh),
+def USAT : AI<(outs GPR:$dst), (ins i32imm:$bit_pos, GPR:$a, shift_imm:$sh),
               SatFrm, NoItinerary, "usat", "\t$dst, $bit_pos, $a$sh",
               [/* For disassembly only; pattern left blank */]> {
   let Inst{27-21} = 0b0110111;
index 1e8d80aed297940f57f3db9cd166edff67b9315a..2bde236fa86ad5316d38099eb049f74694583752 100644 (file)
@@ -1523,7 +1523,7 @@ def t2USADA8  : T2I_mac<0, 0b111, 0b0000, (outs rGPR:$dst),
 
 // Signed/Unsigned saturate -- for disassembly only
 
-def t2SSAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, sat_shift:$sh),
+def t2SSAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, shift_imm:$sh),
                 NoItinerary, "ssat", "\t$dst, $bit_pos, $a$sh",
                 [/* For disassembly only; pattern left blank */]> {
   let Inst{31-27} = 0b11110;
@@ -1544,7 +1544,7 @@ def t2SSAT16: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a), NoItinerary,
   let Inst{7-6} = 0b00;    // imm2 = '00'
 }
 
-def t2USAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, sat_shift:$sh),
+def t2USAT: T2I<(outs rGPR:$dst), (ins i32imm:$bit_pos, rGPR:$a, shift_imm:$sh),
                 NoItinerary, "usat", "\t$dst, $bit_pos, $a$sh",
                 [/* For disassembly only; pattern left blank */]> {
   let Inst{31-27} = 0b11110;
index b662289cd50c35280051b1a26ba208c956decb8e..72476c776486dad222714a7ef76808aefca855c2 100644 (file)
@@ -478,7 +478,7 @@ void ARMInstPrinter::printMemBOption(const MCInst *MI, unsigned OpNum,
   O << ARM_MB::MemBOptToString(val);
 }
 
-void ARMInstPrinter::printSatShiftOperand(const MCInst *MI, unsigned OpNum,
+void ARMInstPrinter::printShiftImmOperand(const MCInst *MI, unsigned OpNum,
                                           raw_ostream &O) {
   unsigned ShiftOp = MI->getOperand(OpNum).getImm();
   ARM_AM::ShiftOpc Opc = ARM_AM::getSORegShOp(ShiftOp);
@@ -492,7 +492,7 @@ void ARMInstPrinter::printSatShiftOperand(const MCInst *MI, unsigned OpNum,
     O << ", asr #";
     break;
   default:
-    assert(0 && "unexpected shift opcode for saturate shift operand");
+    assert(0 && "unexpected shift opcode for shift immediate operand");
   }
   O << ARM_AM::getSORegOffset(ShiftOp);
 }
index 3eaa6f78823392ce07cd54047e1e9c9f18166178..e5ad0d07e9bab9cb3594efa8c976f6b00792e05e 100644 (file)
@@ -58,7 +58,7 @@ public:
   void printBitfieldInvMaskImmOperand(const MCInst *MI, unsigned OpNum,
                                       raw_ostream &O);
   void printMemBOption(const MCInst *MI, unsigned OpNum, raw_ostream &O);
-  void printSatShiftOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
+  void printShiftImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
 
   void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
   void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O);
index 8706ed5426e46e5fae952d84bf9b3655fe9bf884..10c06268f072b7db3021a6fe6902d22d8b6e37d1 100644 (file)
@@ -608,7 +608,7 @@ static int ARMFlagFromOpName(LiteralConstantEmitter *type,
   IMM("jt2block_operand");
   IMM("t_imm_s4");
   IMM("pclabel");
-  IMM("sat_shift");
+  IMM("shift_imm");
   
   MISC("brtarget", "kOperandTypeARMBranchTarget");                // ?
   MISC("so_reg", "kOperandTypeARMSoReg");                         // R, R, I