[llvm] r222396 - [Hexagon] Adding A2_or instruction with IR selection pattern and test.

Colin LeMahieu colinl at codeaurora.org
Wed Nov 19 14:58:05 PST 2014


Author: colinl
Date: Wed Nov 19 16:58:04 2014
New Revision: 222396

URL: http://llvm.org/viewvc/llvm-project?rev=222396&view=rev
Log:
[Hexagon] Adding A2_or instruction with IR selection pattern and test.

Added:
    llvm/trunk/test/MC/Hexagon/inst_or.ll
Modified:
    llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td

Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp?rev=222396&r1=222395&r2=222396&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Wed Nov 19 16:58:04 2014
@@ -1303,12 +1303,14 @@ bool HexagonInstrInfo::isConditionalALU3
     case Hexagon::A2_pandfnew:
     case Hexagon::A2_pandt:
     case Hexagon::A2_pandtnew:
+    case Hexagon::A2_porf:
+    case Hexagon::A2_porfnew:
+    case Hexagon::A2_port:
+    case Hexagon::A2_portnew:
     case Hexagon::ADD_ri_cPt:
     case Hexagon::ADD_ri_cNotPt:
     case Hexagon::XOR_rr_cPt:
     case Hexagon::XOR_rr_cNotPt:
-    case Hexagon::OR_rr_cPt:
-    case Hexagon::OR_rr_cNotPt:
     case Hexagon::SUB_rr_cPt:
     case Hexagon::SUB_rr_cNotPt:
     case Hexagon::COMBINE_rr_cPt:

Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td?rev=222396&r1=222395&r2=222396&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td Wed Nov 19 16:58:04 2014
@@ -163,6 +163,7 @@ multiclass T_ALU32_3op_A2<string mnemoni
 let isCodeGenOnly = 0 in
 defm add : T_ALU32_3op_A2<"add", 0b011, 0b000, 0, 1>;
 defm and : T_ALU32_3op_A2<"and", 0b001, 0b000, 0, 1>;
+defm or  : T_ALU32_3op_A2<"or",  0b001, 0b001, 0, 1>;
 defm sub : T_ALU32_3op_A2<"sub", 0b011, 0b001, 1, 0>;
 
 // Pats for instruction selection.
@@ -172,6 +173,7 @@ class BinOp32_pat<SDNode Op, InstHexagon
 
 def: BinOp32_pat<add, A2_add, i32>;
 def: BinOp32_pat<and, A2_and, i32>;
+def: BinOp32_pat<or,  A2_or,  i32>;
 def: BinOp32_pat<sub, A2_sub, i32>;
 
 multiclass ALU32_Pbase<string mnemonic, RegisterClass RC, bit isNot,
@@ -211,7 +213,6 @@ multiclass ALU32_base<string mnemonic, s
 
 let isCommutable = 1 in {
   defm XOR_rr : ALU32_base<"xor", "XOR", xor>, ImmRegRel, PredNewRel;
-  defm OR_rr  : ALU32_base<"or", "OR", or>, ImmRegRel, PredNewRel;
 }
 
 defm SUB_rr : ALU32_base<"sub", "SUB", sub>, ImmRegRel, PredNewRel;

Added: llvm/trunk/test/MC/Hexagon/inst_or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/inst_or.ll?rev=222396&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/inst_or.ll (added)
+++ llvm/trunk/test/MC/Hexagon/inst_or.ll Wed Nov 19 16:58:04 2014
@@ -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 = or i32 %a, %b
+  ret i32 %1
+}
+
+; CHECK:   0000 004120f1 00c09f52
\ No newline at end of file





More information about the llvm-commits mailing list