From: Colin LeMahieu Date: Tue, 10 Nov 2015 00:22:00 +0000 (+0000) Subject: [Hexagon] Fixing store instructions and reenabling a few more tests. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=a7f0a0a566a9e7b0e53fa3124381a040db5df743 [Hexagon] Fixing store instructions and reenabling a few more tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252561 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/Hexagon/HexagonInstrInfoV4.td b/lib/Target/Hexagon/HexagonInstrInfoV4.td index 618ea316e65..7857cfafac8 100644 --- a/lib/Target/Hexagon/HexagonInstrInfoV4.td +++ b/lib/Target/Hexagon/HexagonInstrInfoV4.td @@ -3320,9 +3320,9 @@ let isCall = 1, Uses = [R29, R31], isAsmParserOnly = 1 in { //===----------------------------------------------------------------------===// let hasSideEffects = 0, isPredicable = 1 in class T_StoreAbsGP MajOp, Operand AddrOp, bit isAbs, bit isHalf> - : STInst<(outs), (ins AddrOp:$addr, RC:$src), - mnemonic # !if(isAbs, "(##", "(#")#"$addr) = $src"#!if(isHalf, ".h",""), + bits<2>MajOp, bit isAbs, bit isHalf> + : STInst<(outs), (ins ImmOp:$addr, RC:$src), + mnemonic # "(#$addr) = $src"#!if(isHalf, ".h",""), [], "", V2LDST_tc_st_SLOT01> { bits<19> addr; bits<5> src; @@ -3355,7 +3355,7 @@ class T_StoreAbsGP MajOp, bit isHalf, bit isNot, bit isNew> - : STInst<(outs), (ins PredRegs:$src1, u6Ext:$absaddr, RC: $src2), + : STInst<(outs), (ins PredRegs:$src1, u32MustExt:$absaddr, RC: $src2), !if(isNot, "if (!$src1", "if ($src1")#!if(isNew, ".new) ", ") ")#mnemonic#"(#$absaddr) = $src2"#!if(isHalf, ".h",""), [], "", ST_tc_st_SLOT01>, AddrModeRel { @@ -3387,7 +3387,7 @@ class T_StoreAbs_Pred MajOp, //===----------------------------------------------------------------------===// class T_StoreAbs MajOp, bit isHalf> - : T_StoreAbsGP , + : T_StoreAbsGP , AddrModeRel { string ImmOpStr = !cast(ImmOp); let opExtentBits = !if (!eq(ImmOpStr, "u16_3Imm"), 19, @@ -3554,7 +3554,7 @@ defm storerf : ST_Abs <"memh", "STrif", IntRegs, u16_1Imm, 0b01, 1>; let isAsmParserOnly = 1 in class T_StoreGP MajOp, bit isHalf = 0> - : T_StoreAbsGP { + : T_StoreAbsGP { // Set BaseOpcode same as absolute addressing instructions so that // non-predicated GP-Rel instructions can have relate with predicated // Absolute instruction. @@ -3569,7 +3569,7 @@ multiclass ST_GP ; + 0, isHalf>; // New-value store def NAME#newgp : T_StoreAbsGP_NV ; } diff --git a/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp b/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp index c407e7cb166..9d950b84cc4 100644 --- a/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp +++ b/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp @@ -87,28 +87,23 @@ public: StringRef Contents(Buffer); auto PacketBundle = Contents.rsplit('\n'); auto HeadTail = PacketBundle.first.split('\n'); - auto Preamble = "\t{\n\t\t"; - auto Separator = ""; - while(!HeadTail.first.empty()) { - OS << Separator; - StringRef Inst; + StringRef Separator = "\n"; + StringRef Indent = "\t\t"; + OS << "\t{\n"; + while (!HeadTail.first.empty()) { + StringRef InstTxt; auto Duplex = HeadTail.first.split('\v'); - if(!Duplex.second.empty()){ - OS << Duplex.first << "\n"; - Inst = Duplex.second; + if (!Duplex.second.empty()) { + OS << Indent << Duplex.first << Separator; + InstTxt = Duplex.second; + } else if (!HeadTail.first.trim().startswith("immext")) { + InstTxt = Duplex.first; } - else { - if(!HeadTail.first.startswith("immext")) - Inst = Duplex.first; - } - OS << Preamble; - OS << Inst; + if (!InstTxt.empty()) + OS << Indent << InstTxt << Separator; HeadTail = HeadTail.second.split('\n'); - Preamble = ""; - Separator = "\n\t\t"; } - if(HexagonMCInstrInfo::bundleSize(Inst) != 0) - OS << "\n\t}" << PacketBundle.second; + OS << "\t}" << PacketBundle.second; } }; } diff --git a/test/CodeGen/Hexagon/absimm.ll b/test/CodeGen/Hexagon/absimm.ll index f3f10f2b4f2..e67af5e8fef 100644 --- a/test/CodeGen/Hexagon/absimm.ll +++ b/test/CodeGen/Hexagon/absimm.ll @@ -1,7 +1,6 @@ ; RUN: llc -march=hexagon < %s | FileCheck %s ; Check that we generate absolute addressing mode instructions ; with immediate value. -; XFAIL: * define i32 @f1(i32 %i) nounwind { ; CHECK: memw(##786432){{ *}}={{ *}}r{{[0-9]+}} diff --git a/test/CodeGen/Hexagon/zextloadi1.ll b/test/CodeGen/Hexagon/zextloadi1.ll index c6c982750c0..9ce7bea9fce 100644 --- a/test/CodeGen/Hexagon/zextloadi1.ll +++ b/test/CodeGen/Hexagon/zextloadi1.ll @@ -1,5 +1,4 @@ ; RUN: llc -march=hexagon -mcpu=hexagonv4 < %s | FileCheck %s -; XFAIL: * ; CHECK: r{{[0-9]+}} = ##i129_l+16 ; CHECK: r{{[0-9]+}} = ##i129_s+16 diff --git a/test/MC/Disassembler/Hexagon/st.txt b/test/MC/Disassembler/Hexagon/st.txt index 4da3b54be8b..6d9074a05ef 100644 --- a/test/MC/Disassembler/Hexagon/st.txt +++ b/test/MC/Disassembler/Hexagon/st.txt @@ -1,6 +1,5 @@ # RUN: llvm-mc -triple=hexagon -disassemble < %s | FileCheck %s # Hexagon Programmer's Reference Manual 11.8 ST -# XFAIL: * # Store doubleword 0x9e 0xf5 0xd1 0x3b diff --git a/test/MC/Hexagon/instructions/st.s b/test/MC/Hexagon/instructions/st.s index 38822a62043..3b5e8ee1810 100644 --- a/test/MC/Hexagon/instructions/st.s +++ b/test/MC/Hexagon/instructions/st.s @@ -1,6 +1,5 @@ # RUN: llvm-mc -triple=hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s # Hexagon Programmer's Reference Manual 11.8 ST -# XFAIL: * # Store doubleword # CHECK: 9e f5 d1 3b