Debian Codegraph @

suite/synctools/tablegen/PPC/PPCInstrPS.td

raw
1 def HasPS : Predicate<"PPCSubTarget->hasPS()">;
2 let Predicates = [HasPS] in {
3 let DecoderNamespace = "PS" in {
4
5 def PSQ_L : PSForm_qd<56,
6 (outs f8rc:$FRT), (ins memrid12:$src, u1imm:$W, u3imm: $I),
7 "psq_l $FRT, $src, $W, $I", IIC_FPGeneral>;
8 def PSQ_LU : PSForm_qd<57,
9 (outs f8rc:$FRT), (ins memrid12:$src, u1imm:$W, u3imm: $I),
10 "psq_lu $FRT, $src, $W, $I", IIC_FPGeneral>;
11 def PSQ_ST : PSForm_qd<60,
12 (outs), (ins f8rc:$FRT, memrid12:$dst, u1imm:$W, u3imm: $I),
13 "psq_st $FRT, $dst, $W, $I", IIC_FPGeneral>;
14 def PSQ_STU : PSForm_qd<61,
15 (outs), (ins f8rc:$FRT, memrid12:$dst, u1imm:$W, u3imm: $I),
16 "psq_stu $FRT, $dst, $W, $I", IIC_FPGeneral>;
17
18 def PSQ_LX : PSForm_qi<6,
19 (outs f8rc:$FRT), (ins gprc:$rA, gprc:$rB, u1imm:$W, u3imm: $I),
20 "psq_lx $FRT, $rA, $rB, $W, $I", IIC_FPGeneral>;
21 def PSQ_STX : PSForm_qi<7,
22 (outs), (ins f8rc:$FRT,gprc:$rA, gprc:$rB, u1imm:$W, u3imm: $I),
23 "psq_stx $FRT, $rA, $rB, $W, $I", IIC_FPGeneral>;
24 def PSQ_LUX : PSForm_qi<38,
25 (outs f8rc:$FRT), (ins gprc:$rA, gprc:$rB, u1imm:$W, u3imm: $I),
26 "psq_lux $FRT, $rA, $rB, $W, $I", IIC_FPGeneral>;
27 def PSQ_STUX : PSForm_qi<39,
28 (outs), (ins f8rc:$FRT,gprc:$rA, gprc:$rB, u1imm:$W, u3imm: $I),
29 "psq_stux $FRT, $rA, $rB, $W, $I", IIC_FPGeneral>;
30
31 // op. FRT, FRA, FRC, FRB
32 multiclass PSForm_xr<bits<5> psxop, dag OOL, dag IOL, string asmbase,
33 string asmstr, InstrItinClass itin> {
34 let BaseName = asmbase in {
35 def NAME : PSForm_x<psxop, OOL, IOL,
36 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
37 let Defs = [CR1] in
38 def o : PSForm_x<psxop, OOL, IOL,
39 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
40 isDOT;
41 }
42 }
43
44 // op FRT, FRA, FRB
45 class PSForm_x1<bits<5> psxop, dag OOL, dag IOL, string asmstr,
46 InstrItinClass itin>
47 : PSForm_x<psxop, OOL, IOL, asmstr, itin> {
48 let FRC = 0;
49 }
50
51 // op. FRT, FRA, FRB
52 multiclass PSForm_x1r<bits<5> psxop, dag OOL, dag IOL, string asmbase,
53 string asmstr, InstrItinClass itin> {
54 let BaseName = asmbase in {
55 def NAME : PSForm_x1<psxop, OOL, IOL,
56 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
57 let Defs = [CR1] in
58 def o : PSForm_x1<psxop, OOL, IOL,
59 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
60 isDOT;
61 }
62 }
63
64 // op FRT, FRB
65 class PSForm_x2<bits<5> psxop, dag OOL, dag IOL, string asmstr,
66 InstrItinClass itin>
67 : PSForm_x<psxop, OOL, IOL, asmstr, itin> {
68 let FRA = 0;
69 let FRC = 0;
70 }
71
72 // op. FRT, FRB
73 multiclass PSForm_x2r<bits<5> psxop, dag OOL, dag IOL, string asmbase,
74 string asmstr, InstrItinClass itin> {
75 let BaseName = asmbase in {
76 def NAME : PSForm_x2<psxop, OOL, IOL,
77 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
78 let Defs = [CR1] in
79 def o : PSForm_x2<psxop, OOL, IOL,
80 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
81 isDOT;
82 }
83 }
84
85 // op FRT, FRA, FRC
86 class PSForm_x3<bits<5> psxop, dag OOL, dag IOL, string asmstr,
87 InstrItinClass itin>
88 : PSForm_x<psxop, OOL, IOL, asmstr, itin> {
89 let FRB = 0;
90 }
91
92 // op. FRT, FRA, FRC
93 multiclass PSForm_x3r<bits<5> psxop, dag OOL, dag IOL, string asmbase,
94 string asmstr, InstrItinClass itin> {
95 let BaseName = asmbase in {
96 def NAME : PSForm_x3<psxop, OOL, IOL,
97 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
98 let Defs = [CR1] in
99 def o : PSForm_x3<psxop, OOL, IOL,
100 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
101 isDOT;
102 }
103 }
104
105 // op. FRT, FRA, FRB
106 multiclass PSForm_yr<bits<10> psyop, dag OOL, dag IOL, string asmbase,
107 string asmstr, InstrItinClass itin> {
108 let BaseName = asmbase in {
109 def NAME : PSForm_y<psyop, OOL, IOL,
110 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
111 let Defs = [CR1] in
112 def o : PSForm_y<psyop, OOL, IOL,
113 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
114 isDOT;
115 }
116 }
117
118 // op FRT, FRA, FRB
119 class PSForm_y2<bits<10> psyop, dag OOL, dag IOL, string asmstr,
120 InstrItinClass itin>
121 : PSForm_y<psyop, OOL, IOL, asmstr, itin> {
122 let FRA = 0;
123 }
124
125 // op. FRT, FRB
126 multiclass PSForm_y2r<bits<10> psyop, dag OOL, dag IOL, string asmbase,
127 string asmstr, InstrItinClass itin> {
128 let BaseName = asmbase in {
129 def NAME : PSForm_y2<psyop, OOL, IOL,
130 !strconcat(asmbase, !strconcat(" ", asmstr)), itin>;
131 let Defs = [CR1] in
132 def o : PSForm_y2<psyop, OOL, IOL,
133 !strconcat(asmbase, !strconcat(". ", asmstr)), itin>,
134 isDOT;
135 }
136 }
137
138 defm PS_DIV : PSForm_x1r<18, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
139 "ps_div", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
140 defm PS_SUB : PSForm_x1r<20, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
141 "ps_sub", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
142 defm PS_ADD : PSForm_x1r<21, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
143 "ps_add", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
144 defm PS_SEL : PSForm_xr<23,
145 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
146 "ps_sel", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
147 defm PS_RES : PSForm_x2r<24, (outs f8rc:$FRT), (ins f8rc:$FRB),
148 "ps_res", "$FRT, $FRB", IIC_FPGeneral>;
149 defm PS_MUL : PSForm_x3r<25, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC),
150 "ps_mul", "$FRT, $FRA, $FRC", IIC_FPGeneral>;
151 defm PS_RSQRTE : PSForm_x2r<26, (outs f8rc:$FRT), (ins f8rc:$FRB),
152 "ps_rsqrte", "$FRT, $FRB", IIC_FPGeneral>;
153 defm PS_MSUB : PSForm_xr<28,
154 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
155 "ps_msub", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
156 defm PS_MADD : PSForm_xr<29,
157 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
158 "ps_madd", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
159 defm PS_NMSUB : PSForm_xr<30,
160 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
161 "ps_nmsub", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
162 defm PS_NMADD : PSForm_xr<31,
163 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
164 "ps_nmadd", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
165 defm PS_NEG : PSForm_y2r<40, (outs f8rc:$FRT), (ins f8rc:$FRB),
166 "ps_neg", "$FRT, $FRB", IIC_FPGeneral>;
167 defm PS_MR : PSForm_y2r<72, (outs f8rc:$FRT), (ins f8rc:$FRB),
168 "ps_mr", "$FRT, $FRB", IIC_FPGeneral>;
169 defm PS_NABS : PSForm_y2r<136, (outs f8rc:$FRT), (ins f8rc:$FRB),
170 "ps_nabs", "$FRT, $FRB", IIC_FPGeneral>;
171 defm PS_ABS : PSForm_y2r<264, (outs f8rc:$FRT), (ins f8rc:$FRB),
172 "ps_abs", "$FRT, $FRB", IIC_FPGeneral>;
173 defm PS_SUM0 : PSForm_xr<10,
174 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
175 "ps_sum0", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
176 defm PS_SUM1 : PSForm_xr<11,
177 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
178 "ps_sum1", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
179 defm PS_MULS0 : PSForm_x3r<12, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC),
180 "ps_muls0", "$FRT, $FRA, $FRC", IIC_FPGeneral>;
181 defm PS_MULS1 : PSForm_x3r<13, (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC),
182 "ps_muls1", "$FRT, $FRA, $FRC", IIC_FPGeneral>;
183 defm PS_MADDS0 : PSForm_xr<14,
184 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
185 "ps_madds0", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
186 defm PS_MADDS1 : PSForm_xr<15,
187 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRC, f8rc:$FRB),
188 "ps_madds1", "$FRT, $FRA, $FRC, $FRB", IIC_FPGeneral>;
189 def PS_CMPU0 : PSForm_c<0,
190 (outs crrc:$crD), (ins f8rc:$FRA, f8rc:$FRB),
191 "ps_cmpu0 $crD, $FRA, $FRB", IIC_FPGeneral>;
192 def PS_CMPO0 : PSForm_c<32,
193 (outs crrc:$crD), (ins f8rc:$FRA, f8rc:$FRB),
194 "ps_cmpo0 $crD, $FRA, $FRB", IIC_FPGeneral>;
195 def PS_CMPU1 : PSForm_c<64,
196 (outs crrc:$crD), (ins f8rc:$FRA, f8rc:$FRB),
197 "ps_cmpu1 $crD, $FRA, $FRB", IIC_FPGeneral>;
198 def PS_CMPO1 : PSForm_c<96,
199 (outs crrc:$crD), (ins f8rc:$FRA, f8rc:$FRB),
200 "ps_cmpo1 $crD, $FRA, $FRB", IIC_FPGeneral>;
201 defm PS_MERGE00 : PSForm_yr<528,
202 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
203 "ps_merge00", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
204 defm PS_MERGE01 : PSForm_yr<560,
205 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
206 "ps_merge01", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
207 defm PS_MERGE10 : PSForm_yr<592,
208 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
209 "ps_merge10", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
210 defm PS_MERGE11 : PSForm_yr<624,
211 (outs f8rc:$FRT), (ins f8rc:$FRA, f8rc:$FRB),
212 "ps_merge11", "$FRT, $FRA, $FRB", IIC_FPGeneral>;
213
214 def PSC_DCBZL : DCBZL_Form<1014,
215 (outs), (ins gprc:$rA, gprc:$rB),
216 "dcbz_l $rA, $rB", IIC_FPGeneral>;
217
218 }
219 }