diff --git a/llvm/lib/Target/ARM/ARMInstrThumb2.td b/llvm/lib/Target/ARM/ARMInstrThumb2.td --- a/llvm/lib/Target/ARM/ARMInstrThumb2.td +++ b/llvm/lib/Target/ARM/ARMInstrThumb2.td @@ -1563,6 +1563,14 @@ Sched<[WriteLd]>; } // mayLoad = 1, hasSideEffects = 0 +// F5.1.72 LDR (immediate) T4 +// .w suffixes; t2InstAlias isn't descriptive enough for $Rn = $Rn_wb +// Constraint. +def t2LDR_PRE_imm : t2AsmPseudo<"ldr${p}.w $Rt, $addr!", + (ins GPR:$Rt, t2addrmode_imm8_pre:$addr, pred:$p)>; +def t2LDR_POST_imm : t2AsmPseudo<"ldr${p}.w $Rt, $Rn, $imm", + (ins GPR:$Rt, addr_offset_none:$Rn, t2am_imm8_offset:$imm, pred:$p)>; + // LDRT, LDRBT, LDRHT, LDRSBT, LDRSHT all have offset mode (PUW=0b110). // Ref: A8.6.57 LDR (immediate, Thumb) Encoding T4 class T2IldT type, string opc, InstrItinClass ii> @@ -1720,6 +1728,14 @@ Sched<[WriteST]>; } +// F5.1.229 STR (immediate) T4 +// .w suffixes; t2InstAlias isn't descriptive enough for $Rn = $Rn_wb +// Constraint. +def t2STR_PRE_imm : t2AsmPseudo<"str${p}.w $Rt, $addr!", + (ins GPR:$Rt, t2addrmode_imm8_pre:$addr, pred:$p)>; +def t2STR_POST_imm : t2AsmPseudo<"str${p}.w $Rt, $Rn, $imm", + (ins GPR:$Rt, addr_offset_none:$Rn, t2am_imm8_offset:$imm, pred:$p)>; + // STRT, STRBT, STRHT all have offset mode (PUW=0b110) and are for disassembly // only. // Ref: A8.6.193 STR (immediate, Thumb) Encoding T4 diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp --- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -7658,6 +7658,26 @@ "source register and base register can't be identical"); return false; } + case ARM::t2LDR_PRE_imm: + case ARM::t2LDR_POST_imm: + case ARM::t2STR_PRE_imm: + case ARM::t2STR_POST_imm: { + // Rt must be different from Rn. + const unsigned Rt = MRI->getEncodingValue(Inst.getOperand(0).getReg()); + const unsigned Rn = MRI->getEncodingValue(Inst.getOperand(1).getReg()); + + if (Rt == Rn) + return Error(Operands[3]->getStartLoc(), + "destination register and base register can't be identical"); + if (Inst.getOpcode() == ARM::t2LDR_POST_imm || + Inst.getOpcode() == ARM::t2STR_POST_imm) { + int imm = Inst.getOperand(2).getImm(); + if (imm > 255 || imm < -255) + return Error(Operands[5]->getStartLoc(), + "operand must be in range [-255, 255]"); + } + return false; + } case ARM::LDR_PRE_IMM: case ARM::LDR_PRE_REG: case ARM::t2LDR_PRE: @@ -8625,6 +8645,34 @@ Inst = TmpInst; return true; } + // Aliases for imm syntax of LDR instructions. + case ARM::t2LDR_PRE_imm: + case ARM::t2LDR_POST_imm: { + MCInst TmpInst; + TmpInst.setOpcode(Inst.getOpcode() == ARM::t2LDR_PRE_imm ? ARM::t2LDR_PRE + : ARM::t2LDR_POST); + TmpInst.addOperand(Inst.getOperand(0)); // Rt + TmpInst.addOperand(Inst.getOperand(4)); // Rt_wb??? + TmpInst.addOperand(Inst.getOperand(1)); // Rn + TmpInst.addOperand(Inst.getOperand(2)); // imm + TmpInst.addOperand(Inst.getOperand(3)); // CondCode + Inst = TmpInst; + return true; + } + // Aliases for imm syntax of STR instructions. + case ARM::t2STR_PRE_imm: + case ARM::t2STR_POST_imm: { + MCInst TmpInst; + TmpInst.setOpcode(Inst.getOpcode() == ARM::t2STR_PRE_imm ? ARM::t2STR_PRE + : ARM::t2STR_POST); + TmpInst.addOperand(Inst.getOperand(4)); // Rt_wb??? + TmpInst.addOperand(Inst.getOperand(0)); // Rt + TmpInst.addOperand(Inst.getOperand(1)); // Rn + TmpInst.addOperand(Inst.getOperand(2)); // imm + TmpInst.addOperand(Inst.getOperand(3)); // CondCode??? + Inst = TmpInst; + return true; + } // Aliases for alternate PC+imm syntax of LDR instructions. case ARM::t2LDRpcrel: // Select the narrow version if the immediate will fit. diff --git a/llvm/test/MC/ARM/thumb2-ldr.w-str.w.s b/llvm/test/MC/ARM/thumb2-ldr.w-str.w.s new file mode 100644 --- /dev/null +++ b/llvm/test/MC/ARM/thumb2-ldr.w-str.w.s @@ -0,0 +1,498 @@ +@ RUN: not llvm-mc -triple=thumbv7-unknown-linux-gnueabi -arm-implicit-it=thumb -show-encoding < %s 2>&1 | FileCheck %s +.syntax unified + +@ Note: The error stream for XFAIL needs to get checked first. + +ldr.w r1, [r1, #-4]! +ldr.w sp, [r1, #-4]! @ TODO: GAS warns for this +ldr.w r1, [r0, #256]! +ldr.w r1, [r0, #-256]! +ldr.w r1, [pc, #-4]! +ldr.w r1, [r1], #4 +ldr.w sp, [r1], #4 @ TODO: GAS warns for this +ldr.w r0, [r0], #4 +ldr.w r0, [pc], #4 @ TODO: GAS warns for this +ldr.w r0, [r1], #256 +ldr.w r0, [r1], #-256 +str.w r0, [r0, #-4]! +str.w pc, [r0, #-4]! @ TODO: something funny with this one. +str.w r1, [pc, #-4]! +str.w r1, [r2, #256]! +str.w r1, [r2, #-256]! +str.w r0, [r0], #4 +str.w pc, [r0], #4 @ TODO: GAS warns for this. +str.w r0, [pc], #4 @ TODO: GAS warns for this. +str.w r1, [r0], #256 +str.w r1, [r0], #-256 + +@@ XFAIL + +@ CHECK: error: destination register and base register can't be identical +@ CHECK-NEXT: ldr.w r1, [r1, #-4]! +@ CHECK: error: invalid instruction, any one of the following would fix this: +@ CHECK-NEXT: ldr.w r1, [r0, #256]! +@ CHECK: note: invalid operand for instruction +@ CHECK: note: too many operands for instruction +@ CHECK: error: invalid operand for instruction +@ CHECK-NEXT: ldr.w r1, [r0, #-256]! +@ CHECK: error: invalid instruction, any one of the following would fix this: +@ CHECK-NEXT: ldr.w r1, [pc, #-4]! +@ CHECK: note: invalid operand for instruction +@ CHECK: note: too many operands for instruction +@ CHECK: error: destination register and base register can't be identical +@ CHECK-NEXT: ldr.w r1, [r1], #4 +@ CHECK: error: destination register and base register can't be identical +@ CHECK-NEXT: ldr.w r0, [r0], #4 +@ CHECK: error: operand must be in range [-255, 255] +@ CHECK-NEXT: ldr.w r0, [r1], #256 +@ CHECK: error: operand must be in range [-255, 255] +@ CHECK-NEXT: ldr.w r0, [r1], #-256 +@ CHECK: error: destination register and base register can't be identical +@ CHECK-NEXT: str.w r0, [r0, #-4]! +@ CHECK: error: invalid operand for instruction +@ CHECK-NEXT: str.w r1, [pc, #-4]! +@ CHECK: error: invalid instruction, any one of the following would fix this: +@ CHECK-NEXT: str.w r1, [r2, #256]! +@ CHECK: note: invalid operand for instruction +@ CHECK: note: too many operands for instruction +@ CHECK: error: invalid operand for instruction +@ CHECK-NEXT: str.w r1, [r2, #-256]! +@ CHECK: error: destination register and base register can't be identical +@ CHECK-NEXT: str.w r0, [r0], #4 +@ CHECK: error: operand must be in range [-255, 255] +@ CHECK-NEXT: str.w r1, [r0], #256 +@ CHECK: error: operand must be in range [-255, 255] +@ CHECK-NEXT: str.w r1, [r0], #-256 + +@@ XPASS + +@ Simple checks that we get the same encoding w/ and w/o the .w suffix. +ldr r3, [r1], #4 +ldr.w r3, [r1], #4 + +str r3, [r0], #4 +str.w r3, [r0], #4 + +ldr r3, [r1, #-4]! +ldr.w r3, [r1, #-4]! + +str r3, [r0, #-4]! +str.w r3, [r0, #-4]! + +@ CHECK: ldr r3, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x3b] +@ CHECK: ldr r3, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x3b] +@ CHECK: str r3, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x3b] +@ CHECK: str r3, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x3b] +@ CHECK: ldr r3, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x3d] +@ CHECK: ldr r3, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x3d] +@ CHECK: str r3, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x3d] +@ CHECK: str r3, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x3d] + +@@ LDR pre-increment +@ Vary Rt. +ldr.w r0, [r1, #-4]! +ldr.w r2, [r1, #-4]! +ldr.w r4, [r1, #-4]! +ldr.w r5, [r1, #-4]! +ldr.w r6, [r1, #-4]! +ldr.w r7, [r1, #-4]! +ldr.w r8, [r1, #-4]! +ldr.w r9, [r1, #-4]! +ldr.w sl, [r1, #-4]! +ldr.w fp, [r1, #-4]! +ldr.w ip, [r1, #-4]! +ldr.w lr, [r1, #-4]! +ldr.w pc, [r1, #-4]! +@ Vary Rn. +ldr.w r1, [r0, #-4]! +ldr.w r1, [r2, #-4]! +ldr.w r1, [r3, #-4]! +ldr.w r1, [r4, #-4]! +ldr.w r1, [r5, #-4]! +ldr.w r1, [r6, #-4]! +ldr.w r1, [r7, #-4]! +ldr.w r1, [r8, #-4]! +ldr.w r1, [r9, #-4]! +ldr.w r1, [sl, #-4]! +ldr.w r1, [fp, #-4]! +ldr.w r1, [ip, #-4]! +ldr.w r1, [sp, #-4]! +ldr.w r1, [lr, #-4]! +@ Vary imm. +ldr.w r1, [r0, #255]! +ldr.w r1, [r0, #-255]! +ldr.w r1, [r0, #0]! +@ Condition codes. +ldreq.w r1, [r0, #255]! +ldrne.w r1, [r0, #255]! +ldrhs.w r1, [r0, #255]! +ldrlo.w r1, [r0, #255]! +ldrmi.w r1, [r0, #255]! +ldrpl.w r1, [r0, #255]! +ldrvs.w r1, [r0, #255]! +ldrvc.w r1, [r0, #255]! +ldrhi.w r1, [r0, #255]! +ldrls.w r1, [r0, #255]! +ldrge.w r1, [r0, #255]! +ldrlt.w r1, [r0, #255]! +ldrgt.w r1, [r0, #255]! +ldrle.w r1, [r0, #255]! +@ TODO: check cs(hs), cc(lo), or al condition codes? + +@ CHECK: ldr r0, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x0d] +@ CHECK: ldr r2, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x2d] +@ CHECK: ldr r4, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x4d] +@ CHECK: ldr r5, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x5d] +@ CHECK: ldr r6, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x6d] +@ CHECK: ldr r7, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x7d] +@ CHECK: ldr r8, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x8d] +@ CHECK: ldr r9, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0x9d] +@ CHECK: ldr r10, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xad] +@ CHECK: ldr r11, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xbd] +@ CHECK: ldr r12, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xcd] +@ CHECK: ldr lr, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xed] +@ CHECK: ldr pc, [r1, #-4]! @ encoding: [0x51,0xf8,0x04,0xfd] +@ CHECK: ldr r1, [r0, #-4]! @ encoding: [0x50,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r2, #-4]! @ encoding: [0x52,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r3, #-4]! @ encoding: [0x53,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r4, #-4]! @ encoding: [0x54,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r5, #-4]! @ encoding: [0x55,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r6, #-4]! @ encoding: [0x56,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r7, #-4]! @ encoding: [0x57,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r8, #-4]! @ encoding: [0x58,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r9, #-4]! @ encoding: [0x59,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r10, #-4]! @ encoding: [0x5a,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r11, #-4]! @ encoding: [0x5b,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r12, #-4]! @ encoding: [0x5c,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [sp, #-4]! @ encoding: [0x5d,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [lr, #-4]! @ encoding: [0x5e,0xf8,0x04,0x1d] +@ CHECK: ldr r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldr r1, [r0, #-255]! @ encoding: [0x50,0xf8,0xff,0x1d] +@ CHECK: ldr r1, [r0, #0]! @ encoding: [0x50,0xf8,0x00,0x1f] +@ CHECK: ite eq @ encoding: [0x0c,0xbf] +@ CHECK: ldreq r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrne r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ite hs @ encoding: [0x2c,0xbf] +@ CHECK: ldrhs r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrlo r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ite mi @ encoding: [0x4c,0xbf] +@ CHECK: ldrmi r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrpl r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ite vs @ encoding: [0x6c,0xbf] +@ CHECK: ldrvs r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrvc r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ite hi @ encoding: [0x8c,0xbf] +@ CHECK: ldrhi r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrls r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ite ge @ encoding: [0xac,0xbf] +@ CHECK: ldrge r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] +@ CHECK: ldrlt r1, [r0, #255]! @ encoding: [0x50,0xf8,0xff,0x1f] + +@@ LDR post-increment +@ Vary Rt. +ldr.w r0, [r1], #4 +ldr.w r2, [r1], #4 +ldr.w r3, [r1], #4 +ldr.w r4, [r1], #4 +ldr.w r5, [r1], #4 +ldr.w r6, [r1], #4 +ldr.w r7, [r1], #4 +ldr.w r8, [r1], #4 +ldr.w r9, [r1], #4 +ldr.w sl, [r1], #4 +ldr.w fp, [r1], #4 +ldr.w ip, [r1], #4 +ldr.w lr, [r1], #4 +ldr.w pc, [r1], #4 +@ Vary Rn. +ldr.w r0, [r1], #4 +ldr.w r0, [r2], #4 +ldr.w r0, [r3], #4 +ldr.w r0, [r4], #4 +ldr.w r0, [r5], #4 +ldr.w r0, [r6], #4 +ldr.w r0, [r7], #4 +ldr.w r0, [r8], #4 +ldr.w r0, [r9], #4 +ldr.w r0, [sl], #4 +ldr.w r0, [fp], #4 +ldr.w r0, [ip], #4 +ldr.w r0, [sp], #4 +ldr.w r0, [lr], #4 +@ Vary imm. +ldr.w r0, [r1], #255 +ldr.w r0, [r1], #0 +ldr.w r0, [r1], #-255 +@ Condition codes. +ldreq.w r0, [r1], #255 +ldrne.w r0, [r1], #255 +ldrhs.w r0, [r1], #255 +ldrlo.w r0, [r1], #255 +ldrmi.w r0, [r1], #255 +ldrpl.w r0, [r1], #255 +ldrvs.w r0, [r1], #255 +ldrvc.w r0, [r1], #255 +ldrhi.w r0, [r1], #255 +ldrls.w r0, [r1], #255 +ldrge.w r0, [r1], #255 +ldrlt.w r0, [r1], #255 +ldrgt.w r0, [r1], #255 +ldrle.w r0, [r1], #255 +@ TODO: check cs(hs), cc(lo), or al condition codes? + +@ CHECK: ldr r0, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x0b] +@ CHECK: ldr r2, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x2b] +@ CHECK: ldr r3, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x3b] +@ CHECK: ldr r4, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x4b] +@ CHECK: ldr r5, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x5b] +@ CHECK: ldr r6, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x6b] +@ CHECK: ldr r7, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x7b] +@ CHECK: ldr r8, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x8b] +@ CHECK: ldr r9, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x9b] +@ CHECK: ldr r10, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xab] +@ CHECK: ldr r11, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xbb] +@ CHECK: ldr r12, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xcb] +@ CHECK: ldr lr, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xeb] +@ CHECK: ldr pc, [r1], #4 @ encoding: [0x51,0xf8,0x04,0xfb] +@ CHECK: ldr r0, [r1], #4 @ encoding: [0x51,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r2], #4 @ encoding: [0x52,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r3], #4 @ encoding: [0x53,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r4], #4 @ encoding: [0x54,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r5], #4 @ encoding: [0x55,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r6], #4 @ encoding: [0x56,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r7], #4 @ encoding: [0x57,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r8], #4 @ encoding: [0x58,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r9], #4 @ encoding: [0x59,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r10], #4 @ encoding: [0x5a,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r11], #4 @ encoding: [0x5b,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r12], #4 @ encoding: [0x5c,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [sp], #4 @ encoding: [0x5d,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [lr], #4 @ encoding: [0x5e,0xf8,0x04,0x0b] +@ CHECK: ldr r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldr r0, [r1], #0 @ encoding: [0x51,0xf8,0x00,0x0b] +@ CHECK: ldr r0, [r1], #-255 @ encoding: [0x51,0xf8,0xff,0x09] +@ CHECK: ite eq @ encoding: [0x0c,0xbf] +@ CHECK: ldreq r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrne r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite hs @ encoding: [0x2c,0xbf] +@ CHECK: ldrhs r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrlo r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite mi @ encoding: [0x4c,0xbf] +@ CHECK: ldrmi r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrpl r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite vs @ encoding: [0x6c,0xbf] +@ CHECK: ldrvs r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrvc r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite hi @ encoding: [0x8c,0xbf] +@ CHECK: ldrhi r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrls r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite ge @ encoding: [0xac,0xbf] +@ CHECK: ldrge r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrlt r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ite gt @ encoding: [0xcc,0xbf] +@ CHECK: ldrgt r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] +@ CHECK: ldrle r0, [r1], #255 @ encoding: [0x51,0xf8,0xff,0x0b] + +@@ STR pre-increment +@ Vary Rt. +str.w r1, [r0, #-4]! +str.w r2, [r0, #-4]! +str.w r3, [r0, #-4]! +str.w r4, [r0, #-4]! +str.w r5, [r0, #-4]! +str.w r6, [r0, #-4]! +str.w r7, [r0, #-4]! +str.w r8, [r0, #-4]! +str.w r9, [r0, #-4]! +str.w sl, [r0, #-4]! +str.w fp, [r0, #-4]! +str.w ip, [r0, #-4]! +str.w sp, [r0, #-4]! +str.w lr, [r0, #-4]! +@ Vary Rn. +str.w r1, [r2, #-4]! +str.w r1, [r3, #-4]! +str.w r1, [r4, #-4]! +str.w r1, [r5, #-4]! +str.w r1, [r6, #-4]! +str.w r1, [r7, #-4]! +str.w r1, [r8, #-4]! +str.w r1, [r9, #-4]! +str.w r1, [sl, #-4]! +str.w r1, [fp, #-4]! +str.w r1, [ip, #-4]! +str.w r1, [sp, #-4]! +str.w r1, [lr, #-4]! +@ Vary imm. +str.w r1, [r2, #255]! +str.w r1, [r2, #0]! +str.w r1, [r2, #-255]! +@ Condition codes. +streq.w r1, [r2, #255]! +strne.w r1, [r2, #255]! +strhs.w r1, [r2, #255]! +strlo.w r1, [r2, #255]! +strmi.w r1, [r2, #255]! +strpl.w r1, [r2, #255]! +strvs.w r1, [r2, #255]! +strvc.w r1, [r2, #255]! +strhi.w r1, [r2, #255]! +strls.w r1, [r2, #255]! +strge.w r1, [r2, #255]! +strlt.w r1, [r2, #255]! +strgt.w r1, [r2, #255]! +strle.w r1, [r2, #255]! +@ TODO: check cs(hs), cc(lo), or al condition codes? + +@ CHECK: str r1, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x1d] +@ CHECK: str r2, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x2d] +@ CHECK: str r3, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x3d] +@ CHECK: str r4, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x4d] +@ CHECK: str r5, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x5d] +@ CHECK: str r6, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x6d] +@ CHECK: str r7, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x7d] +@ CHECK: str r8, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x8d] +@ CHECK: str r9, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0x9d] +@ CHECK: str r10, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xad] +@ CHECK: str r11, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xbd] +@ CHECK: str r12, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xcd] +@ CHECK: str sp, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xdd] +@ CHECK: str lr, [r0, #-4]! @ encoding: [0x40,0xf8,0x04,0xed] +@ CHECK: str r1, [r2, #-4]! @ encoding: [0x42,0xf8,0x04,0x1d] +@ CHECK: str r1, [r3, #-4]! @ encoding: [0x43,0xf8,0x04,0x1d] +@ CHECK: str r1, [r4, #-4]! @ encoding: [0x44,0xf8,0x04,0x1d] +@ CHECK: str r1, [r5, #-4]! @ encoding: [0x45,0xf8,0x04,0x1d] +@ CHECK: str r1, [r6, #-4]! @ encoding: [0x46,0xf8,0x04,0x1d] +@ CHECK: str r1, [r7, #-4]! @ encoding: [0x47,0xf8,0x04,0x1d] +@ CHECK: str r1, [r8, #-4]! @ encoding: [0x48,0xf8,0x04,0x1d] +@ CHECK: str r1, [r9, #-4]! @ encoding: [0x49,0xf8,0x04,0x1d] +@ CHECK: str r1, [r10, #-4]! @ encoding: [0x4a,0xf8,0x04,0x1d] +@ CHECK: str r1, [r11, #-4]! @ encoding: [0x4b,0xf8,0x04,0x1d] +@ CHECK: str r1, [r12, #-4]! @ encoding: [0x4c,0xf8,0x04,0x1d] +@ CHECK: str r1, [sp, #-4]! @ encoding: [0x4d,0xf8,0x04,0x1d] +@ CHECK: str r1, [lr, #-4]! @ encoding: [0x4e,0xf8,0x04,0x1d] +@ CHECK: streq r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strne r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite hs @ encoding: [0x2c,0xbf] +@ CHECK: strhs r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strlo r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite mi @ encoding: [0x4c,0xbf] +@ CHECK: strmi r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strpl r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite vs @ encoding: [0x6c,0xbf] +@ CHECK: strvs r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strvc r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite hi @ encoding: [0x8c,0xbf] +@ CHECK: strhi r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strls r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite ge @ encoding: [0xac,0xbf] +@ CHECK: strge r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strlt r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: ite gt @ encoding: [0xcc,0xbf] +@ CHECK: strgt r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] +@ CHECK: strle r1, [r2, #255]! @ encoding: [0x42,0xf8,0xff,0x1f] + +@@ STR post-increment +@ Vary Rt. +str.w r1, [r0], #4 +str.w r2, [r0], #4 +str.w r3, [r0], #4 +str.w r4, [r0], #4 +str.w r5, [r0], #4 +str.w r6, [r0], #4 +str.w r7, [r0], #4 +str.w r8, [r0], #4 +str.w r9, [r0], #4 +str.w sl, [r0], #4 +str.w fp, [r0], #4 +str.w ip, [r0], #4 +str.w sp, [r0], #4 +str.w lr, [r0], #4 +@ Vary Rn. +str.w r0, [r1], #4 +str.w r0, [r2], #4 +str.w r0, [r3], #4 +str.w r0, [r4], #4 +str.w r0, [r5], #4 +str.w r0, [r6], #4 +str.w r0, [r7], #4 +str.w r0, [r8], #4 +str.w r0, [r9], #4 +str.w r0, [sl], #4 +str.w r0, [fp], #4 +str.w r0, [ip], #4 +str.w r0, [sp], #4 +str.w r0, [lr], #4 +@ Vary imm. +str.w r1, [r0], #255 +str.w r1, [r0], #0 +str.w r1, [r0], #-255 +@ Condition codes. +streq.w r1, [r0], #255 +strne.w r1, [r0], #255 +strhs.w r1, [r0], #255 +strlo.w r1, [r0], #255 +strmi.w r1, [r0], #255 +strpl.w r1, [r0], #255 +strvs.w r1, [r0], #255 +strvc.w r1, [r0], #255 +strhi.w r1, [r0], #255 +strls.w r1, [r0], #255 +strge.w r1, [r0], #255 +strlt.w r1, [r0], #255 +strgt.w r1, [r0], #255 +strle.w r1, [r0], #255 +@ TODO: check cs(hs), cc(lo), or al condition codes? + +@ CHECK: str r1, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x1b] +@ CHECK: str r2, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x2b] +@ CHECK: str r3, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x3b] +@ CHECK: str r4, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x4b] +@ CHECK: str r5, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x5b] +@ CHECK: str r6, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x6b] +@ CHECK: str r7, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x7b] +@ CHECK: str r8, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x8b] +@ CHECK: str r9, [r0], #4 @ encoding: [0x40,0xf8,0x04,0x9b] +@ CHECK: str r10, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xab] +@ CHECK: str r11, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xbb] +@ CHECK: str r12, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xcb] +@ CHECK: str sp, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xdb] +@ CHECK: str lr, [r0], #4 @ encoding: [0x40,0xf8,0x04,0xeb] +@ CHECK: str r0, [r1], #4 @ encoding: [0x41,0xf8,0x04,0x0b] +@ CHECK: str r0, [r2], #4 @ encoding: [0x42,0xf8,0x04,0x0b] +@ CHECK: str r0, [r3], #4 @ encoding: [0x43,0xf8,0x04,0x0b] +@ CHECK: str r0, [r4], #4 @ encoding: [0x44,0xf8,0x04,0x0b] +@ CHECK: str r0, [r5], #4 @ encoding: [0x45,0xf8,0x04,0x0b] +@ CHECK: str r0, [r6], #4 @ encoding: [0x46,0xf8,0x04,0x0b] +@ CHECK: str r0, [r7], #4 @ encoding: [0x47,0xf8,0x04,0x0b] +@ CHECK: str r0, [r8], #4 @ encoding: [0x48,0xf8,0x04,0x0b] +@ CHECK: str r0, [r9], #4 @ encoding: [0x49,0xf8,0x04,0x0b] +@ CHECK: str r0, [r10], #4 @ encoding: [0x4a,0xf8,0x04,0x0b] +@ CHECK: str r0, [r11], #4 @ encoding: [0x4b,0xf8,0x04,0x0b] +@ CHECK: str r0, [r12], #4 @ encoding: [0x4c,0xf8,0x04,0x0b] +@ CHECK: str r0, [sp], #4 @ encoding: [0x4d,0xf8,0x04,0x0b] +@ CHECK: str r0, [lr], #4 @ encoding: [0x4e,0xf8,0x04,0x0b] +@ CHECK: str r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: str r1, [r0], #0 @ encoding: [0x40,0xf8,0x00,0x1b] +@ CHECK: str r1, [r0], #-255 @ encoding: [0x40,0xf8,0xff,0x19] +@ CHECK: ite eq @ encoding: [0x0c,0xbf] +@ CHECK: streq r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strne r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite hs @ encoding: [0x2c,0xbf] +@ CHECK: strhs r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strlo r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite mi @ encoding: [0x4c,0xbf] +@ CHECK: strmi r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strpl r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite vs @ encoding: [0x6c,0xbf] +@ CHECK: strvs r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strvc r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite hi @ encoding: [0x8c,0xbf] +@ CHECK: strhi r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strls r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite ge @ encoding: [0xac,0xbf] +@ CHECK: strge r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strlt r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: ite gt @ encoding: [0xcc,0xbf] +@ CHECK: strgt r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b] +@ CHECK: strle r1, [r0], #255 @ encoding: [0x40,0xf8,0xff,0x1b]