[llvm] r222668 - [Hexagon] Adding aslh instruction.
Colin LeMahieu
colinl at codeaurora.org
Mon Nov 24 09:44:19 PST 2014
Author: colinl
Date: Mon Nov 24 11:44:19 2014
New Revision: 222668
URL: http://llvm.org/viewvc/llvm-project?rev=222668&view=rev
Log:
[Hexagon] Adding aslh instruction.
Added:
llvm/trunk/test/MC/Hexagon/inst_aslh.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=222668&r1=222667&r2=222668&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Mon Nov 24 11:44:19 2014
@@ -713,7 +713,7 @@ bool HexagonInstrInfo::isPredicable(Mach
case Hexagon::ADD_ri:
return isInt<8>(MI->getOperand(2).getImm());
- case Hexagon::ASLH:
+ case Hexagon::A2_aslh:
case Hexagon::ASRH:
case Hexagon::A2_sxtb:
case Hexagon::A2_sxth:
@@ -1303,6 +1303,10 @@ bool HexagonInstrInfo::isConditionalALU3
case Hexagon::A2_pandfnew:
case Hexagon::A2_pandt:
case Hexagon::A2_pandtnew:
+ case Hexagon::A4_paslhf:
+ case Hexagon::A4_paslhfnew:
+ case Hexagon::A4_paslht:
+ case Hexagon::A4_paslhtnew:
case Hexagon::A2_porf:
case Hexagon::A2_porfnew:
case Hexagon::A2_port:
@@ -1336,8 +1340,6 @@ bool HexagonInstrInfo::isConditionalALU3
case Hexagon::COMBINE_rr_cPt:
case Hexagon::COMBINE_rr_cNotPt:
return true;
- case Hexagon::ASLH_cPt_V4:
- case Hexagon::ASLH_cNotPt_V4:
case Hexagon::ASRH_cPt_V4:
case Hexagon::ASRH_cNotPt_V4:
return QRI.Subtarget.hasV4TOps();
Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td?rev=222668&r1=222667&r2=222668&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.td Mon Nov 24 11:44:19 2014
@@ -265,6 +265,7 @@ multiclass ALU32_2op_base<string mnemoni
}
}
+defm aslh : ALU32_2op_base<"aslh", 0b000>, PredNewRel;
defm sxtb : ALU32_2op_base<"sxtb", 0b101>, PredNewRel;
defm sxth : ALU32_2op_base<"sxth", 0b111>, PredNewRel;
defm zxth : ALU32_2op_base<"zxth", 0b110>, PredNewRel;
@@ -634,11 +635,10 @@ multiclass ALU32_2op_base2<string mnemon
}
}
-defm ASLH : ALU32_2op_base2<"aslh">, PredNewRel;
defm ASRH : ALU32_2op_base2<"asrh">, PredNewRel;
def : Pat <(shl (i32 IntRegs:$src1), (i32 16)),
- (ASLH IntRegs:$src1)>;
+ (A2_aslh IntRegs:$src1)>;
def : Pat <(sra (i32 IntRegs:$src1), (i32 16)),
(ASRH IntRegs:$src1)>;
Added: llvm/trunk/test/MC/Hexagon/inst_aslh.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/inst_aslh.ll?rev=222668&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/inst_aslh.ll (added)
+++ llvm/trunk/test/MC/Hexagon/inst_aslh.ll Mon Nov 24 11:44:19 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)
+{
+ %1 = shl i32 %a, 16
+ ret i32 %1
+}
+
+; CHECK: 0000 00400070 00c09f52
\ No newline at end of file
More information about the llvm-commits
mailing list