gem5 v24.0.0.0
Loading...
Searching...
No Matches
vop3p.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Advanced Micro Devices, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 *
15 * 3. Neither the name of the copyright holder nor the names of its
16 * contributors may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#ifndef __ARCH_VEGA_INSTS_VOP3P_HH__
33#define __ARCH_VEGA_INSTS_VOP3P_HH__
34
38#include "debug/VEGA.hh"
39
40namespace gem5
41{
42
43namespace VegaISA
44{
45 // One source operand
47 {
48 public:
49 Inst_VOP3P__1OP(InFmt_VOP3P *iFmt, const std::string& name)
50 : Inst_VOP3P(iFmt, name)
51 {
52 setFlag(ALU);
53 }
54
55 int
56 getNumOperands() override
57 {
59 } // getNumOperands
60
61 int numDstRegOperands() override { return 1; }
62 int numSrcRegOperands() override { return 1; }
63
64 int
65 getOperandSize(int opIdx) override
66 {
67 switch (opIdx) {
68 case 0: // src
69 return 4;
70 case 1: // dst
71 return 4;
72 default:
73 fatal("op idx %i out of bounds\n", opIdx);
74 return -1;
75 }
76 }
77
78 };
79
80 // Two source operands with two 16-bit values in a dword
82 {
83 public:
84 Inst_VOP3P__2OP_X16(InFmt_VOP3P *iFmt, const std::string& name)
85 : Inst_VOP3P(iFmt, name)
86 {
87 setFlag(ALU);
88 }
89
90 int
91 getNumOperands() override
92 {
94 } // getNumOperands
95
96 int numDstRegOperands() override { return 1; }
97 int numSrcRegOperands() override { return 2; }
98
99 int
100 getOperandSize(int opIdx) override
101 {
102 switch (opIdx) {
103 case 0: // src0
104 return 4;
105 case 1: // src1
106 return 4;
107 case 2: // dst
108 return 4;
109 default:
110 fatal("op idx %i out of bounds\n", opIdx);
111 return -1;
112 }
113 }
114
115 };
116
117 // Three source operands with two 16-bit values in a dword
119 {
120 public:
121 Inst_VOP3P__3OP_X16(InFmt_VOP3P *iFmt, const std::string& name)
122 : Inst_VOP3P(iFmt, name)
123 {
124 setFlag(ALU);
125 }
126
127 int
128 getNumOperands() override
129 {
131 } // getNumOperands
132
133 int numDstRegOperands() override { return 1; }
134 int numSrcRegOperands() override { return 3; }
135
136 int
137 getOperandSize(int opIdx) override
138 {
139 switch (opIdx) {
140 case 0: // src0
141 return 4;
142 case 1: // src1
143 return 4;
144 case 2: // src2
145 return 4;
146 case 3: // dst
147 return 4;
148 default:
149 fatal("op idx %i out of bounds\n", opIdx);
150 return -1;
151 }
152 }
153
154 };
155
156
157
158 // Begin instruction implementations
160 {
161 public:
163 : Inst_VOP3P__3OP_X16(iFmt, "v_pk_mad_i16")
164 { }
165
166 void execute(GPUDynInstPtr gpuDynInst) override;
167 };
168
170 {
171 public:
173 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_mul_lo_u16")
174 { }
175
176 void execute(GPUDynInstPtr gpuDynInst) override;
177 };
178
180 {
181 public:
183 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_add_i16")
184 { }
185
186 void execute(GPUDynInstPtr gpuDynInst) override;
187 };
188
190 {
191 public:
193 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_sub_i16")
194 { }
195
196 void execute(GPUDynInstPtr gpuDynInst) override;
197 };
198
200 {
201 public:
203 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_lshlrev_b16")
204 { }
205
206 void execute(GPUDynInstPtr gpuDynInst) override;
207 };
208
210 {
211 public:
213 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_lshrrev_b16")
214 { }
215
216 void execute(GPUDynInstPtr gpuDynInst) override;
217 };
218
220 {
221 public:
223 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_ashrrev_b16")
224 { }
225
226 void execute(GPUDynInstPtr gpuDynInst) override;
227 };
228
230 {
231 public:
233 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_max_i16")
234 { }
235
236 void execute(GPUDynInstPtr gpuDynInst) override;
237 };
238
240 {
241 public:
243 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_min_i16")
244 { }
245
246 void execute(GPUDynInstPtr gpuDynInst) override;
247 };
248
250 {
251 public:
253 : Inst_VOP3P__3OP_X16(iFmt, "v_pk_mad_u16")
254 { }
255
256 void execute(GPUDynInstPtr gpuDynInst) override;
257 };
258
260 {
261 public:
263 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_add_u16")
264 { }
265
266 void execute(GPUDynInstPtr gpuDynInst) override;
267 };
268
270 {
271 public:
273 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_sub_u16")
274 { }
275
276 void execute(GPUDynInstPtr gpuDynInst) override;
277 };
278
280 {
281 public:
283 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_max_u16")
284 { }
285
286 void execute(GPUDynInstPtr gpuDynInst) override;
287 };
288
290 {
291 public:
293 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_min_u16")
294 { }
295
296 void execute(GPUDynInstPtr gpuDynInst) override;
297 };
298
300 {
301 public:
303 : Inst_VOP3P__3OP_X16(iFmt, "v_pk_fma_f16")
304 { }
305
306 void execute(GPUDynInstPtr gpuDynInst) override;
307 };
308
310 {
311 public:
313 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_add_f16")
314 { }
315
316 void execute(GPUDynInstPtr gpuDynInst) override;
317 };
318
320 {
321 public:
323 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_mul_f16")
324 { }
325
326 void execute(GPUDynInstPtr gpuDynInst) override;
327 };
328
330 {
331 public:
333 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_min_f16")
334 { }
335
336 void execute(GPUDynInstPtr gpuDynInst) override;
337 };
338
340 {
341 public:
343 : Inst_VOP3P__2OP_X16(iFmt, "v_pk_max_f16")
344 { }
345
346 void execute(GPUDynInstPtr gpuDynInst) override;
347 };
348
350 {
351 public:
353 : Inst_VOP3P__3OP_X16(iFmt, "v_dot2_f32_f16")
354 { }
355
356 void execute(GPUDynInstPtr gpuDynInst) override;
357 };
358
360 {
361 public:
363 : Inst_VOP3P__3OP_X16(iFmt, "v_dot2_i32_i16")
364 { }
365
366 void execute(GPUDynInstPtr gpuDynInst) override;
367 };
368
370 {
371 public:
373 : Inst_VOP3P__3OP_X16(iFmt, "v_dot2_u32_u16")
374 { }
375
376 void execute(GPUDynInstPtr gpuDynInst) override;
377 };
378
380 {
381 public:
383 : Inst_VOP3P__3OP_X16(iFmt, "v_dot4_i32_i8")
384 { }
385
386 void execute(GPUDynInstPtr gpuDynInst) override;
387 };
388
390 {
391 public:
393 : Inst_VOP3P__3OP_X16(iFmt, "v_dot4_u32_u8")
394 { }
395
396 void execute(GPUDynInstPtr gpuDynInst) override;
397 };
398
400 {
401 public:
403 : Inst_VOP3P__3OP_X16(iFmt, "v_dot8_i32_i4")
404 { }
405
406 void execute(GPUDynInstPtr gpuDynInst) override;
407 };
408
410 {
411 public:
413 : Inst_VOP3P__3OP_X16(iFmt, "v_dot8_u32_u4")
414 { }
415
416 void execute(GPUDynInstPtr gpuDynInst) override;
417 };
418
420 {
421 public:
423 : Inst_VOP3P__1OP(iFmt, "v_accvgpr_read")
424 { }
425
426 void execute(GPUDynInstPtr gpuDynInst) override;
427 };
428
430 {
431 public:
433 : Inst_VOP3P__1OP(iFmt, "v_accvgpr_write")
434 { }
435
436 void execute(GPUDynInstPtr gpuDynInst) override;
437 };
438} // namespace VegaISA
439} // namespace gem5
440
441#endif // __ARCH_VEGA_INSTS_VOP3P_HH__
void setFlag(Flags flag)
int getOperandSize(int opIdx) override
Definition vop3p.hh:65
Inst_VOP3P__1OP(InFmt_VOP3P *iFmt, const std::string &name)
Definition vop3p.hh:49
int getNumOperands() override
Definition vop3p.hh:56
int numSrcRegOperands() override
Definition vop3p.hh:62
int numDstRegOperands() override
Definition vop3p.hh:61
int getOperandSize(int opIdx) override
Definition vop3p.hh:100
int numSrcRegOperands() override
Definition vop3p.hh:97
Inst_VOP3P__2OP_X16(InFmt_VOP3P *iFmt, const std::string &name)
Definition vop3p.hh:84
int numDstRegOperands() override
Definition vop3p.hh:96
Inst_VOP3P__3OP_X16(InFmt_VOP3P *iFmt, const std::string &name)
Definition vop3p.hh:121
int getOperandSize(int opIdx) override
Definition vop3p.hh:137
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:597
Inst_VOP3P__V_ACCVGPR_READ(InFmt_VOP3P *iFmt)
Definition vop3p.hh:422
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:616
Inst_VOP3P__V_ACCVGPR_WRITE(InFmt_VOP3P *iFmt)
Definition vop3p.hh:432
Inst_VOP3P__V_DOT2_F32_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:352
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:344
Inst_VOP3P__V_DOT2_I32_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:362
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:384
Inst_VOP3P__V_DOT2_U32_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:372
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:421
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:455
Inst_VOP3P__V_DOT4_I32_I8(InFmt_VOP3P *iFmt)
Definition vop3p.hh:382
Inst_VOP3P__V_DOT4_U32_U8(InFmt_VOP3P *iFmt)
Definition vop3p.hh:392
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:492
Inst_VOP3P__V_DOT8_I32_I4(InFmt_VOP3P *iFmt)
Definition vop3p.hh:402
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:526
Inst_VOP3P__V_DOT8_U32_U4(InFmt_VOP3P *iFmt)
Definition vop3p.hh:412
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:563
Inst_VOP3P__V_PK_ADD_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:312
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:300
Inst_VOP3P__V_PK_ADD_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:182
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:158
Inst_VOP3P__V_PK_ADD_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:262
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:249
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:203
Inst_VOP3P__V_PK_ASHRREV_B16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:222
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:289
Inst_VOP3P__V_PK_FMA_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:302
Inst_VOP3P__V_PK_LSHLREV_B16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:202
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:178
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:191
Inst_VOP3P__V_PK_LSHRREV_B16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:212
Inst_VOP3P__V_PK_MAD_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:162
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:133
Inst_VOP3P__V_PK_MAD_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:252
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:238
Inst_VOP3P__V_PK_MAX_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:342
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:333
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:218
Inst_VOP3P__V_PK_MAX_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:232
Inst_VOP3P__V_PK_MAX_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:282
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:269
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:322
Inst_VOP3P__V_PK_MIN_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:332
Inst_VOP3P__V_PK_MIN_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:242
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:228
Inst_VOP3P__V_PK_MIN_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:292
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:279
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:311
Inst_VOP3P__V_PK_MUL_F16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:322
Inst_VOP3P__V_PK_MUL_LO_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:172
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:145
Inst_VOP3P__V_PK_SUB_I16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:192
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:168
void execute(GPUDynInstPtr gpuDynInst) override
Definition vop3p.cc:259
Inst_VOP3P__V_PK_SUB_U16(InFmt_VOP3P *iFmt)
Definition vop3p.hh:272
#define fatal(...)
This implements a cprintf based fatal() function.
Definition logging.hh:200
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
std::shared_ptr< GPUDynInst > GPUDynInstPtr
Definition misc.hh:49
const std::string & name()
Definition trace.cc:48

Generated on Tue Jun 18 2024 16:23:53 for gem5 by doxygen 1.11.0