[llvm] r198944 - ARM: fix regression caused by r198914

Jim Grosbach grosbach at apple.com
Fri Jan 10 10:16:09 PST 2014


On Jan 10, 2014, at 8:22 AM, Saleem Abdulrasool <compnerd at compnerd.org> wrote:

> Author: compnerd
> Date: Fri Jan 10 10:22:47 2014
> New Revision: 198944
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=198944&view=rev
> Log:
> ARM: fix regression caused by r198914
> 
> The disassembler would no longer be able to disambiguage between the two
> variants (explicit immediate #0 vs implicit, omitted #0) for the ldrt, strt,
> ldrbt, strbt mnemonics as both versions indicated the disassembler routine.

Nor should the disassembler be able to disambiguate the two. They are the same instruction. I’ve commented on r198914 with more specifics.

> 
> Added:
>    llvm/trunk/test/MC/Disassembler/ARM/addrmode2-reencoding.txt
> Modified:
>    llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
> 
> Modified: llvm/trunk/lib/Target/ARM/ARMInstrInfo.td
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMInstrInfo.td?rev=198944&r1=198943&r2=198944&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMInstrInfo.td (original)
> +++ llvm/trunk/lib/Target/ARM/ARMInstrInfo.td Fri Jan 10 10:22:47 2014
> @@ -2463,12 +2463,14 @@ class LDRTImmediate<bit has_offset, stri
>   let Inst{21} = 1; // overwrite
>   let Inst{19-16} = addr;
>   let Inst{11-0} = !if(has_offset, offset{11-0}, 0);
> -  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> }
> 
> def LDRT_POST_IMM
>   : LDRTImmediate<1, "\t$Rt, $addr, $offset",
> -                  (ins addr_offset_none:$addr, am2offset_imm:$offset)>;
> +                  (ins addr_offset_none:$addr, am2offset_imm:$offset)> {
> +  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> +}
> +
> def LDRT_POST_IMM_0
>   : LDRTImmediate<0, "\t$Rt, $addr", (ins addr_offset_none:$addr)>;
> 
> @@ -2504,12 +2506,14 @@ class LDRBTImmediate<bit has_offset, str
>   let Inst{21} = 1; // overwrite
>   let Inst{19-16} = addr;
>   let Inst{11-0} = !if(has_offset, offset{11-0}, 0);
> -  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> }
> 
> def LDRBT_POST_IMM
>   : LDRBTImmediate<1, "\t$Rt, $addr, $offset",
> -                   (ins addr_offset_none:$addr, am2offset_imm:$offset)>;
> +                   (ins addr_offset_none:$addr, am2offset_imm:$offset)> {
> +  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> +}
> +
> def LDRBT_POST_IMM_0
>   : LDRBTImmediate<0, "\t$Rt, $addr", (ins addr_offset_none:$addr)>;
> 
> @@ -2785,12 +2789,15 @@ class STRBTImmediate<bit has_offset, str
>   let Inst{21} = 1; // overwrite
>   let Inst{19-16} = addr;
>   let Inst{11-0} = !if(has_offset, offset{11-0}, 0);
> -  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> }
> 
> def STRBT_POST_IMM
>   : STRBTImmediate<1, "\t$Rt, $addr, $offset",
> -                   (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset)>;
> +                 (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset)> {
> +  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> +}
> +
> +
> def STRBT_POST_IMM_0
>   : STRBTImmediate<0, "\t$Rt, $addr", (ins GPR:$Rt, addr_offset_none:$addr)>;
> 
> @@ -2826,12 +2833,14 @@ class STRTImmediate<bit has_offset, stri
>   let Inst{21} = 1; // overwrite
>   let Inst{19-16} = addr;
>   let Inst{11-0} = !if(has_offset, offset{11-0}, 0);
> -  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> }
> 
> def STRT_POST_IMM
>   : STRTImmediate<1, "\t$Rt, $addr, $offset",
> -                  (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset)>;
> +                 (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset)> {
> +  let DecoderMethod = "DecodeAddrMode2IdxInstruction";
> +}
> +
> def STRT_POST_IMM_0
>   : STRTImmediate<0, "\t$Rt, $addr", (ins GPR:$Rt, addr_offset_none:$addr)>;
> }
> 
> Added: llvm/trunk/test/MC/Disassembler/ARM/addrmode2-reencoding.txt
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/ARM/addrmode2-reencoding.txt?rev=198944&view=auto
> ==============================================================================
> --- llvm/trunk/test/MC/Disassembler/ARM/addrmode2-reencoding.txt (added)
> +++ llvm/trunk/test/MC/Disassembler/ARM/addrmode2-reencoding.txt Fri Jan 10 10:22:47 2014
> @@ -0,0 +1,12 @@
> +# RUN: llvm-mc -triple armv7 -show-encoding -disassemble < %s | FileCheck %s
> +
> +0x00 0x10 0xb0 0xe4
> +0x00 0x10 0xf0 0xe4
> +0x00 0x10 0xa0 0xe4
> +0x00 0x10 0xe0 0xe4
> +
> +# CHECK: ldrt r1, [r0]    @ encoding: [0x00,0x10,0xb0,0xe4]
> +# CHECK: ldrbt r1, [r0]   @ encoding: [0x00,0x10,0xf0,0xe4]
> +# CHECK: strt r1, [r0]    @ encoding: [0x00,0x10,0xa0,0xe4]
> +# CHECK: strbt r1, [r0]   @ encoding: [0x00,0x10,0xe0,0xe4]
> +
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list