[PATCH] D32534: [ARM] Add support for ORR and ORN instruction substitutions

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 04:44:35 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL302224: [ARM] Add support for ORR and ORN instruction substitutions (authored by john.brawn).

Changed prior to commit:
  https://reviews.llvm.org/D32534?vs=96715&id=97933#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D32534

Files:
  llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
  llvm/trunk/test/MC/ARM/negative-immediates-fail.s
  llvm/trunk/test/MC/ARM/negative-immediates-thumb1-fail.s
  llvm/trunk/test/MC/ARM/negative-immediates.s


Index: llvm/trunk/test/MC/ARM/negative-immediates-thumb1-fail.s
===================================================================
--- llvm/trunk/test/MC/ARM/negative-immediates-thumb1-fail.s
+++ llvm/trunk/test/MC/ARM/negative-immediates-thumb1-fail.s
@@ -13,3 +13,8 @@
 
 SUBs r0, #0xFFFFFEFF
 # CHECK: error: immediate operand must be in the range [0,255]
+
+ORRs r0, r1, #0xFFFFFF00
+# CHECK: error: instruction requires: thumb2
+ORNs r0, r1, #0xFFFFFF00
+# CHECK: error: instruction requires: thumb2
Index: llvm/trunk/test/MC/ARM/negative-immediates.s
===================================================================
--- llvm/trunk/test/MC/ARM/negative-immediates.s
+++ llvm/trunk/test/MC/ARM/negative-immediates.s
@@ -98,6 +98,22 @@
 # CHECK: and r0, r1, #16777472 @ encoding: [0x01,0xf0,0x01,0x20]
 # CHECK-DISABLED: error: instruction requires: NegativeImmediates
 # CHECK-DISABLED: BIC
+	ORR r0, r1, #0xFFFFFF00
+# CHECK-DISABLED: error: instruction requires: NegativeImmediates
+# CHECK-DISABLED: ORR
+# CHECK: orn r0, r1, #255
+	ORR r0, r1, #0xFEFFFEFF
+# CHECK: orn r0, r1, #16777472 @ encoding: [0x61,0xf0,0x01,0x20]
+# CHECK-DISABLED: error: instruction requires: NegativeImmediates
+# CHECK-DISABLED: ORR
+	ORN r0, r1, #0xFFFFFF00
+# CHECK: orr r0, r1, #255
+# CHECK-DISABLED: error: instruction requires: NegativeImmediates
+# CHECK-DISABLED: ORN
+	ORN r0, r1, #0xFEFFFEFF
+# CHECK: orr r0, r1, #16777472 @ encoding: [0x41,0xf0,0x01,0x20]
+# CHECK-DISABLED: error: instruction requires: NegativeImmediates
+# CHECK-DISABLED: ORN
 	CMP r0, #0xFFFFFF01
 # CHECK: cmn.w r0, #255
 # CHECK-DISABLED: error: instruction requires: NegativeImmediates
Index: llvm/trunk/test/MC/ARM/negative-immediates-fail.s
===================================================================
--- llvm/trunk/test/MC/ARM/negative-immediates-fail.s
+++ llvm/trunk/test/MC/ARM/negative-immediates-fail.s
@@ -11,3 +11,8 @@
 
 ADD.W r0, r0, #0xFF01FF01
 # CHECK: error: immediate operand must be in the range [0,7]
+
+ORR r0, r1, #0xFFFFFF00
+# CHECK: error: instruction requires: thumb2
+ORN r0, r1, #0xFFFFFF00
+# CHECK: error: instruction requires: thumb2
Index: llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
===================================================================
--- llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
+++ llvm/trunk/lib/Target/ARM/ARMInstrThumb2.td
@@ -4706,6 +4706,19 @@
 def : t2InstSubst<"and${s}${p} $Rdn, $imm",
                   (t2BICri rGPR:$Rdn, rGPR:$Rdn, t2_so_imm_not:$imm,
                            pred:$p, cc_out:$s)>;
+// And ORR <--> ORN
+def : t2InstSubst<"orn${s}${p} $Rd, $Rn, $imm",
+                  (t2ORRri rGPR:$Rd, rGPR:$Rn, t2_so_imm_not:$imm,
+                           pred:$p, cc_out:$s)>;
+def : t2InstSubst<"orn${s}${p} $Rdn, $imm",
+                  (t2ORRri rGPR:$Rdn, rGPR:$Rdn, t2_so_imm_not:$imm,
+                           pred:$p, cc_out:$s)>;
+def : t2InstSubst<"orr${s}${p} $Rd, $Rn, $imm",
+                  (t2ORNri rGPR:$Rd, rGPR:$Rn, t2_so_imm_not:$imm,
+                           pred:$p, cc_out:$s)>;
+def : t2InstSubst<"orr${s}${p} $Rdn, $imm",
+                  (t2ORNri rGPR:$Rdn, rGPR:$Rdn, t2_so_imm_not:$imm,
+                           pred:$p, cc_out:$s)>;
 // Likewise, "add Rd, t2_so_imm_neg" -> sub
 def : t2InstSubst<"add${s}${p} $Rd, $Rn, $imm",
                   (t2SUBri GPRnopc:$Rd, GPRnopc:$Rn, t2_so_imm_neg:$imm,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32534.97933.patch
Type: text/x-patch
Size: 3405 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170505/c1881d16/attachment.bin>


More information about the llvm-commits mailing list