From beb920fce6ccc89b4735f280f94cb8c227f4ef5e Mon Sep 17 00:00:00 2001 From: Amaury de la Vieuville Date: Tue, 18 Jun 2013 08:13:05 +0000 Subject: ARM: fix literal load with positive offset encoding When using a positive offset, literal loads where encoded as if it was negative, because: - The sign bit was not assigned to an operand - The addrmode_imm12 operand was not encoding the sign bit correctly This patch also makes the assembler look at the .w/.n specifier for loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184182 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/ARM/basic-thumb2-instructions.s | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'test/MC/ARM') diff --git a/test/MC/ARM/basic-thumb2-instructions.s b/test/MC/ARM/basic-thumb2-instructions.s index 978ec82..9eb9244 100644 --- a/test/MC/ARM/basic-thumb2-instructions.s +++ b/test/MC/ARM/basic-thumb2-instructions.s @@ -3515,12 +3515,31 @@ _func: @------------------------------------------------------------------------------ @ Alternate syntax for LDR*(literal) encodings @------------------------------------------------------------------------------ + ldrb r11, [pc, #22] + ldrh r11, [pc, #22] + ldrsb r11, [pc, #22] + ldrsh r11, [pc, #22] + ldr.w r11, [pc, #22] + ldrb.w r11, [pc, #22] + ldrh.w r11, [pc, #22] + ldrsb.w r11, [pc, #22] + ldrsh.w r11, [pc, #22] + +@ CHECK: ldrb.w r11, [pc, #22] @ encoding: [0x9f,0xf8,0x16,0xb0] +@ CHECK: ldrh.w r11, [pc, #22] @ encoding: [0xbf,0xf8,0x16,0xb0] +@ CHECK: ldrsb.w r11, [pc, #22] @ encoding: [0x9f,0xf9,0x16,0xb0] +@ CHECK: ldrsh.w r11, [pc, #22] @ encoding: [0xbf,0xf9,0x16,0xb0] +@ CHECK: ldr.w r11, [pc, #22] @ encoding: [0xdf,0xf8,0x16,0xb0] +@ CHECK: ldrb.w r11, [pc, #22] @ encoding: [0x9f,0xf8,0x16,0xb0] +@ CHECK: ldrh.w r11, [pc, #22] @ encoding: [0xbf,0xf8,0x16,0xb0] +@ CHECK: ldrsb.w r11, [pc, #22] @ encoding: [0x9f,0xf9,0x16,0xb0] +@ CHECK: ldrsh.w r11, [pc, #22] @ encoding: [0xbf,0xf9,0x16,0xb0] + ldr r11, [pc, #-22] ldrb r11, [pc, #-22] ldrh r11, [pc, #-22] ldrsb r11, [pc, #-22] ldrsh r11, [pc, #-22] - ldr.w r11, [pc, #-22] ldrb.w r11, [pc, #-22] ldrh.w r11, [pc, #-22] -- cgit v1.1