From a656b63ee4d5b0e3f4d26a55dd4cc69795746684 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 1 Mar 2011 01:00:59 +0000 Subject: Narrow right shifts need to encode their immediates differently from a normal shift. 16-bit: imm6<5:3> = '001', 8 - is encded in imm6<2:0> 32-bit: imm6<5:4> = '01',16 - is encded in imm6<3:0> 64-bit: imm6<5> = '1', 32 - is encded in imm6<4:0> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126723 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMInstrFormats.td | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/Target/ARM/ARMInstrFormats.td') diff --git a/lib/Target/ARM/ARMInstrFormats.td b/lib/Target/ARM/ARMInstrFormats.td index 359ac45..cf8c472 100644 --- a/lib/Target/ARM/ARMInstrFormats.td +++ b/lib/Target/ARM/ARMInstrFormats.td @@ -221,6 +221,22 @@ def neg_zero : Operand { let PrintMethod = "printNegZeroOperand"; } +// Narrow Shift Right Immediate - A narrow shift right immediate is encoded +// differently from other shift immediates. The imm6 field is encoded like so: +// +// 16-bit: imm6<5:3> = '001', 8 - is encded in imm6<2:0> +// 32-bit: imm6<5:4> = '01',16 - is encded in imm6<3:0> +// 64-bit: imm6<5> = '1', 32 - is encded in imm6<4:0> +def nsr16_imm : Operand { + let EncoderMethod = "getNarrowShiftRight16Imm"; +} +def nsr32_imm : Operand { + let EncoderMethod = "getNarrowShiftRight32Imm"; +} +def nsr64_imm : Operand { + let EncoderMethod = "getNarrowShiftRight64Imm"; +} + //===----------------------------------------------------------------------===// // ARM Instruction templates. // -- cgit v1.1