Debian Codegraph @

src/imagination/pco/pco_ops.py

raw
1 # Copyright © 2024 Imagination Technologies Ltd.
2 # SPDX-License-Identifier: MIT
3
4 from pco_pygen_common import *
5
6 OP_TYPE = enum_type('op_type', [
7 'pseudo',
8 'hw',
9 'hw_direct',
10 ])
11
12 MOD_TYPE = enum_type('mod_type', [
13 'bool',
14 'uint',
15 'enum',
16 ])
17
18 REF_TYPE = enum_type('ref_type', [
19 ('null', '_'),
20 ('ssa', '%'),
21 ('reg', ''),
22 ('idx_reg', ''),
23 ('imm', ''),
24 ('io', ''),
25 ('pred', ''),
26 ('drc', 'drc'),
27 ])
28
29 FUNC_TYPE = enum_type('func_type', [
30 'callable',
31 'preamble',
32 'entrypoint',
33 'phase_change',
34 ])
35
36 DTYPE = enum_type('dtype', [
37 ('any', ''),
38 ('unsigned', 'u'),
39 ('signed', 'i'),
40 ('float', 'f'),
41 ])
42
43 BITS = enum_type('bits', [
44 ('1', '1'),
45 ('8', '8'),
46 ('16', '16'),
47 ('32', '32'),
48 ('64', '64'),
49 ])
50
51 REG_CLASS = enum_type('reg_class', [
52 ('virt', '$'),
53 ('temp', 'r'),
54 ('vtxin', 'vi'),
55 ('coeff', 'cf'),
56 ('shared', 'sh'),
57 ('index', 'idx'),
58 ('spec', 'sr'),
59 ('intern', 'i'),
60 ('const', 'sc'),
61 ('pixout', 'po'),
62 ('global', 'g'),
63 ('slot', 'sl'),
64 ])
65
66 IO = enum_type('io', [
67 ('s0', 's0'),
68 ('s1', 's1'),
69 ('s2', 's2'),
70
71 ('s3', 's3'),
72 ('s4', 's4'),
73 ('s5', 's5'),
74
75 ('w0', 'w0'),
76 ('w1', 'w1'),
77
78 ('is0', 'is0'),
79 ('is1', 'is1'),
80 ('is2', 'is2'),
81 ('is3', 'is3'),
82 ('is4', 'is4'),
83 ('is5', 'is5'),
84
85 ('ft0', 'ft0'),
86 ('ft1', 'ft1'),
87 ('ft2', 'ft2'),
88 ('fte', 'fte'),
89
90 ('ft1_invert', '~ft1'),
91 ('ft3', 'ft3'),
92 ('ft4', 'ft4'),
93 ('ft5', 'ft5'),
94
95 ('ftt', 'ftt'),
96
97 ('cout', 'cout'),
98 ])
99
100 PRED = enum_type('pred', [
101 ('pe', 'pe'),
102 ('p0', 'p0'),
103
104 ('always', 'if(1)'),
105 ('p0_true', 'if(p0)'),
106 ('never', 'if(0)'),
107 ('p0_false', 'if(!p0)'),
108 ])
109
110 DRC = enum_type('drc', [
111 ('0', '0'),
112 ('1', '1'),
113 ('pending', '?'),
114 ])
115
116 MUTEX_ID = enum_type('mutex_id', [
117 'atomic_emu',
118 'barrier',
119 'rsvd_2',
120 'rsvd_3',
121 'rsvd_4',
122 'rsvd_5',
123 'rsvd_6',
124 'rsvd_7',
125 'rsvd_8',
126 'rsvd_9',
127 'rsvd_a',
128 'rsvd_b',
129 'rsvd_c',
130 'rsvd_d',
131 'rsvd_e',
132 'rsvd_f'
133 ])
134
135 # Ref mods.
136 RM_ONEMINUS = ref_mod('oneminus', BaseType.bool)
137 RM_CLAMP = ref_mod('clamp', BaseType.bool)
138 RM_ABS = ref_mod('abs', BaseType.bool)
139 RM_NEG = ref_mod('neg', BaseType.bool)
140 RM_FLR = ref_mod('flr', BaseType.bool)
141
142 RM_ELEM = ref_mod_enum('elem', [
143 'e0',
144 'e1',
145 'e2',
146 'e3',
147 ], is_bitset=True)
148
149 # Op mods.
150 OM_EXEC_CND = op_mod_enum('exec_cnd', [
151 ('e1_zx', ''),
152 ('e1_z1', 'if(p0)'),
153 ('ex_zx', '(ignorepe)'),
154 ('e1_z0', 'if(!p0)'),
155 ], print_early=True, unset=True)
156 OM_RPT = op_mod('rpt', BaseType.uint, print_early=True, nzdefault=1, unset=True)
157 OM_SAT = op_mod('sat', BaseType.bool)
158 OM_LP = op_mod('lp', BaseType.bool)
159 OM_SCALE = op_mod('scale', BaseType.bool)
160 OM_ROUNDZERO = op_mod('roundzero', BaseType.bool)
161 OM_S = op_mod('s', BaseType.bool)
162 OM_TST_TYPE_MAIN = op_mod_enum('tst_type_main', [
163 'f32',
164 'u16',
165 's16',
166 'u8',
167 's8',
168 'u32',
169 's32',
170 ])
171 OM_TST_OP_MAIN = op_mod_enum('tst_op_main', [
172 ('zero', 'z'),
173 ('gzero', 'gz'),
174 ('gezero', 'gez'),
175 ('carry', 'c'),
176 ('equal', 'e'),
177 ('greater', 'g'),
178 ('gequal', 'ge'),
179 ('notequal', 'ne'),
180 ('less', 'l'),
181 ('lequal', 'le'),
182 ])
183 OM_TST_OP_BITWISE = op_mod_enum('tst_op_bitwise', [
184 ('zero', 'z'),
185 ('nonzero', 'nz'),
186 ])
187 OM_SIGNPOS = op_mod_enum('signpos', [
188 'twb',
189 'pwb',
190 'mtb',
191 'ftb',
192 ])
193 OM_DIM = op_mod_enum('dim', [
194 '1d',
195 '2d',
196 '3d',
197 ])
198 OM_PROJ = op_mod('proj', BaseType.bool)
199 OM_FCNORM = op_mod('fcnorm', BaseType.bool)
200 OM_NNCOORDS = op_mod('nncoords', BaseType.bool)
201 OM_LOD_MODE = op_mod_enum('lod_mode', [
202 ('normal', ''),
203 ('bias', 'bias'),
204 ('replace', 'replace'),
205 ('gradients', 'gradients'),
206 ])
207 OM_PPLOD = op_mod('pplod', BaseType.bool)
208 OM_TAO = op_mod('tao', BaseType.bool)
209 OM_SOO = op_mod('soo', BaseType.bool)
210 OM_SNO = op_mod('sno', BaseType.bool)
211 OM_WRT = op_mod('wrt', BaseType.bool)
212 OM_SB_MODE = op_mod_enum('sb_mode', [
213 ('none', ''),
214 ('rawdata', 'rawdata'),
215 ('coeffs', 'coeffs'),
216 ('both', 'both'),
217 ])
218 OM_ARRAY = op_mod('array', BaseType.bool)
219 OM_INTEGER = op_mod('integer', BaseType.bool)
220 OM_SCHEDSWAP = op_mod_enum('schedswap', [
221 ('none', ''),
222 ('swap', 'schedswap'),
223 ])
224 OM_F16 = op_mod('f16', BaseType.bool)
225 OM_TILED = op_mod('tiled', BaseType.bool)
226 OM_FREEP = op_mod('freep', BaseType.bool)
227 OM_SM = op_mod('sm', BaseType.bool)
228 OM_SAVMSK_MODE = op_mod_enum('savmsk_mode', [
229 'vm',
230 'icm',
231 'icmoc',
232 'icmi',
233 'caxy',
234 ])
235 OM_ATOM_OP = op_mod_enum('atom_op', [
236 'add',
237 'sub',
238 'xchg',
239 'cmpxchg',
240 'umin',
241 'imin',
242 'umax',
243 'imax',
244 'and',
245 'or',
246 'xor',
247 ])
248 OM_MCU_CACHE_MODE_LD = op_mod_enum('mcu_cache_mode_ld', [
249 ('normal', ''),
250 ('bypass', 'bypass'),
251 ('force_line_fill', 'forcelinefill'),
252 ])
253 OM_MCU_CACHE_MODE_ST = op_mod_enum('mcu_cache_mode_st', [
254 ('write_through', 'writethrough'),
255 ('write_back', 'writeback'),
256 ('lazy_write_back', 'lazywriteback'),
257 ])
258 OM_BRANCH_CND = op_mod_enum('branch_cnd', [
259 ('exec_cond', ''),
260 ('allinst', 'allinst'),
261 ('anyinst', 'anyinst'),
262 ])
263 OM_LINK = op_mod('link', BaseType.bool)
264 OM_PCK_FMT = op_mod_enum('pck_fmt', [
265 'u8888',
266 's8888',
267 'o8888',
268 'u1616',
269 's1616',
270 'o1616',
271 'u32',
272 's32',
273 'u1010102',
274 's1010102',
275 'u111110',
276 's111110',
277 'f111110',
278 'f16f16',
279 'f32',
280 'cov',
281 'u565u565',
282 'd24s8',
283 's8d24',
284 'f32_mask',
285 '2f10f10f10',
286 's8888ogl',
287 's1616ogl',
288 'zero',
289 'one',
290 ])
291 OM_PHASE2END = op_mod('phase2end', BaseType.bool)
292 OM_ITR_MODE = op_mod_enum('itr_mode', [
293 'pixel',
294 'sample',
295 'centroid',
296 ])
297 OM_SCHED = op_mod_enum('sched', [
298 ('none', ''),
299 ('swap', 'schedswap'),
300 ('wdf', 'schedwdf'),
301 ])
302 OM_ATOM = op_mod('atom', BaseType.bool, unset=True)
303 OM_OLCHK = op_mod('olchk', BaseType.bool, unset=True)
304 OM_END = op_mod('end', BaseType.bool, unset=True)
305
306 OM_LOGIOP = op_mod_enum('logiop', [
307 'or',
308 'and',
309 'xor',
310 'nor',
311 'nand',
312 'xnor',
313 ])
314
315 OM_SHIFTOP = op_mod_enum('shiftop', [
316 'lsl',
317 'shr',
318 'rol',
319 'cps',
320 'asr_twb',
321 'asr_pwb',
322 'asr_mtb',
323 'asr_ftb',
324 ])
325
326 OM_CND = op_mod_enum('cnd', [
327 ('always', 'if(1)'),
328 ('p0_true', 'if(p0)'),
329 ('never', 'if(0)'),
330 ('p0_false', 'if(!p0)'),
331 ])
332
333 OM_FRED_TYPE = op_mod_enum('fred_type', [
334 'sin',
335 'cos',
336 ])
337
338 OM_FRED_PART = op_mod_enum('fred_part', [
339 'a',
340 'b',
341 ])
342
343 OM_MUTEX_OP = op_mod_enum('mutex_op', [
344 ('release', 'release'),
345 ('release_sleep', 'release.sleep'),
346 ('release_wakeup', 'release.wakeup'),
347 ('lock', 'lock'),
348 ])
349
350 OM_OFFSET_SD = op_mod_enum('offset_sd', [
351 'src',
352 'dest',
353 ])
354
355 OM_IDF = op_mod('idf', BaseType.bool)
356
357 # Ops.
358
359 OM_ALU = [OM_OLCHK, OM_EXEC_CND, OM_END, OM_ATOM, OM_RPT]
360 OM_ALU_RPT1 = [OM_OLCHK, OM_EXEC_CND, OM_END, OM_ATOM]
361 OM_ALU_ATOMEXT = [OM_OLCHK, OM_EXEC_CND, OM_END, OM_RPT]
362
363 ## Main.
364 O_FADD = hw_op('fadd', OM_ALU + [OM_SAT], 1, 2, [], [[RM_ABS, RM_NEG, RM_FLR], [RM_ABS]])
365 O_FMUL = hw_op('fmul', OM_ALU + [OM_SAT], 1, 2, [], [[RM_ABS, RM_NEG, RM_FLR], [RM_ABS]])
366 O_FMAD = hw_op('fmad', OM_ALU + [OM_SAT, OM_LP], 1, 3, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG], [RM_ABS, RM_NEG, RM_FLR]])
367 O_FRCP = hw_op('frcp', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
368 O_FRSQ = hw_op('frsq', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
369 O_FLOG = hw_op('flog', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
370 O_FLOGCN = hw_op('flogcn', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
371 O_FEXP = hw_op('fexp', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
372 O_FRED = hw_op('fred', OM_ALU + [OM_FRED_TYPE, OM_FRED_PART], 3, 3, [], [[RM_ABS, RM_NEG]])
373 O_FSINC = hw_op('fsinc', OM_ALU, 2, 1)
374 O_MBYP = hw_op('mbyp', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
375 O_FDSX = hw_op('fdsx', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
376 O_FDSXF = hw_op('fdsxf', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
377 O_FDSY = hw_op('fdsy', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
378 O_FDSYF = hw_op('fdsyf', OM_ALU, 1, 1, [], [[RM_ABS, RM_NEG]])
379 O_PCK = hw_op('pck', OM_ALU + [OM_PCK_FMT, OM_ROUNDZERO, OM_SCALE], 1, 1)
380 O_PCK_PROG = hw_op('pck.prog', OM_ALU + [OM_ROUNDZERO, OM_SCALE], 1, 2)
381 O_ADD64_32 = hw_op('add64_32', OM_ALU + [OM_S], 2, 4, [], [[RM_ABS, RM_NEG], [], [RM_ABS, RM_NEG]])
382 O_IMADD64 = hw_op('imadd64', OM_ALU + [OM_S], 2, 5, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
383 O_IMADD32 = hw_op('imadd32', OM_ALU + [OM_S], 1, 4, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
384 O_UNPCK = hw_op('unpck', OM_ALU + [OM_PCK_FMT, OM_ROUNDZERO, OM_SCALE], 1, 1, [], [[RM_ELEM]])
385
386 O_TST = hw_direct_op('tst', [OM_TST_OP_MAIN, OM_PHASE2END, OM_TST_TYPE_MAIN], 2, 2, [], [[RM_ELEM], [RM_ELEM]])
387 O_MOVC = hw_direct_op('movc', [OM_PHASE2END], 2, 5, [[RM_ELEM]])
388
389 O_MOVWM = hw_op('movwm', OM_ALU + [OM_PHASE2END], 1, 2, [[RM_ELEM]])
390 O_MOVS1 = hw_op('movs1', OM_ALU, 1, 1)
391
392 # TODO
393 # O_PCK_ELEM = pseudo_op('pck.elem', OM_ALU_RPT1 + [OM_PCK_FMT, OM_ROUNDZERO, OM_SCALE], 1, 2)
394
395 ## Backend.
396 O_UVSW_WRITE = hw_op('uvsw.write', [OM_EXEC_CND, OM_RPT], 0, 2)
397 O_UVSW_EMIT = hw_op('uvsw.emit', [OM_EXEC_CND])
398 O_UVSW_ENDTASK = hw_op('uvsw.endtask', [OM_END])
399 O_UVSW_EMIT_ENDTASK = hw_op('uvsw.emit.endtask', [OM_END])
400 O_UVSW_WRITE_EMIT_ENDTASK = hw_op('uvsw.write.emit.endtask', [OM_END], 0, 2)
401
402 O_FITR = hw_op('fitr', [OM_EXEC_CND, OM_END, OM_ITR_MODE, OM_SAT], 1, 3)
403 O_FITRP = hw_op('fitrp', [OM_EXEC_CND, OM_END, OM_ITR_MODE, OM_SAT], 1, 4)
404
405 O_LD = hw_op('ld', OM_ALU_RPT1 + [OM_MCU_CACHE_MODE_LD], 1, 3)
406 O_LD_REGBL = hw_op('ld.regbl', OM_ALU_RPT1 + [OM_MCU_CACHE_MODE_LD], 1, 3)
407
408 O_ST = hw_direct_op('st', [OM_MCU_CACHE_MODE_ST, OM_IDF], 0, 6)
409 O_ST_REGBL = hw_direct_op('st.regbl', [OM_MCU_CACHE_MODE_ST, OM_IDF], 0, 6)
410
411 # { data, data size, drc, chans, addr, cov_msk}
412 O_ST_TILED = hw_op('st.tiled', OM_ALU_RPT1 + [OM_MCU_CACHE_MODE_ST], 0, 6)
413
414 O_IDF = hw_op('idf', OM_ALU_RPT1, 0, 2)
415
416 O_ATOMIC = hw_op('atomic', [OM_OLCHK, OM_EXEC_CND, OM_END, OM_ATOM_OP], 1, 2)
417
418 O_SMP = hw_op('smp', OM_ALU_RPT1 + [OM_DIM, OM_PROJ, OM_FCNORM, OM_NNCOORDS,
419 OM_LOD_MODE, OM_PPLOD, OM_TAO, OM_SOO,
420 OM_SNO, OM_WRT, OM_SB_MODE, OM_MCU_CACHE_MODE_LD,
421 OM_ARRAY, OM_INTEGER, OM_SCHEDSWAP, OM_F16], 1, 6)
422
423 O_ALPHATST = hw_op('alphatst', OM_ALU_RPT1, 1, 4)
424
425 O_ALPHAF = hw_op('alphaf', OM_ALU_RPT1, 1, 4)
426 O_DEPTHF = hw_op('depthf', OM_ALU_RPT1, 0, 2)
427
428 O_SAVMSK = hw_op('savmsk', OM_ALU_RPT1 + [OM_SAVMSK_MODE], 2)
429
430 O_EMITPIX = hw_op('emitpix', OM_ALU_RPT1 + [OM_FREEP], 0, 2)
431
432 ## Bitwise.
433 O_MOVI32 = hw_op('movi32', OM_ALU, 1, 1)
434
435 O_CBS = hw_op('cbs', OM_ALU, 1, 1)
436 O_FTB = hw_op('ftb', OM_ALU, 1, 1)
437 O_REV = hw_op('rev', OM_ALU, 1, 1)
438 O_SHUFFLE = hw_op('shuffle', OM_ALU, 1, 2)
439 O_LOGICAL = hw_op('logical', OM_ALU + [OM_LOGIOP], 1, 4)
440 O_SHIFT = hw_op('shift', OM_ALU + [OM_SHIFTOP], 1, 3)
441
442 O_COPYSIGN = hw_op('copysign', OM_ALU, 1, 2)
443
444 O_IBFE = hw_op('ibfe', OM_ALU, 1, 3)
445 O_UBFE = hw_op('ubfe', OM_ALU, 1, 3)
446 O_BFI = hw_op('bfi', OM_ALU, 1, 4)
447
448 O_BBYP0BM = hw_direct_op('bbyp0bm', [], 2, 2)
449 O_BBYP0BM_IMM32 = hw_direct_op('bbyp0bm_imm32', [], 2, 2)
450 O_BBYP0S1 = hw_direct_op('bbyp0s1', [], 2, 1)
451 O_MSK_BBYP0S1 = hw_direct_op('msk_bbyp0s1', [], 3, 3)
452 O_MSK_LSL = hw_direct_op('msk_lsl', [], 3, 3)
453
454 ## Control.
455 O_WOP = hw_op('wop')
456 O_WDF = hw_op('wdf', [], 0, 1)
457 O_NOP = hw_op('nop', [OM_EXEC_CND, OM_END])
458
459 # TODO NEXT: gate usage of OM_F16!
460 O_DITR = hw_op('ditr', [OM_EXEC_CND, OM_ITR_MODE, OM_SAT, OM_SCHED, OM_F16], 1, 3)
461 O_DITRP = hw_op('ditrp', [OM_EXEC_CND, OM_ITR_MODE, OM_SAT, OM_SCHED, OM_F16], 1, 4)
462 O_DITRP_WRITE = hw_op('ditrp.write', [OM_EXEC_CND, OM_ITR_MODE, OM_SAT, OM_SCHED, OM_F16], 1, 4)
463 O_DITRP_READ = hw_op('ditrp.read', [OM_EXEC_CND, OM_ITR_MODE, OM_SAT, OM_SCHED, OM_F16], 1, 3)
464
465 O_CNDST = hw_op('cndst', [OM_EXEC_CND, OM_CND], 2, 2)
466 O_CNDEF = hw_op('cndef', [OM_EXEC_CND, OM_CND], 2, 2)
467 O_CNDSM = hw_op('cndsm', [OM_EXEC_CND, OM_CND], 2, 2)
468 O_CNDLT = hw_op('cndlt', [OM_EXEC_CND, OM_CND], 3, 2)
469 O_CNDEND = hw_op('cndend', [OM_EXEC_CND], 2, 2)
470
471 O_BR = hw_op('br', [OM_EXEC_CND, OM_BRANCH_CND, OM_LINK], has_target_cf_node=True)
472
473 O_BR_NEXT = hw_op('br.next', [OM_EXEC_CND])
474
475 O_MUTEX = hw_op('mutex', [OM_MUTEX_OP], 0, 1)
476
477 # Combination (> 1 instructions per group).
478 O_SCMP = hw_op('scmp', OM_ALU + [OM_TST_OP_MAIN], 1, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
479 O_BCMP = hw_op('bcmp', OM_ALU + [OM_TST_OP_MAIN, OM_TST_TYPE_MAIN], 1, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
480 O_BCSEL = hw_op('bcsel', OM_ALU, 1, 3, [], [[], [RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
481 O_CSEL = hw_op('csel', OM_ALU + [OM_TST_OP_MAIN, OM_TST_TYPE_MAIN], 1, 3, [], [[], [RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
482 O_PSEL = hw_op('psel', OM_ALU, 1, 3)
483 O_PSEL_TRIG = hw_op('psel_trig', OM_ALU, 1, 3)
484 O_FSIGN = hw_op('fsign', OM_ALU, 1, 1)
485 O_ISIGN = hw_op('isign', OM_ALU, 1, 1)
486 O_FCEIL = hw_op('fceil', OM_ALU, 1, 1)
487 O_MIN = hw_op('min', OM_ALU + [OM_TST_TYPE_MAIN], 1, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
488 O_MAX = hw_op('max', OM_ALU + [OM_TST_TYPE_MAIN], 1, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
489 O_IADD32 = hw_op('iadd32', OM_ALU + [OM_S], 1, 3, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
490 O_IMUL32 = hw_op('imul32', OM_ALU + [OM_S], 1, 3, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
491
492 O_UADD_CARRY = hw_op('uadd_carry', OM_ALU, 2, 2)
493 O_UADD_SAT = hw_op('uadd_sat', OM_ALU, 1, 3)
494
495 O_TSTZ = hw_op('tstz', OM_ALU + [OM_TST_TYPE_MAIN], 2, 1, [], [[RM_ELEM]])
496 O_ST32 = hw_op('st32', OM_ALU_RPT1 + [OM_MCU_CACHE_MODE_ST, OM_IDF], 0, 5)
497 O_ST32_REGBL = hw_op('st32.regbl', OM_ALU_RPT1 + [OM_MCU_CACHE_MODE_ST, OM_IDF], 0, 5)
498
499 # [vec3 for store], [data, offset, base_addr_lo, base_addr_hi]
500 O_SPILL = hw_op('spill', OM_ALU_RPT1, 1, 4)
501
502 # [result], [offset, base_addr_lo, base_addr_hi]
503 O_UNSPILL = hw_op('unspill', OM_ALU_RPT1, 1, 3)
504
505 O_IADD32_ATOMIC = hw_op('iadd32.atomic', OM_ALU_ATOMEXT + [OM_S], 2, 3, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
506 O_XCHG_ATOMIC = hw_op('xchg.atomic', OM_ALU_ATOMEXT, 2, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
507 O_CMPXCHG_ATOMIC = hw_op('cmpxchg.atomic', OM_ALU_ATOMEXT + [OM_TST_TYPE_MAIN], 2, 3, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
508 O_MIN_ATOMIC = hw_op('min.atomic', OM_ALU_ATOMEXT + [OM_TST_TYPE_MAIN], 2, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
509 O_MAX_ATOMIC = hw_op('max.atomic', OM_ALU_ATOMEXT + [OM_TST_TYPE_MAIN], 2, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
510 O_LOGICAL_ATOMIC = hw_op('logical.atomic', OM_ALU_ATOMEXT + [OM_LOGIOP], 2, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
511
512 O_FLUSH_P0 = hw_op('flush.p0', [OM_EXEC_CND, OM_END])
513
514 O_MBYP2 = hw_op('mbyp2', OM_ALU, 2, 2, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
515
516 # Pseudo-ops (unmapped).
517 O_FNEG = pseudo_op('fneg', OM_ALU, 1, 1)
518 O_FABS = pseudo_op('fabs', OM_ALU, 1, 1)
519 O_FFLR = pseudo_op('fflr', OM_ALU, 1, 1)
520 O_MOV = pseudo_op('mov', OM_ALU, 1, 1)
521 O_MOV_OFFSET = pseudo_op('mov.offset', OM_ALU + [OM_OFFSET_SD], 1, 2)
522 O_VEC = pseudo_op('vec', [OM_EXEC_CND], 1, VARIABLE)
523 O_COMP = pseudo_op('comp', [], 1, 2)
524 O_FENCE = pseudo_op('fence')
525
526 O_OP_ATOMIC_OFFSET = pseudo_op('op.atomic.offset', OM_ALU_ATOMEXT + [OM_ATOM_OP], 2, 4, [], [[RM_ABS, RM_NEG], [RM_ABS, RM_NEG]])
527
528 O_BREAK = pseudo_op('break', [OM_EXEC_CND])
529 O_CONTINUE = pseudo_op('continue', [OM_EXEC_CND])