]> granicus.if.org Git - llvm/commitdiff
[Hexagon] Adding A2_sub instruction
authorColin LeMahieu <colinl@codeaurora.org>
Tue, 18 Nov 2014 21:51:51 +0000 (21:51 +0000)
committerColin LeMahieu <colinl@codeaurora.org>
Tue, 18 Nov 2014 21:51:51 +0000 (21:51 +0000)
Renaming test files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222263 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonInstrInfo.td
test/MC/Hexagon/inst_add.ll [moved from test/MC/Hexagon/instructions.ll with 100% similarity]
test/MC/Hexagon/inst_sub.ll [new file with mode: 0644]

index 3acefd5851f8469bc547cd13b46d02e73783cc03..f06c1dcd0b1fd7cf38368b7fa34a580004669999 100644 (file)
@@ -162,6 +162,7 @@ multiclass T_ALU32_3op_A2<string mnemonic, bits<3> MajOp, bits<3> MinOp,
 
 let isCodeGenOnly = 0 in
 defm add : T_ALU32_3op_A2<"add", 0b011, 0b000, 0, 1>;
+defm sub : T_ALU32_3op_A2<"sub", 0b011, 0b001, 1, 0>;
 
 // Pats for instruction selection.
 class BinOp32_pat<SDNode Op, InstHexagon MI, ValueType ResT>
@@ -169,6 +170,7 @@ class BinOp32_pat<SDNode Op, InstHexagon MI, ValueType ResT>
         (ResT (MI IntRegs:$Rs, IntRegs:$Rt))>;
 
 def: BinOp32_pat<add, A2_add, i32>;
+def: BinOp32_pat<sub, A2_sub, i32>;
 
 multiclass ALU32_Pbase<string mnemonic, RegisterClass RC, bit isNot,
                        bit isPredNew> {
diff --git a/test/MC/Hexagon/inst_sub.ll b/test/MC/Hexagon/inst_sub.ll
new file mode 100644 (file)
index 0000000..7523aa6
--- /dev/null
@@ -0,0 +1,10 @@
+;; RUN: llc -mtriple=hexagon-unknown-elf -filetype=obj %s -o - \
+;; RUN: | llvm-objdump -s - | FileCheck %s
+
+define i32 @foo (i32 %a, i32 %b)
+{
+  %1 = sub i32 %a, %b
+  ret i32 %1
+}
+
+; CHECK:  0000 004021f3 00c09f52
\ No newline at end of file