diff options
author | Bob Wilson <bob.wilson@apple.com> | 2010-08-11 23:10:46 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2010-08-11 23:10:46 +0000 |
commit | eaf1c98a7c38444d41d1c6dc2074736eec7d452f (patch) | |
tree | bf66b7868bcfe84e57996839bac66ca62b4475aa /lib/Target/ARM/ARMAsmPrinter.cpp | |
parent | d29583bd32eb3e918b797849f55c0ad2667396c4 (diff) | |
download | external_llvm-eaf1c98a7c38444d41d1c6dc2074736eec7d452f.tar.gz external_llvm-eaf1c98a7c38444d41d1c6dc2074736eec7d452f.tar.bz2 external_llvm-eaf1c98a7c38444d41d1c6dc2074736eec7d452f.zip |
Move the ARM SSAT and USAT optional shift amount operand out of the
instruction opcode. This also fixes part of PR7792.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 12baca6242..b09cd73176 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -120,8 +120,10 @@ namespace { void printAddrModePCOperand(const MachineInstr *MI, int OpNum, raw_ostream &O, const char *Modifier = 0); - void printBitfieldInvMaskImmOperand (const MachineInstr *MI, int OpNum, - raw_ostream &O); + void printBitfieldInvMaskImmOperand(const MachineInstr *MI, int OpNum, + raw_ostream &O); + void printSatShiftOperand(const MachineInstr *MI, int OpNum, + raw_ostream &O); void printThumbS4ImmOperand(const MachineInstr *MI, int OpNum, raw_ostream &O); @@ -669,6 +671,25 @@ ARMAsmPrinter::printBitfieldInvMaskImmOperand(const MachineInstr *MI, int Op, O << "#" << lsb << ", #" << width; } +void ARMAsmPrinter::printSatShiftOperand(const MachineInstr *MI, int OpNum, + raw_ostream &O) { + unsigned ShiftOp = MI->getOperand(OpNum).getImm(); + ARM_AM::ShiftOpc Opc = ARM_AM::getSORegShOp(ShiftOp); + switch (Opc) { + case ARM_AM::no_shift: + return; + case ARM_AM::lsl: + O << ", lsl #"; + break; + case ARM_AM::asr: + O << ", asr #"; + break; + default: + assert(0 && "unexpected shift opcode for saturate shift operand"); + } + O << ARM_AM::getSORegOffset(ShiftOp); +} + //===--------------------------------------------------------------------===// void ARMAsmPrinter::printThumbS4ImmOperand(const MachineInstr *MI, int Op, |