annotate lib/Target/Hexagon/HexagonPseudo.td @ 147:c2174574ed3a

LLVM 10
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Aug 2019 16:55:33 +0900
parents 3a76565eade5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 //===--- HexagonPseudo.td -------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 //
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 // The pat frags in the definitions below need to have a named register,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 // otherwise i32 will be assumed regardless of the register class. The
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 // name of the register does not matter.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 def I1 : PatLeaf<(i1 PredRegs:$R)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 def I32 : PatLeaf<(i32 IntRegs:$R)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 def I64 : PatLeaf<(i64 DoubleRegs:$R)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 def F32 : PatLeaf<(f32 IntRegs:$R)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 def F64 : PatLeaf<(f64 DoubleRegs:$R)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 let PrintMethod = "printGlobalOperand" in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 def globaladdress : Operand<i32>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 def globaladdressExt : Operand<i32>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 let isPseudo = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 let isCodeGenOnly = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 def A2_iconst : Pseudo<(outs IntRegs:$Rd32),
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
26 (ins s27_2Imm:$Ii), "${Rd32} = iconst(#${Ii})">;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 def DUPLEX_Pseudo : InstHexagon<(outs),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 (ins s32_0Imm:$offset), "DUPLEX", [], "", DUPLEX, TypePSEUDO>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 let isExtendable = 1, opExtendable = 1, opExtentBits = 6,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 isAsmParserOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 def TFRI64_V2_ext : InstHexagon<(outs DoubleRegs:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 (ins s32_0Imm:$src1, s8_0Imm:$src2),
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
36 "$dst = combine(#$src1,#$src2)", [], "",
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 A2_combineii.Itinerary, TypeALU32_2op>, OpcodeHexagon;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 // HI/LO Instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 let isReMaterializable = 1, isMoveImm = 1, hasSideEffects = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 hasNewValue = 1, opNewValue = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 class REG_IMMED<string RegHalf, bit Rs, bits<3> MajOp, bit MinOp,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 : InstHexagon<(outs IntRegs:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 (ins u16_0Imm:$imm_value),
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
46 "$dst"#RegHalf#" = #$imm_value", [], "",
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 rootInst.Itinerary, rootInst.Type>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 bits<5> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 bits<32> imm_value;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 let Inst{27} = Rs;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 let Inst{26-24} = MajOp;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 let Inst{21} = MinOp;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 let Inst{20-16} = dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 let Inst{23-22} = imm_value{15-14};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 let Inst{13-0} = imm_value{13-0};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 let isAsmParserOnly = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 def LO : REG_IMMED<".l", 0b0, 0b001, 0b1, A2_tfril>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 def HI : REG_IMMED<".h", 0b0, 0b010, 0b1, A2_tfrih>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 let isReMaterializable = 1, isMoveImm = 1, isAsmParserOnly = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65 def CONST32 : CONSTLDInst<(outs IntRegs:$Rd), (ins i32imm:$v),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 "$Rd = CONST32(#$v)", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 def CONST64 : CONSTLDInst<(outs DoubleRegs:$Rd), (ins i64imm:$v),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 "$Rd = CONST64(#$v)", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 let hasSideEffects = 0, isReMaterializable = 1, isPseudo = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 isCodeGenOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 def PS_true : InstHexagon<(outs PredRegs:$dst), (ins), "",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 [(set I1:$dst, 1)], "", C2_orn.Itinerary, TypeCR>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 let hasSideEffects = 0, isReMaterializable = 1, isPseudo = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 isCodeGenOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 def PS_false : InstHexagon<(outs PredRegs:$dst), (ins), "",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79 [(set I1:$dst, 0)], "", C2_andn.Itinerary, TypeCR>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 let Defs = [R29, R30], Uses = [R31, R30, R29], isPseudo = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 def ADJCALLSTACKDOWN : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 ".error \"should not emit\" ", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 let Defs = [R29, R30, R31], Uses = [R29], isPseudo = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 def ADJCALLSTACKUP : Pseudo<(outs), (ins i32imm:$amt1, i32imm:$amt2),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 ".error \"should not emit\" ", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 let isBranch = 1, isTerminator = 1, hasSideEffects = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 Defs = [PC, LC0], Uses = [SA0, LC0] in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 def ENDLOOP0 : Endloop<(outs), (ins b30_2Imm:$offset),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 ":endloop0",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94 []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 let isBranch = 1, isTerminator = 1, hasSideEffects = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 Defs = [PC, LC1], Uses = [SA1, LC1] in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 def ENDLOOP1 : Endloop<(outs), (ins b30_2Imm:$offset),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100 ":endloop1",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
104 let isBranch = 1, isTerminator = 1, hasSideEffects = 0,
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
105 Defs = [PC, LC0, LC1], Uses = [SA0, SA1, LC0, LC1] in {
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
106 def ENDLOOP01 : Endloop<(outs), (ins b30_2Imm:$offset),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
107 ":endloop01",
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
108 []>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
109 }
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
110
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 let isExtendable = 1, isExtentSigned = 1, opExtentBits = 9, opExtentAlign = 2,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112 opExtendable = 0, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 class LOOP_iBase<string mnemonic, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 : InstHexagon <(outs), (ins b30_2Imm:$offset, u10_0Imm:$src2),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 #mnemonic#"($offset,#$src2)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 [], "", rootInst.Itinerary, rootInst.Type>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 bits<9> offset;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118 bits<10> src2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 let IClass = 0b0110;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 let Inst{27-22} = 0b100100;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 let Inst{21} = !if (!eq(mnemonic, "loop0"), 0b0, 0b1);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124 let Inst{20-16} = src2{9-5};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 let Inst{12-8} = offset{8-4};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 let Inst{7-5} = src2{4-2};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 let Inst{4-3} = offset{3-2};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 let Inst{1-0} = src2{1-0};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 let isExtendable = 1, isExtentSigned = 1, opExtentBits = 9, opExtentAlign = 2,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 opExtendable = 0, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 class LOOP_rBase<string mnemonic, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 : InstHexagon<(outs), (ins b30_2Imm:$offset, IntRegs:$src2),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 #mnemonic#"($offset,$src2)",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136 [], "", rootInst.Itinerary, rootInst.Type>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 bits<9> offset;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 bits<5> src2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 let IClass = 0b0110;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142 let Inst{27-22} = 0b000000;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 let Inst{21} = !if (!eq(mnemonic, "loop0"), 0b0, 0b1);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 let Inst{20-16} = src2;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 let Inst{12-8} = offset{8-4};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 let Inst{4-3} = offset{3-2};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 let Defs = [SA0, LC0, USR], isCodeGenOnly = 1, isExtended = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 opExtendable = 0 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 def J2_loop0iext : LOOP_iBase<"loop0", J2_loop0i>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 def J2_loop1iext : LOOP_iBase<"loop1", J2_loop1i>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 // Interestingly only loop0's appear to set usr.lpcfg
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 let Defs = [SA1, LC1], isCodeGenOnly = 1, isExtended = 1, opExtendable = 0 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 def J2_loop0rext : LOOP_rBase<"loop0", J2_loop0r>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 def J2_loop1rext : LOOP_rBase<"loop1", J2_loop1r>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 let isCall = 1, hasSideEffects = 1, isPredicable = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 isExtended = 0, isExtendable = 1, opExtendable = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 isExtentSigned = 1, opExtentBits = 24, opExtentAlign = 2 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 class T_Call<string ExtStr>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 : InstHexagon<(outs), (ins a30_2Imm:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166 "call " # ExtStr # "$dst", [], "", J2_call.Itinerary, TypeJ>,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 let BaseOpcode = "call";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 bits<24> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 let IClass = 0b0101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172 let Inst{27-25} = 0b101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 let Inst{24-16,13-1} = dst{23-2};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 let Inst{0} = 0b0;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 let isCodeGenOnly = 1, isCall = 1, hasSideEffects = 1, Defs = [R16],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 isPredicable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 def CALLProfile : T_Call<"">;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181 let isCodeGenOnly = 1, isCall = 1, hasSideEffects = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 Defs = [PC, R31, R6, R7, P0] in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 def PS_call_stk : T_Call<"">;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 // Call, no return.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186 let isCall = 1, hasSideEffects = 1, cofMax1 = 1, isCodeGenOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 def PS_callr_nr: InstHexagon<(outs), (ins IntRegs:$Rs),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 "callr $Rs", [], "", J2_callr.Itinerary, TypeJ>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 bits<5> Rs;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 bits<2> Pu;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 let isPredicatedFalse = 1;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193 let IClass = 0b0101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 let Inst{27-21} = 0b0000101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 let Inst{20-16} = Rs;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 let isCall = 1, hasSideEffects = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 isExtended = 0, isExtendable = 1, opExtendable = 0, isCodeGenOnly = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200 BaseOpcode = "PS_call_nr", isExtentSigned = 1, opExtentAlign = 2 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 class Call_nr<bits<5> nbits, bit isPred, bit isFalse, dag iops,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202 InstrItinClass itin>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 : Pseudo<(outs), iops, "">, PredRel {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 bits<2> Pu;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 bits<17> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206 let opExtentBits = nbits;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 let isPredicable = 0; // !if(isPred, 0, 1);
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208 let isPredicated = 0; // isPred;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 let isPredicatedFalse = isFalse;
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
210 let Itinerary = itin;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 def PS_call_nr : Call_nr<24, 0, 0, (ins s32_0Imm:$Ii), J2_call.Itinerary>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214 //def PS_call_nrt: Call_nr<17, 1, 0, (ins PredRegs:$Pu, s32_0Imm:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 // J2_callt.Itinerary>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 //def PS_call_nrf: Call_nr<17, 1, 1, (ins PredRegs:$Pu, s32_0Imm:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 // J2_callf.Itinerary>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 let isBranch = 1, isIndirectBranch = 1, isBarrier = 1, Defs = [PC],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220 isPredicable = 1, hasSideEffects = 0, InputType = "reg",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221 cofMax1 = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 class T_JMPr <InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 : InstHexagon<(outs), (ins IntRegs:$dst), "jumpr $dst", [],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224 "", rootInst.Itinerary, rootInst.Type>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 bits<5> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227 let IClass = 0b0101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 let Inst{27-21} = 0b0010100;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 let Inst{20-16} = dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 // A return through builtin_eh_return.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233 let isReturn = 1, isTerminator = 1, isBarrier = 1, hasSideEffects = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 isCodeGenOnly = 1, Defs = [PC], Uses = [R28], isPredicable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 def EH_RETURN_JMPR : T_JMPr<J2_jumpr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 // Indirect tail-call.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 let isPseudo = 1, isCall = 1, isReturn = 1, isBarrier = 1, isPredicable = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239 isTerminator = 1, isCodeGenOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240 def PS_tailcall_r : T_JMPr<J2_jumpr>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 // Direct tail-calls.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 let isPseudo = 1, isCall = 1, isReturn = 1, isBarrier = 1, isPredicable = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245 isTerminator = 1, isCodeGenOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246 def PS_tailcall_i : Pseudo<(outs), (ins a30_2Imm:$dst), "", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248 let isCodeGenOnly = 1, isPseudo = 1, Uses = [R30], hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 def PS_aligna : Pseudo<(outs IntRegs:$Rd), (ins u32_0Imm:$A), "", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 // Generate frameindex addresses. The main reason for the offset operand is
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 // that every instruction that is allowed to have frame index as an operand
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253 // will then have that operand followed by an immediate operand (the offset).
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 // This simplifies the frame-index elimination code.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 //
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 let isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257 isPseudo = 1, isCodeGenOnly = 1, hasSideEffects = 0, isExtendable = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258 isExtentSigned = 1, opExtentBits = 16, opExtentAlign = 0 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259 let opExtendable = 2 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260 def PS_fi : Pseudo<(outs IntRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261 (ins IntRegs:$fi, s32_0Imm:$off), "">;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262 let opExtendable = 3 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 def PS_fia : Pseudo<(outs IntRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 (ins IntRegs:$Rs, IntRegs:$fi, s32_0Imm:$off), "">;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267 class CondStr<string CReg, bit True, bit New> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268 string S = "if (" # !if(True,"","!") # CReg # !if(New,".new","") # ") ";
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 class JumpOpcStr<string Mnemonic, bit New, bit Taken> {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271 string S = Mnemonic # !if(Taken, ":t", ":nt");
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273 let isBranch = 1, isIndirectBranch = 1, Defs = [PC], isPredicated = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 hasSideEffects = 0, InputType = "reg", cofMax1 = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 class T_JMPr_c <bit PredNot, bit isPredNew, bit isTak, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 : InstHexagon<(outs), (ins PredRegs:$src, IntRegs:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 CondStr<"$src", !if(PredNot,0,1), isPredNew>.S #
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278 JumpOpcStr<"jumpr", isPredNew, isTak>.S # " $dst",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279 [], "", rootInst.Itinerary, rootInst.Type>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281 let isTaken = isTak;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282 let isPredicatedFalse = PredNot;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 let isPredicatedNew = isPredNew;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 bits<2> src;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285 bits<5> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287 let IClass = 0b0101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
288
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
289 let Inst{27-22} = 0b001101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
290 let Inst{21} = PredNot;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291 let Inst{20-16} = dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 let Inst{12} = isTak;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
293 let Inst{11} = isPredNew;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
294 let Inst{9-8} = src;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
295 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
296
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
297 let isTerminator = 1, hasSideEffects = 0, isReturn = 1, isCodeGenOnly = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
298 isBarrier = 1, BaseOpcode = "JMPret" in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
299 def PS_jmpret : T_JMPr<J2_jumpr>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
300 def PS_jmprett : T_JMPr_c<0, 0, 0, J2_jumprt>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
301 def PS_jmpretf : T_JMPr_c<1, 0, 0, J2_jumprf>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
302 def PS_jmprettnew : T_JMPr_c<0, 1, 0, J2_jumprtnew>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
303 def PS_jmpretfnew : T_JMPr_c<1, 1, 0, J2_jumprfnew>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
304 def PS_jmprettnewpt : T_JMPr_c<0, 1, 1, J2_jumprtnewpt>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
305 def PS_jmpretfnewpt : T_JMPr_c<1, 1, 1, J2_jumprfnewpt>, PredNewRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
306 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
307
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
308 //defm V6_vtran2x2_map : HexagonMapping<(outs HvxVR:$Vy32, HvxVR:$Vx32), (ins HvxVR:$Vx32in, IntRegs:$Rt32), "vtrans2x2(${Vy32},${Vx32},${Rt32})", (V6_vshuff HvxVR:$Vy32, HvxVR:$Vx32, HvxVR:$Vx32in, IntRegs:$Rt32)>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
309
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
310 // The reason for the custom inserter is to record all ALLOCA instructions
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
311 // in MachineFunctionInfo.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
312 let Defs = [R29], hasSideEffects = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
313 def PS_alloca: Pseudo <(outs IntRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
314 (ins IntRegs:$Rs, u32_0Imm:$A), "", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
315
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
316 // Load predicate.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
317 let isExtendable = 1, opExtendable = 2, isExtentSigned = 1, opExtentBits = 13,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
318 isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
319 def LDriw_pred : LDInst<(outs PredRegs:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
320 (ins IntRegs:$addr, s32_0Imm:$off),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
321 ".error \"should not emit\"", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
322
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
323 // Load modifier.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
324 let isExtendable = 1, opExtendable = 2, isExtentSigned = 1, opExtentBits = 13,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
325 isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 0 in
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
326 def LDriw_ctr : LDInst<(outs CtrRegs:$dst),
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
327 (ins IntRegs:$addr, s32_0Imm:$off),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
328 ".error \"should not emit\"", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
329
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
330
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
331 let isCodeGenOnly = 1, isPseudo = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
332 def PS_pselect: InstHexagon<(outs DoubleRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
333 (ins PredRegs:$Pu, DoubleRegs:$Rs, DoubleRegs:$Rt),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
334 ".error \"should not emit\" ", [], "", A2_tfrpt.Itinerary, TypeALU32_2op>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
335
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
336 let isBranch = 1, isBarrier = 1, Defs = [PC], hasSideEffects = 0,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
337 isPredicable = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
338 isExtendable = 1, opExtendable = 0, isExtentSigned = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
339 opExtentBits = 24, opExtentAlign = 2, InputType = "imm" in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
340 class T_JMP: InstHexagon<(outs), (ins b30_2Imm:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
341 "jump $dst",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
342 [], "", J2_jump.Itinerary, TypeJ>, OpcodeHexagon {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
343 bits<24> dst;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
344 let IClass = 0b0101;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
345
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
346 let Inst{27-25} = 0b100;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
347 let Inst{24-16} = dst{23-15};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
348 let Inst{13-1} = dst{14-2};
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
349 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
350
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
351 // Restore registers and dealloc return function call.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
352 let isCall = 1, isBarrier = 1, isReturn = 1, isTerminator = 1,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
353 Defs = [R29, R30, R31, PC], isPredicable = 0, isAsmParserOnly = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
354 def RESTORE_DEALLOC_RET_JMP_V4 : T_JMP;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
355
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
356 let isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
357 def RESTORE_DEALLOC_RET_JMP_V4_EXT : T_JMP;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
358
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
359 let Defs = [R14, R15, R28, R29, R30, R31, PC] in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
360 def RESTORE_DEALLOC_RET_JMP_V4_PIC : T_JMP;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
361
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
362 let isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
363 def RESTORE_DEALLOC_RET_JMP_V4_EXT_PIC : T_JMP;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
364 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
365 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
366
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
367 // Restore registers and dealloc frame before a tail call.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
368 let isCall = 1, Defs = [R29, R30, R31, PC], isAsmParserOnly = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
369 def RESTORE_DEALLOC_BEFORE_TAILCALL_V4 : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
370
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
371 let isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
372 def RESTORE_DEALLOC_BEFORE_TAILCALL_V4_EXT : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
373
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
374 let Defs = [R14, R15, R28, R29, R30, R31, PC] in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
375 def RESTORE_DEALLOC_BEFORE_TAILCALL_V4_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
376
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
377 let isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
378 def RESTORE_DEALLOC_BEFORE_TAILCALL_V4_EXT_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
379 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
380 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
381
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
382 // Save registers function call.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
383 let isCall = 1, Uses = [R29, R31], isAsmParserOnly = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
384 def SAVE_REGISTERS_CALL_V4 : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
385
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
386 let isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
387 def SAVE_REGISTERS_CALL_V4_EXT : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
388
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
389 let Defs = [P0] in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
390 def SAVE_REGISTERS_CALL_V4STK : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
391
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
392 let Defs = [P0], isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
393 def SAVE_REGISTERS_CALL_V4STK_EXT : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
394
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
395 let Defs = [R14, R15, R28] in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
396 def SAVE_REGISTERS_CALL_V4_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
397
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
398 let Defs = [R14, R15, R28], isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
399 def SAVE_REGISTERS_CALL_V4_EXT_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
400
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
401 let Defs = [R14, R15, R28, P0] in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
402 def SAVE_REGISTERS_CALL_V4STK_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
403
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
404 let Defs = [R14, R15, R28, P0], isExtended = 1, opExtendable = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
405 def SAVE_REGISTERS_CALL_V4STK_EXT_PIC : T_Call<"">, PredRel;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
406 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
407
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
408 // Vector store pseudos
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
409 let Predicates = [HasV60,UseHVX], isPseudo = 1, isCodeGenOnly = 1,
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
410 mayStore = 1, accessSize = HVXVectorAccess, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
411 class STrivv_template<RegisterClass RC, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
412 : InstHexagon<(outs), (ins IntRegs:$addr, s32_0Imm:$off, RC:$src),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
413 "", [], "", rootInst.Itinerary, rootInst.Type>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
414
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
415 def PS_vstorerw_ai: STrivv_template<HvxWR, V6_vS32b_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
416 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
417 def PS_vstorerw_nt_ai: STrivv_template<HvxWR, V6_vS32b_nt_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
418 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
419 def PS_vstorerwu_ai: STrivv_template<HvxWR, V6_vS32Ub_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
420 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
421
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
422 let isPseudo = 1, isCodeGenOnly = 1, mayStore = 1, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
423 def PS_vstorerq_ai: Pseudo<(outs),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
424 (ins IntRegs:$Rs, s32_0Imm:$Off, HvxQR:$Qt), "", []>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
425 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
426
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
427 // Vector load pseudos
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
428 let Predicates = [HasV60, UseHVX], isPseudo = 1, isCodeGenOnly = 1,
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
429 mayLoad = 1, accessSize = HVXVectorAccess, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
430 class LDrivv_template<RegisterClass RC, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
431 : InstHexagon<(outs RC:$dst), (ins IntRegs:$addr, s32_0Imm:$off),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
432 "", [], "", rootInst.Itinerary, rootInst.Type>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
433
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
434 def PS_vloadrw_ai: LDrivv_template<HvxWR, V6_vL32b_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
435 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
436 def PS_vloadrw_nt_ai: LDrivv_template<HvxWR, V6_vL32b_nt_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
437 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
438 def PS_vloadrwu_ai: LDrivv_template<HvxWR, V6_vL32Ub_ai>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
439 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
440
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
441 let isPseudo = 1, isCodeGenOnly = 1, mayLoad = 1, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
442 def PS_vloadrq_ai: Pseudo<(outs HvxQR:$Qd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
443 (ins IntRegs:$Rs, s32_0Imm:$Off), "", []>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
444 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
445
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
446
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
447 let isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
448 class VSELInst<dag outs, dag ins, InstHexagon rootInst>
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
449 : InstHexagon<outs, ins, "", [], "", rootInst.Itinerary, rootInst.Type>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
450
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
451 def PS_vselect: VSELInst<(outs HvxVR:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
452 (ins PredRegs:$src1, HvxVR:$src2, HvxVR:$src3), V6_vcmov>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
453 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
454 def PS_wselect: VSELInst<(outs HvxWR:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
455 (ins PredRegs:$src1, HvxWR:$src2, HvxWR:$src3), V6_vccombine>,
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
456 Requires<[HasV60,UseHVX]>;
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
457
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
458 let hasSideEffects = 0, isReMaterializable = 1, isPseudo = 1,
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
459 isCodeGenOnly = 1 in {
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
460 def PS_qtrue: InstHexagon<(outs HvxQR:$Qd), (ins), "", [], "",
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
461 V6_veqw.Itinerary, TypeCVI_VA>;
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
462 def PS_qfalse: InstHexagon<(outs HvxQR:$Qd), (ins), "", [], "",
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
463 V6_vgtw.Itinerary, TypeCVI_VA>;
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
464 def PS_vdd0: InstHexagon<(outs HvxWR:$Vd), (ins), "", [], "",
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
465 V6_vsubw_dv.Itinerary, TypeCVI_VA_DV>;
134
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
466 }
3a76565eade5 update 5.0.1
mir3636
parents: 121
diff changeset
467
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
468 // Store predicate.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
469 let isExtendable = 1, opExtendable = 1, isExtentSigned = 1, opExtentBits = 13,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
470 isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 0 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
471 def STriw_pred : STInst<(outs),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
472 (ins IntRegs:$addr, s32_0Imm:$off, PredRegs:$src1),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
473 ".error \"should not emit\"", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
474 // Store modifier.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
475 let isExtendable = 1, opExtendable = 1, isExtentSigned = 1, opExtentBits = 13,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
476 isCodeGenOnly = 1, isPseudo = 1, hasSideEffects = 0 in
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
477 def STriw_ctr : STInst<(outs),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
478 (ins IntRegs:$addr, s32_0Imm:$off, CtrRegs:$src1),
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
479 ".error \"should not emit\"", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
480
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
481 let isExtendable = 1, opExtendable = 1, opExtentBits = 6,
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
482 isAsmParserOnly = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
483 def TFRI64_V4 : InstHexagon<(outs DoubleRegs:$dst),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
484 (ins u64_0Imm:$src1),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
485 "$dst = #$src1", [], "",
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
486 A2_combineii.Itinerary, TypeALU32_2op>, OpcodeHexagon;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
487
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
488 // Hexagon doesn't have a vector multiply with C semantics.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
489 // Instead, generate a pseudo instruction that gets expaneded into two
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
490 // scalar MPYI instructions.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
491 // This is expanded by ExpandPostRAPseudos.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
492 let isPseudo = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
493 def PS_vmulw : PseudoM<(outs DoubleRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
494 (ins DoubleRegs:$Rs, DoubleRegs:$Rt), "", []>;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
495
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
496 let isPseudo = 1 in
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
497 def PS_vmulw_acc : PseudoM<(outs DoubleRegs:$Rd),
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
498 (ins DoubleRegs:$Rx, DoubleRegs:$Rs, DoubleRegs:$Rt), "", [],
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
499 "$Rd = $Rx">;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
500
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
501 def DuplexIClass0: InstDuplex < 0 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
502 def DuplexIClass1: InstDuplex < 1 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
503 def DuplexIClass2: InstDuplex < 2 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
504 let isExtendable = 1 in {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
505 def DuplexIClass3: InstDuplex < 3 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
506 def DuplexIClass4: InstDuplex < 4 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
507 def DuplexIClass5: InstDuplex < 5 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
508 def DuplexIClass6: InstDuplex < 6 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
509 def DuplexIClass7: InstDuplex < 7 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
510 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
511 def DuplexIClass8: InstDuplex < 8 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
512 def DuplexIClass9: InstDuplex < 9 >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
513 def DuplexIClassA: InstDuplex < 0xA >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
514 def DuplexIClassB: InstDuplex < 0xB >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
515 def DuplexIClassC: InstDuplex < 0xC >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
516 def DuplexIClassD: InstDuplex < 0xD >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
517 def DuplexIClassE: InstDuplex < 0xE >;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
518 def DuplexIClassF: InstDuplex < 0xF >;
147
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
519
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
520 // Pseudos for circular buffer instructions. These are needed in order to
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
521 // allocate the correct pair of CSx and Mx registers.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
522 multiclass NewCircularLoad<RegisterClass RC, MemAccessSize MS> {
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
523
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
524 let isCodeGenOnly = 1, isPseudo = 1, Defs = [CS], Uses = [CS],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
525 addrMode = PostInc, accessSize = MS, hasSideEffects = 0 in {
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
526 def NAME#_pci : LDInst<(outs RC:$Rd32, IntRegs:$Rx32),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
527 (ins IntRegs:$Rx32in, s4_0Imm:$Ii, ModRegs:$Mu2, IntRegs:$Cs),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
528 ".error \"should not emit\" ", [], "$Rx32 = $Rx32in", tc_e93a3d71>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
529
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
530 def NAME#_pcr : LDInst<(outs RC:$Rd32, IntRegs:$Rx32),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
531 (ins IntRegs:$Rx32in, ModRegs:$Mu2, IntRegs:$Cs),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
532 ".error \"should not emit\" ", [], "$Rx32 = $Rx32in", tc_44d3da28>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
533 }
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
534 }
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
535
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
536 defm PS_loadrub : NewCircularLoad<IntRegs, ByteAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
537 defm PS_loadrb : NewCircularLoad<IntRegs, ByteAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
538 defm PS_loadruh : NewCircularLoad<IntRegs, HalfWordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
539 defm PS_loadrh : NewCircularLoad<IntRegs, HalfWordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
540 defm PS_loadri : NewCircularLoad<IntRegs, WordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
541 defm PS_loadrd : NewCircularLoad<DoubleRegs, DoubleWordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
542
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
543 multiclass NewCircularStore<RegisterClass RC, MemAccessSize MS> {
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
544
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
545 let isCodeGenOnly = 1, isPseudo = 1, Defs = [CS], Uses = [CS],
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
546 addrMode = PostInc, accessSize = MS, hasSideEffects = 0 in {
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
547 def NAME#_pci : STInst<(outs IntRegs:$Rx32),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
548 (ins IntRegs:$Rx32in, s4_0Imm:$Ii, ModRegs:$Mu2, RC:$Rt32, IntRegs:$Cs),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
549 ".error \"should not emit\" ", [], "$Rx32 = $Rx32in", tc_e86aa961>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
550
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
551 def NAME#_pcr : STInst<(outs IntRegs:$Rx32),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
552 (ins IntRegs:$Rx32in, ModRegs:$Mu2, RC:$Rt32, IntRegs:$Cs),
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
553 ".error \"should not emit\" ", [], "$Rx32 = $Rx32in", tc_da97ee82>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
554 }
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
555 }
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
556
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
557 defm PS_storerb : NewCircularStore<IntRegs, ByteAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
558 defm PS_storerh : NewCircularStore<IntRegs, HalfWordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
559 defm PS_storerf : NewCircularStore<IntRegs, HalfWordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
560 defm PS_storeri : NewCircularStore<IntRegs, WordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
561 defm PS_storerd : NewCircularStore<DoubleRegs, WordAccess>;
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
562
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
563 // A pseudo that generates a runtime crash. This is used to implement
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
564 // __builtin_trap.
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
565 let hasSideEffects = 1, isPseudo = 1, isCodeGenOnly = 1, isSolo = 1 in
c2174574ed3a LLVM 10
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 134
diff changeset
566 def PS_crash: InstHexagon<(outs), (ins), "", [], "", PSEUDO, TypePSEUDO>;