7
7
//===----------------------------------------------------------------------===//
8
8
//
9
9
// This file contains instruction formats, definitions and patterns needed for
10
- // VIS, VIS II, VIS II instructions on SPARC.
10
+ // VIS, VIS II, VIS III instructions on SPARC.
11
11
//===----------------------------------------------------------------------===//
12
12
13
13
// VIS Instruction Format.
14
- class VISInstFormat<bits<9> opfval, dag outs, dag ins, string asmstr,
15
- list<dag> pattern>
16
- : F3_3<0b10, 0b110110, opfval, outs, ins, asmstr, pattern>;
14
+ class VISInstFormat<bits<9> opfval, dag outs, dag ins, string asmstr>
15
+ : F3_3<0b10, 0b110110, opfval, outs, ins, asmstr, []>;
17
16
18
17
class VISInst<bits<9> opfval, string OpcStr, RegisterClass RC = DFPRegs>
19
18
: VISInstFormat<opfval,
20
19
(outs RC:$rd), (ins RC:$rs1, RC:$rs2),
21
- !strconcat(OpcStr, " $rs1, $rs2, $rd"), [] >;
20
+ !strconcat(OpcStr, " $rs1, $rs2, $rd")>;
22
21
23
22
// VIS Instruction with integer destination register.
24
23
class VISInstID<bits<9> opfval, string OpcStr>
25
24
: VISInstFormat<opfval,
26
25
(outs I64Regs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
27
- !strconcat(OpcStr, " $rs1, $rs2, $rd"), [] >;
26
+ !strconcat(OpcStr, " $rs1, $rs2, $rd")>;
28
27
29
28
// For VIS Instructions with no operand.
30
29
let rd = 0, rs1 = 0, rs2 = 0 in
31
30
class VISInst0<bits<9> opfval, string asmstr>
32
- : VISInstFormat<opfval, (outs), (ins), asmstr, [] >;
31
+ : VISInstFormat<opfval, (outs), (ins), asmstr>;
33
32
34
33
// For VIS Instructions with only rs1, rd operands.
35
34
let rs2 = 0 in
36
35
class VISInst1<bits<9> opfval, string OpcStr, RegisterClass RC = DFPRegs>
37
36
: VISInstFormat<opfval,
38
37
(outs RC:$rd), (ins RC:$rs1),
39
- !strconcat(OpcStr, " $rs1, $rd"), [] >;
38
+ !strconcat(OpcStr, " $rs1, $rd")>;
40
39
41
40
// For VIS Instructions with only rs2, rd operands.
42
41
let rs1 = 0 in
43
42
class VISInst2<bits<9> opfval, string OpcStr, RegisterClass RC = DFPRegs>
44
43
: VISInstFormat<opfval,
45
44
(outs RC:$rd), (ins RC:$rs2),
46
- !strconcat(OpcStr, " $rs2, $rd"), [] >;
45
+ !strconcat(OpcStr, " $rs2, $rd")>;
47
46
48
47
// For VIS Instructions with only rd operand.
49
48
let Constraints = "$rd = $f", rs1 = 0, rs2 = 0 in
50
49
class VISInstD<bits<9> opfval, string OpcStr, RegisterClass RC = DFPRegs>
51
50
: VISInstFormat<opfval,
52
51
(outs RC:$rd), (ins RC:$f),
53
- !strconcat(OpcStr, " $rd"), [] >;
52
+ !strconcat(OpcStr, " $rd")>;
54
53
55
54
// VIS 1 Instructions
56
55
let Predicates = [HasVIS] in {
57
56
58
57
def FPADD16 : VISInst<0b001010000, "fpadd16">;
59
- def FPADD16S : VISInst<0b001010001, "fpadd16s">;
58
+ def FPADD16S : VISInst<0b001010001, "fpadd16s", FPRegs >;
60
59
def FPADD32 : VISInst<0b001010010, "fpadd32">;
61
- def FPADD32S : VISInst<0b001010011, "fpadd32s">;
60
+ def FPADD32S : VISInst<0b001010011, "fpadd32s", FPRegs >;
62
61
def FPSUB16 : VISInst<0b001010100, "fpsub16">;
63
- def FPSUB16S : VISInst<0b001010101, "fpsub16S" >;
62
+ def FPSUB16S : VISInst<0b001010101, "fpsub16s", FPRegs >;
64
63
def FPSUB32 : VISInst<0b001010110, "fpsub32">;
65
- def FPSUB32S : VISInst<0b001010111, "fpsub32S" >;
64
+ def FPSUB32S : VISInst<0b001010111, "fpsub32s", FPRegs >;
66
65
67
66
def FPACK16 : VISInst2<0b000111011, "fpack16">;
68
67
def FPACK32 : VISInst <0b000111010, "fpack32">;
69
- def FPACKFIX : VISInst2<0b000111101, "fpackfix">;
70
- def FEXPAND : VISInst2<0b001001101, "fexpand">;
71
- def FPMERGE : VISInst <0b001001011, "fpmerge">;
72
-
73
- def FMUL8X16 : VISInst<0b000110001, "fmul8x16">;
74
- def FMUL8X16AU : VISInst<0b000110011, "fmul8x16au">;
75
- def FMUL8X16AL : VISInst<0b000110101, "fmul8x16al">;
68
+ let rs1 = 0 in
69
+ def FPACKFIX : VISInstFormat<0b000111101,
70
+ (outs FPRegs:$rd), (ins DFPRegs:$rs2), "fpackfix $rs2, $rd">;
71
+ let rs1 = 0 in
72
+ def FEXPAND : VISInstFormat<0b001001101,
73
+ (outs DFPRegs:$rd), (ins FPRegs:$rs2), "fexpand $rs2, $rd">;
74
+ def FPMERGE : VISInstFormat<0b001001011,
75
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, FPRegs:$rs2),
76
+ "fpmerge $rs1, $rs2, $rd">;
77
+
78
+ def FMUL8X16 : VISInstFormat<0b000110001,
79
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, DFPRegs:$rs2),
80
+ "fmul8x16 $rs1, $rs2, $rd">;
81
+ def FMUL8X16AU : VISInstFormat<0b000110011,
82
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, FPRegs:$rs2),
83
+ "fmul8x16au $rs1, $rs2, $rd">;
84
+ def FMUL8X16AL : VISInstFormat<0b000110101,
85
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, FPRegs:$rs2),
86
+ "fmul8x16al $rs1, $rs2, $rd">;
76
87
def FMUL8SUX16 : VISInst<0b000110110, "fmul8sux16">;
77
88
def FMUL8ULX16 : VISInst<0b000110111, "fmul8ulx16">;
78
- def FMULD8SUX16 : VISInst<0b000111000, "fmuld8sux16">;
79
- def FMULD8ULX16 : VISInst<0b000111001, "fmuld8ulx16">;
89
+ def FMULD8SUX16 : VISInstFormat<0b000111000,
90
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, FPRegs:$rs2),
91
+ "fmuld8sux16 $rs1, $rs2, $rd">;
92
+ def FMULD8ULX16 : VISInstFormat<0b000111001,
93
+ (outs DFPRegs:$rd), (ins FPRegs:$rs1, FPRegs:$rs2),
94
+ "fmuld8ulx16 $rs1, $rs2, $rd">;
80
95
81
96
def ALIGNADDR : VISInst<0b000011000, "alignaddr", I64Regs>;
82
97
def ALIGNADDRL : VISInst<0b000011010, "alignaddrl", I64Regs>;
@@ -148,9 +163,11 @@ def SHUTDOWN : VISInst0<0b010000000, "shutdown">;
148
163
let Predicates = [HasVIS2] in {
149
164
150
165
def BMASK : VISInst<0b000011001, "bmask", I64Regs>;
151
- def BSHUFFLE : VISInst<0b000011100 , "bshuffle">;
166
+ def BSHUFFLE : VISInst<0b001001100 , "bshuffle">;
152
167
153
- def SIAM : VISInst0<0b010000001, "siam">;
168
+ let rd = 0, rs1 = 0 in
169
+ def SIAM : F3_3_siam<0b10, 0b110110, 0b010000001, (outs),
170
+ (ins i32imm:$mode), "siam $mode", []>;
154
171
155
172
def EDGE8N : VISInst<0b000000001, "edge8n", I64Regs>;
156
173
def EDGE8LN : VISInst<0b000000011, "edge8ln", I64Regs>;
@@ -172,59 +189,59 @@ def ADDXCCC : VISInst<0b000010011, "addxccc", I64Regs>;
172
189
173
190
let rd = 0, rs1 = 0 in {
174
191
def CMASK8 : VISInstFormat<0b000011011, (outs), (ins I64Regs:$rs2),
175
- "cmask8 $rs2", [] >;
192
+ "cmask8 $rs2">;
176
193
def CMASK16 : VISInstFormat<0b000011101, (outs), (ins I64Regs:$rs2),
177
- "cmask16 $rs2", [] >;
194
+ "cmask16 $rs2">;
178
195
def CMASK32 : VISInstFormat<0b000011111, (outs), (ins I64Regs:$rs2),
179
- "cmask32 $rs2", [] >;
196
+ "cmask32 $rs2">;
180
197
181
198
}
182
199
183
200
def FCHKSM16 : VISInst<0b001000100, "fchksm16">;
184
201
185
202
def FHADDS : F3_3<0b10, 0b110100, 0b001100001,
186
- (outs DFPRegs :$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
203
+ (outs FPRegs :$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
187
204
"fhadds $rs1, $rs2, $rd", []>;
188
205
def FHADDD : F3_3<0b10, 0b110100, 0b001100010,
189
206
(outs DFPRegs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
190
207
"fhaddd $rs1, $rs2, $rd", []>;
191
208
def FHSUBS : F3_3<0b10, 0b110100, 0b001100101,
192
- (outs DFPRegs :$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
209
+ (outs FPRegs :$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
193
210
"fhsubs $rs1, $rs2, $rd", []>;
194
211
def FHSUBD : F3_3<0b10, 0b110100, 0b001100110,
195
212
(outs DFPRegs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
196
213
"fhsubd $rs1, $rs2, $rd", []>;
197
214
def FLCMPS : VISInstFormat<0b101010001, (outs FCCRegs:$rd),
198
- (ins DFPRegs :$rs1, DFPRegs :$rs2),
199
- "flcmps $rd, $rs1, $rs2", [] >;
215
+ (ins FPRegs :$rs1, FPRegs :$rs2),
216
+ "flcmps $rd, $rs1, $rs2">;
200
217
def FLCMPD : VISInstFormat<0b101010010, (outs FCCRegs:$rd),
201
218
(ins DFPRegs:$rs1, DFPRegs:$rs2),
202
- "flcmpd $rd, $rs1, $rs2", [] >;
219
+ "flcmpd $rd, $rs1, $rs2">;
203
220
204
221
def FMEAN16 : VISInst<0b001000000, "fmean16">;
205
222
206
223
def FNADDS : F3_3<0b10, 0b110100, 0b001010001,
207
- (outs DFPRegs :$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
224
+ (outs FPRegs :$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
208
225
"fnadds $rs1, $rs2, $rd", []>;
209
226
def FNADDD : F3_3<0b10, 0b110100, 0b001010010,
210
227
(outs DFPRegs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
211
228
"fnaddd $rs1, $rs2, $rd", []>;
212
229
def FNHADDS : F3_3<0b10, 0b110100, 0b001110001,
213
- (outs DFPRegs :$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
230
+ (outs FPRegs :$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
214
231
"fnhadds $rs1, $rs2, $rd", []>;
215
232
def FNHADDD : F3_3<0b10, 0b110100, 0b001110010,
216
233
(outs DFPRegs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
217
234
"fnhaddd $rs1, $rs2, $rd", []>;
218
235
219
236
def FNMULS : F3_3<0b10, 0b110100, 0b001011001,
220
- (outs DFPRegs :$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
221
- "fnhadds $rs1, $rs2, $rd", []>;
237
+ (outs FPRegs :$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
238
+ "fnmuls $rs1, $rs2, $rd", []>;
222
239
def FNMULD : F3_3<0b10, 0b110100, 0b001011010,
223
240
(outs DFPRegs:$rd), (ins DFPRegs:$rs1, DFPRegs:$rs2),
224
- "fnhaddd $rs1, $rs2, $rd", []>;
241
+ "fnmuld $rs1, $rs2, $rd", []>;
225
242
def FNSMULD : F3_3<0b10, 0b110100, 0b001111001,
226
- (outs DFPRegs:$rd), (ins DFPRegs :$rs1, DFPRegs :$rs2),
227
- "fnhadds $rs1, $rs2, $rd", []>;
243
+ (outs DFPRegs:$rd), (ins FPRegs :$rs1, FPRegs :$rs2),
244
+ "fnsmuld $rs1, $rs2, $rd", []>;
228
245
229
246
def FPADD64 : VISInst<0b001000010, "fpadd64">;
230
247
@@ -239,24 +256,24 @@ def FSRA32 : VISInst<0b000101111, "fsra32">;
239
256
240
257
let rs1 = 0 in
241
258
def LZCNT : VISInstFormat<0b000010111, (outs I64Regs:$rd),
242
- (ins I64Regs:$rs2), "lzcnt $rs2, $rd", [] >;
259
+ (ins I64Regs:$rs2), "lzcnt $rs2, $rd">;
243
260
244
261
let rs1 = 0 in {
245
262
def MOVSTOSW : VISInstFormat<0b100010011, (outs I64Regs:$rd),
246
- (ins DFPRegs:$rs2), "movstosw $rs2, $rd", [] >;
263
+ (ins DFPRegs:$rs2), "movstosw $rs2, $rd">;
247
264
def MOVSTOUW : VISInstFormat<0b100010001, (outs I64Regs:$rd),
248
- (ins DFPRegs:$rs2), "movstouw $rs2, $rd", [] >;
265
+ (ins DFPRegs:$rs2), "movstouw $rs2, $rd">;
249
266
def MOVDTOX : VISInstFormat<0b100010000, (outs I64Regs:$rd),
250
- (ins DFPRegs:$rs2), "movdtox $rs2, $rd", [] >;
267
+ (ins DFPRegs:$rs2), "movdtox $rs2, $rd">;
251
268
def MOVWTOS : VISInstFormat<0b100011001, (outs DFPRegs:$rd),
252
- (ins I64Regs:$rs2), "movdtox $rs2, $rd", [] >;
269
+ (ins I64Regs:$rs2), "movwtos $rs2, $rd">;
253
270
def MOVXTOD : VISInstFormat<0b100011000, (outs DFPRegs:$rd),
254
- (ins I64Regs:$rs2), "movdtox $rs2, $rd", [] >;
271
+ (ins I64Regs:$rs2), "movxtod $rs2, $rd">;
255
272
}
256
273
257
- def PDISTN : VISInst <0b000111111, "pdistn">;
274
+ def PDISTN : VISInstID <0b000111111, "pdistn">;
258
275
259
276
def UMULXHI : VISInst<0b000010110, "umulxhi", I64Regs>;
260
277
def XMULX : VISInst<0b100010101, "xmulx", I64Regs>;
261
- def XMULXHI : VISInst<0b100010111 , "xmulxhi", I64Regs>;
278
+ def XMULXHI : VISInst<0b100010110 , "xmulxhi", I64Regs>;
262
279
} // Predicates = [IsVIS3]
0 commit comments