Debian Codegraph @

src/imagination/pco/pco_map.py

raw
1 # Copyright © 2024 Imagination Technologies Ltd.
2 # SPDX-License-Identifier: MIT
3
4 from pco_isa import *
5 from pco_ops import *
6
7 REF_MAP = enum_type('ref_map', [
8 ('_', '_'),
9
10 ('s0', 's0'),
11 ('s1', 's1'),
12 ('s2', 's2'),
13
14 ('s3', 's3'),
15 ('s4', 's4'),
16 ('s5', 's5'),
17
18 ('w0', 'w0'),
19 ('w1', 'w1'),
20
21 ('is0', 'is0'),
22 ('is1', 'is1'),
23 ('is2', 'is2'),
24 ('is3', 'is3'),
25 ('is4', 'is4'),
26 ('is5', 'is5'),
27
28 ('ft0', 'ft0'),
29 ('ft1', 'ft1'),
30 ('ft1_invert', '~ft1'),
31 ('ft2', 'ft2'),
32 ('fte', 'fte'),
33
34 ('ft3', 'ft3'),
35 ('ft4', 'ft4'),
36 ('ft5', 'ft5'),
37
38 ('ftt', 'ftt'),
39
40 ('p0', 'p0'),
41 ('pe', 'pe'),
42
43 ('imm', 'imm'),
44 ('drc', 'drc'),
45 ('temp', 'temp'),
46 ('coeff', 'coeff'),
47 ])
48
49 # Enum mappings.
50
51 class EnumMap(object):
52 def __init__(self, name, type_from, type_to, mappings, both_bitsets, pass_zero_val):
53 self.name = name
54 self.type_from = type_from
55 self.type_to = type_to
56 self.mappings = mappings
57 self.both_bitsets = both_bitsets
58 self.pass_zero_val = pass_zero_val
59
60 enum_maps = {}
61
62 def enum_map(enum_from, enum_to, mappings, pass_zero=None):
63 # Only allow passing zero through if this is a bitset.
64 assert pass_zero is None or enum_from.enum.is_bitset
65
66 key = (enum_from, enum_to)
67 assert key not in enum_maps.keys(), f'Duplicate enum mapping for "{enum_from.tname}" to "{enum_to.tname}".'
68
69 assert enum_from.base_type == BaseType.enum
70 assert enum_to.base_type == BaseType.enum
71
72 # Ensure the validity of the enum_from elements.
73 assert set([from_elem for from_elem, to_elem in mappings]).issubset(set(enum_from.enum.elems.keys())), f'Invalid enum_from spec in enum mapping for "{enum_from.tname}" to "{enum_to.tname}".'
74
75 # Ensure the validity of the enum_to elements.
76 assert set([to_elem for from_elem, to_elem in mappings]).issubset(set(enum_to.enum.elems.keys())), f'Invalid enum_to spec in enum mapping for "{enum_from.tname}" to "{enum_to.tname}".'
77
78 _mappings = []
79 for elem_from, elem_to in mappings:
80 _mappings.append((enum_from.enum.elems[elem_from].cname, enum_to.enum.elems[elem_to].cname))
81
82 pass_zero_val = None
83 if pass_zero is not None:
84 if isinstance(pass_zero, int):
85 pass_zero_val = str(pass_zero)
86 elif isinstance(pass_zero, str):
87 assert pass_zero in enum_to.enum.elems.keys()
88 pass_zero_val = enum_to.enum.elems[pass_zero].cname
89 elif isinstance(pass_zero, list):
90 assert all(elem_to in enum_to.enum.elems.keys() for elem_to in pass_zero)
91 pass_zero_val = ' | '.join([enum_to.enum.elems[elem_to].cname for elem_to in pass_zero])
92 else:
93 assert False
94
95 name = f'{prefix}_map_{enum_from.tname}_to_{enum_to.tname}'
96 both_bitsets = enum_from.enum.is_bitset and enum_to.enum.is_bitset
97 enum_maps[key] = EnumMap(name, enum_from.name, enum_to.name, _mappings, both_bitsets, pass_zero_val)
98
99 enum_map(OM_EXEC_CND.t, F_CC, [
100 ('e1_zx', 'e1_zx'),
101 ('e1_z1', 'e1_z1'),
102 ('ex_zx', 'ex_zx'),
103 ('e1_z0', 'e1_z0'),
104 ])
105
106 enum_map(REG_CLASS, F_REGBANK, [
107 ('temp', 'temp'),
108 ('vtxin', 'vtxin'),
109 ('coeff', 'coeff'),
110 ('shared', 'shared'),
111 ('index', 'idx0'),
112 ('spec', 'special'),
113 ('intern', 'special'),
114 ('const', 'special'),
115 ('pixout', 'special'),
116 ('global', 'special'),
117 ('slot', 'special'),
118 ])
119
120 enum_map(REG_CLASS, F_IDXBANK, [
121 ('temp', 'temp'),
122 ('vtxin', 'vtxin'),
123 ('coeff', 'coeff'),
124 ('shared', 'shared'),
125 ('index', 'idx'),
126 ('pixout', 'pixout'),
127 ])
128
129 enum_map(IO, F_IS0_SEL, [
130 ('s0', 's0'),
131 ('s1', 's1'),
132 ('s2', 's2'),
133 ('s3', 's3'),
134 ('s4', 's4'),
135 ('s5', 's5'),
136 ])
137
138 enum_map(IO, F_IS1_SEL, [
139 ('ft0', 'ft0'),
140 ('fte', 'fte'),
141 ])
142
143 enum_map(IO, F_IS2_SEL, [
144 ('ft1', 'ft1'),
145 ('fte', 'fte'),
146 ])
147
148 enum_map(IO, F_IS3_SEL, [
149 ('ft0', 'ft0'),
150 ('ft1', 'ft1'),
151 ('fte', 'fte'),
152 ])
153
154 enum_map(IO, F_IS4_SEL, [
155 ('ft0', 'ft0'),
156 ('ft1', 'ft1'),
157 ('ft2', 'ft2'),
158 ('fte', 'fte'),
159 ])
160
161 enum_map(IO, F_IS5_SEL, [
162 ('ft0', 'ft0'),
163 ('ft1', 'ft1'),
164 ('ft2', 'ft2'),
165 ('fte', 'fte'),
166 ])
167
168 enum_map(OM_ITR_MODE.t, F_ITER_MODE, [
169 ('pixel', 'pixel'),
170 ('sample', 'sample'),
171 ('centroid', 'centroid'),
172 ])
173
174 enum_map(OM_PCK_FMT.t, F_PCK_FORMAT, [
175 ('u8888', 'u8888'),
176 ('s8888', 's8888'),
177 ('o8888', 'o8888'),
178 ('u1616', 'u1616'),
179 ('s1616', 's1616'),
180 ('o1616', 'o1616'),
181 ('u32', 'u32'),
182 ('s32', 's32'),
183 ('u1010102', 'u1010102'),
184 ('s1010102', 's1010102'),
185 ('u111110', 'u111110'),
186 ('s111110', 's111110'),
187 ('f111110', 'f111110'),
188 ('f16f16', 'f16f16'),
189 ('f32', 'f32'),
190 ('cov', 'cov'),
191 ('u565u565', 'u565u565'),
192 ('d24s8', 'd24s8'),
193 ('s8d24', 's8d24'),
194 ('f32_mask', 'f32_mask'),
195 ('2f10f10f10', '2f10f10f10'),
196 ('s8888ogl', 's8888ogl'),
197 ('s1616ogl', 's1616ogl'),
198 ('zero', 'zero'),
199 ('one', 'one'),
200 ])
201
202 enum_map(OM_SCHED.t, F_SCHED_CTRL, [
203 ('none', 'none'),
204 ('swap', 'swap'),
205 ('wdf', 'wdf'),
206 ])
207
208 enum_map(OM_MCU_CACHE_MODE_LD.t, F_CACHEMODE_LD, [
209 ('normal', 'normal'),
210 ('bypass', 'bypass'),
211 ('force_line_fill', 'force_line_fill'),
212 ])
213
214 enum_map(OM_MCU_CACHE_MODE_ST.t, F_CACHEMODE_ST, [
215 ('write_through', 'write_through'),
216 ('write_back', 'write_back'),
217 ('lazy_write_back', 'write_back_lazy'),
218 ])
219
220 enum_map(OM_TST_OP_MAIN.t, F_TST_OP, [
221 ('zero', 'z'),
222 ('gzero', 'gz'),
223 ('gezero', 'gez'),
224 ('carry', 'c'),
225 ('equal', 'e'),
226 ('greater', 'g'),
227 ('gequal', 'ge'),
228 ('notequal', 'ne'),
229 ('less', 'l'),
230 ('lequal', 'le'),
231 ])
232
233 enum_map(OM_TST_TYPE_MAIN.t, F_TST_TYPE, [
234 ('f32', 'f32'),
235 ('u16', 'u16'),
236 ('s16', 's16'),
237 ('u8', 'u8'),
238 ('s8', 's8'),
239 ('u32', 'u32'),
240 ('s32', 's32'),
241 ])
242
243 enum_map(OM_LOGIOP.t, F_LOGICAL_OP, [
244 ('or', 'or'),
245 ('and', 'and'),
246 ('xor', 'xor'),
247 ('nor', 'nor'),
248 ('nand', 'nand'),
249 ('xnor', 'xnor'),
250 ])
251
252 enum_map(OM_SHIFTOP.t, F_SHIFT2_OP, [
253 ('lsl', 'lsl'),
254 ('shr', 'shr'),
255 ('rol', 'rol'),
256 ('cps', 'cps'),
257 ('asr_twb', 'asr_twb'),
258 ('asr_pwb', 'asr_pwb'),
259 ('asr_mtb', 'asr_mtb'),
260 ('asr_ftb', 'asr_ftb'),
261 ])
262
263 enum_map(RM_ELEM.t, F_UPCK_ELEM, [
264 ('e0', 'e0'),
265 ('e1', 'e1'),
266 ('e2', 'e2'),
267 ('e3', 'e3'),
268 ], pass_zero=0)
269
270 enum_map(RM_ELEM.t, F_MASKW0, [
271 ('e0', 'e0'),
272 ('e1', 'e1'),
273 ('e2', 'e2'),
274 ('e3', 'e3'),
275 ], pass_zero=['e0', 'e1', 'e2', 'e3'])
276
277 enum_map(OM_CND.t, F_PCND, [
278 ('always', 'always'),
279 ('p0_true', 'p0_true'),
280 ('never', 'never'),
281 ('p0_false', 'p0_false'),
282 ])
283
284 enum_map(OM_BRANCH_CND.t, F_BPRED, [
285 ('exec_cond', 'cc'),
286 ('allinst', 'allp'),
287 ('anyinst', 'anyp'),
288 ])
289
290 enum_map(OM_ATOM_OP.t, F_ATOMIC_OP, [
291 ('add', 'add'),
292 ('sub', 'sub'),
293 ('xchg', 'xchg'),
294 ('umin', 'umin'),
295 ('imin', 'imin'),
296 ('umax', 'umax'),
297 ('imax', 'imax'),
298 ('and', 'and'),
299 ('or', 'or'),
300 ('xor', 'xor'),
301 ])
302
303 enum_map(OM_FRED_TYPE.t, F_RED_TYPE, [
304 ('sin', 'sin'),
305 ('cos', 'cos'),
306 ])
307
308 enum_map(OM_FRED_PART.t, F_RED_PART, [
309 ('a', 'a'),
310 ('b', 'b'),
311 ])
312
313 enum_map(OM_DIM.t, F_DMN, [
314 ('1d', '1d'),
315 ('2d', '2d'),
316 ('3d', '3d'),
317 ])
318
319 enum_map(OM_LOD_MODE.t, F_LODM, [
320 ('normal', 'normal'),
321 ('bias', 'bias'),
322 ('replace', 'replace'),
323 ('gradients', 'gradients'),
324 ])
325
326 enum_map(OM_SB_MODE.t, F_SBMODE, [
327 ('none', 'none'),
328 ('rawdata', 'rawdata'),
329 ('coeffs', 'coeffs'),
330 ('both', 'both'),
331 ])
332
333 enum_map(OM_SCHEDSWAP.t, F_SCHED_CTRL, [
334 ('none', 'none'),
335 ('swap', 'swap'),
336 ])
337
338 enum_map(OM_MUTEX_OP.t, F_LR, [
339 ('release', 'release'),
340 ('release_sleep', 'release_sleep'),
341 ('release_wakeup', 'release_wakeup'),
342 ('lock', 'lock'),
343 ])
344
345 enum_map(OM_SAVMSK_MODE.t, F_MSK_MODE, [
346 ('vm', 'vm'),
347 ('icm', 'icm'),
348 ('icmoc', 'icmoc'),
349 ('icmi', 'icmi'),
350 ('caxy', 'caxy'),
351 ])
352
353 class OpRef(object):
354 def __init__(self, ref_type, index, mods):
355 self.type = ref_type
356 self.index = index
357 self.mods = mods
358
359 def SRC(index, mods=[]):
360 return OpRef('src', index, mods)
361
362 def DEST(index, mods=[]):
363 return OpRef('dest', index, mods)
364
365 encode_maps = {}
366 group_maps = {}
367
368 # Instruction encoding mapping.
369 class EncodeMap(object):
370 def __init__(self, name, cop_name, variants, op_ref_maps):
371 self.name = name
372 self.cop_name = cop_name
373 self.variants = variants
374 self.op_ref_maps = op_ref_maps
375
376 def encode_map(op, encodings, op_ref_maps):
377 assert op.bname not in encode_maps.keys(), f'Duplicate encode mapping for op "{op.name}".'
378
379 encode_variants = []
380 default_variant = encodings[0]
381 first_variant = encodings[1] if len(encodings) > 1 else None
382
383 for encoding_variant in encodings:
384 isa_op, isa_op_fields, *_ = encoding_variant
385
386 # Ensure we're speccing everything in the op fields.
387 assert set(isa_op.struct_fields.keys()) == set([field for field, val_spec in isa_op_fields]), f'Invalid field spec in isa op "{isa_op.bsname}" mapping for op "{op.name}".'
388
389 variant = isa_op.name.upper()
390 encode_variant = f'{isa_op.name}_encode({{0}}'
391
392 for isa_op_field, val_spec in isa_op_fields:
393 struct_field = isa_op.struct_fields[isa_op_field]
394 encode_variant += f', .{isa_op_field} = '
395 if isinstance(val_spec, bool):
396 encode_variant += str(val_spec).lower()
397 elif isinstance(val_spec, int):
398 encode_variant += str(val_spec)
399 elif isinstance(val_spec, str):
400 # Special case
401 if val_spec == 'target_cf_node':
402 assert op.has_target_cf_node
403
404 encode_variant += f'pco_branch_rel_offset({{1}}->parent_igrp, {{1}}->target_cf_node)'
405 elif val_spec == 'target_next_igrp':
406 encode_variant += f'pco_branch_rel_offset_next_igrp({{1}}->parent_igrp)'
407 else:
408 assert struct_field.type.base_type == BaseType.enum
409
410 enum = struct_field.type.enum
411 assert enum.parent is None
412 assert val_spec in enum.elems.keys(), f'Invalid enum element "{val_spec}" in field "{isa_op_field}" in isa op "{isa_op.bsname}" mapping for op "{op.name}".'
413
414 encode_variant += enum.elems[val_spec].cname
415 elif isinstance(val_spec, OpMod):
416 assert val_spec in op.op_mods, f'Op mod "{val_spec.t.tname}" was specified but not valid in isa op "{isa_op.bsname}" mapping for op "{op.name}".'
417
418 if struct_field.type.base_type == BaseType.enum:
419 enum_map_key = (val_spec.t, struct_field.type)
420 assert enum_map_key in enum_maps.keys(), f'Op mod enum "{val_spec.t.tname}" was specified but no mapping from enum "{struct_field.type.tname}" was found in mapping for op "{op.name}".'
421 enum_mapping = enum_maps[enum_map_key]
422 encode_variant += f'{enum_mapping.name}(pco_instr_get_mod({{1}}, {val_spec.cname}))'
423 else:
424 encode_variant += f'pco_instr_get_mod({{1}}, {val_spec.cname})'
425
426 elif isinstance(val_spec, tuple):
427 mod, _origin = val_spec
428 assert isinstance(_origin, OpRef)
429 assert not _origin.mods
430 origin = f'{_origin.type}[{_origin.index}]'
431
432 if isinstance(mod, RefMod):
433 # This is different from op mods, in that enum maps are *optional*.
434 assert (_origin.type == 'src' and mod in op.src_mods[_origin.index]) or (_origin.type == 'dest' and mod in op.dest_mods[_origin.index])
435
436 enum_map_key = (mod.t, struct_field.type)
437 if struct_field.type.base_type == BaseType.enum and enum_map_key in enum_maps.keys():
438 enum_mapping = enum_maps[enum_map_key]
439 encode_variant += f'{enum_mapping.name}({{1}}->{origin}.{mod.t.tname})'
440 else:
441 encode_variant += f'{{1}}->{origin}.{mod.t.tname}'
442 elif isinstance(mod, str):
443 encode_variant += f'{mod}({{1}}->{origin})'
444 else:
445 assert False
446 elif isinstance(val_spec, dict):
447 assert len(val_spec) == 1
448 _bin_op, mod_list = next(iter(val_spec.items()))
449
450 # No point doing a binop on a single item.
451 assert len(mod_list) > 1
452
453 # Only op mods supported for now.
454 assert all(isinstance(mod, OpMod) for mod in mod_list)
455 assert all(mod in op.op_mods for mod in mod_list)
456
457 # Make sure mods are all bools, can't do binops on other types.
458 assert all(mod.t.base_type == BaseType.bool for mod in mod_list)
459
460 if _bin_op == 'or':
461 bin_op = '||'
462 elif _bin_op == 'and':
463 bin_op = '&&'
464 else:
465 assert False
466
467 encode_variant += f' {bin_op} '.join([f'pco_instr_get_mod({{1}}, {mod.cname})' for mod in mod_list])
468 else:
469 assert False, f'Invalid value spec for field "{isa_op_field}" in isa op "{isa_op.bsname}" mapping for op "{op.name}".'
470 encode_variant += ')'
471
472 conds_variant = ''
473 if encoding_variant != default_variant:
474 conds_variant = 'if (' if encoding_variant == first_variant else 'else if ('
475
476 isa_op_conds = encoding_variant[2]
477 for i, isa_op_cond in enumerate(isa_op_conds):
478 if i > 0:
479 conds_variant += ' && '
480
481 if isinstance(isa_op_cond, tuple) and len(isa_op_cond) == 3:
482 mod, _origin, cond = isa_op_cond
483
484 assert isinstance(_origin, OpRef)
485 assert not _origin.mods
486 origin = f'{_origin.type}[{_origin.index}]'
487
488 assert isinstance(mod, RefMod)
489 assert (_origin.type == 'src' and mod in op.src_mods[_origin.index]) or (_origin.type == 'dest' and mod in op.dest_mods[_origin.index])
490 conds_variant += f'{{1}}->{origin}.{mod.t.tname} {cond}'
491 elif isinstance(isa_op_cond, tuple) and len(isa_op_cond) == 2:
492 if isinstance(isa_op_cond[0], OpMod):
493 mod, cond = isa_op_cond
494 assert mod in op.op_mods
495 conds_variant += f'pco_instr_get_mod({{1}}, {mod.cname}) {cond}'
496 elif isinstance(isa_op_cond[0], str):
497 mod, _origin = isa_op_cond
498 assert isinstance(_origin, OpRef)
499 assert not _origin.mods
500 origin = f'{_origin.type}[{_origin.index}]'
501 conds_variant += f'{mod}({{1}}->{origin})'
502 else:
503 assert False
504 else:
505 assert False
506 conds_variant += ')'
507
508 encode_variants.append((variant, encode_variant, conds_variant))
509
510 _op_ref_maps = []
511
512 for phase, dests, srcs in op_ref_maps:
513 assert phase in OP_PHASE.enum.elems.keys()
514 _phase = OP_PHASE.enum.elems[phase].cname
515
516 assert len(dests) == op.num_dests
517 assert all((isinstance(dest, str) and dest in REF_MAP.enum.elems.keys()) or \
518 (isinstance(dest, list) and _dest in REF_MAP.enum.elems.keys() for _dest in dest) \
519 for dest in dests)
520
521 _dests = []
522 for dest in dests:
523 if isinstance(dest, str):
524 _dests.append(f'(1U << {REF_MAP.enum.elems[dest].cname})')
525 elif isinstance(dest, list):
526 _dests.append(' | '.join(f'(1U << {REF_MAP.enum.elems[_dest].cname})' for _dest in dest))
527 else:
528 assert False
529
530 assert len(srcs) == op.num_srcs
531 assert all((isinstance(src, str) and src in REF_MAP.enum.elems.keys()) or \
532 (isinstance(src, list) and _src in REF_MAP.enum.elems.keys() for _src in src) \
533 for src in srcs)
534
535 _srcs = []
536 for src in srcs:
537 if isinstance(src, str):
538 _srcs.append(f'(1U << {REF_MAP.enum.elems[src].cname})')
539 elif isinstance(src, list):
540 _srcs.append(' | '.join(f'(1U << {REF_MAP.enum.elems[_src].cname})' for _src in src))
541 else:
542 assert False
543
544 _op_ref_maps.append((_phase, _dests, _srcs))
545
546 name = op.bname
547 cop_name = op.cname.upper()
548 encode_maps[name] = EncodeMap(name, cop_name, encode_variants, _op_ref_maps)
549
550 # Instruction group mapping.
551 class GroupMap(object):
552 def __init__(self, name, cop_name, mapping_sets, dest_intrn_map, src_intrn_map):
553 self.name = name
554 self.mapping_sets = mapping_sets
555 self.cop_name = cop_name
556 self.dest_intrn_map = dest_intrn_map
557 self.src_intrn_map = src_intrn_map
558
559 def group_map(op, hdr, enc_ops, srcs=[], iss=[], dests=[]):
560 assert op.bname not in group_maps.keys(), f'Duplicate group mapping for op "{op.name}".'
561 assert op.op_type != 'hw_direct', f'HW direct op "{op.name}" cannot have a group mapping.'
562
563 is_self = len(enc_ops) == 1 and enc_ops[0][1] == op
564
565 mapping_sets = []
566
567 hdr_variant, hdr_fields = hdr
568
569 # Ensure we're speccing everything in the header except length and da (need to be set later).
570 assert set(hdr_variant.struct_fields.keys()) == set([hdr_field for hdr_field, val_spec in hdr_fields] + ['length', 'da']), f'Invalid field spec in hdr mapping for op "{op.name}".'
571
572 # Add alutype setting after the check above, as it's actually a fixed value.
573 hdr_fields.append(('alutype', hdr_variant.bsname))
574
575 # Emit header mappings.
576 hdr_mappings = []
577 for hdr_field, val_spec in hdr_fields:
578 field = hdr_variant.bit_set.fields[hdr_field]
579 if isinstance(val_spec, bool):
580 value = str(val_spec).lower()
581 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {str(val_spec).lower()};')
582 elif isinstance(val_spec, int):
583 value = val_spec
584 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {val_spec};')
585 elif isinstance(val_spec, str):
586 assert field.field_type.base_type == BaseType.enum
587
588 enum = field.field_type.enum
589 assert enum.parent is None
590 assert val_spec in enum.elems.keys(), f'Invalid enum element "{val_spec}" in field "{hdr_field}" in hdr mapping for op "{op.name}".'
591
592 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {enum.elems[val_spec].cname};')
593 elif isinstance(val_spec, OpMod):
594 assert val_spec in op.op_mods, f'Op mod "{val_spec.t.tname}" was specified but not valid in hdr mapping for op "{op.name}".'
595
596 if field.field_type.base_type == BaseType.enum:
597 enum_map_key = (val_spec.t, field.field_type)
598 assert enum_map_key in enum_maps.keys(), f'Op mod enum "{val_spec.t.tname}" was specified but no mapping from enum "{field.field_type.tname}" was found in hdr mapping for op "{op.name}".'
599 enum_mapping = enum_maps[enum_map_key]
600 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {enum_mapping.name}(pco_instr_get_mod({{}}, {val_spec.cname}));')
601 else:
602 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = pco_instr_get_mod({{}}, {val_spec.cname});')
603
604 if val_spec.t.unset and is_self:
605 reset_val = 0 if val_spec.t.nzdefault is None else val_spec.t.nzdefault
606 hdr_mappings.append(f'pco_instr_set_mod({{1}}, {val_spec.cname}, {reset_val});')
607 elif isinstance(val_spec, tuple):
608 mod, _origin = val_spec
609 assert isinstance(_origin, OpRef)
610 assert not _origin.mods
611 origin = f'{_origin.type}[{_origin.index}]'
612 assert isinstance(mod, str) and isinstance(origin, str)
613 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {mod}({{}}->{origin});')
614 elif isinstance(val_spec, list):
615 assert field.field_type.base_type == BaseType.enum
616
617 enum = field.field_type.enum
618 assert enum.parent is None
619 assert enum.is_bitset
620
621 assert all(elem in enum.elems.keys() for elem in val_spec), f'Invalid enum element "{elem}" in field "{hdr_field}" in hdr mapping for op "{op.name}".'
622
623 val = ' | ' .join(enum.elems[elem].cname for elem in val_spec)
624 hdr_mappings.append(f'{{}}->hdr.{hdr_field} = {val};')
625 else:
626 assert False, f'Invalid value spec for field "{hdr_field}" in hdr mapping for op "{op.name}".'
627
628 assert bool(hdr_mappings)
629 mapping_sets.append(hdr_mappings);
630
631 # Emit instruction op mappings.
632 op_mappings = []
633 if is_self:
634 assert len(enc_ops[0]) == 2
635 _phase = enc_ops[0][0]
636 assert _phase in OP_PHASE.enum.elems.keys()
637 phase = OP_PHASE.enum.elems[_phase].cname
638
639 _enc_op = enc_ops[0][1]
640 assert _enc_op.bname in encode_maps.keys()
641 assert phase in [phase_map for phase_map, *_ in encode_maps[_enc_op.bname].op_ref_maps]
642
643 op_mappings.append(f'list_del(&{{1}}->link);')
644 op_mappings.append(f'{{}}->instrs[{phase}] = {{}};')
645 op_mappings.append(f'{{0}}->instrs[{phase}]->phase = {phase};')
646 op_mappings.append(f'{{0}}->instrs[{phase}]->parent_igrp = {{0}};')
647 op_mappings.append(f'ralloc_steal(igrp, {{1}});')
648 else:
649 for _phase, enc_op, *_enc_spec in enc_ops:
650 assert _phase in OP_PHASE.enum.elems.keys()
651 phase = OP_PHASE.enum.elems[_phase].cname
652
653 assert enc_op.bname in encode_maps.keys(), f'Op "{enc_op.name}" used in group mapping for "{op.name}" has no encode mapping defined.'
654 assert phase in [phase_map for phase_map, *_ in encode_maps[enc_op.bname].op_ref_maps]
655
656 enc_dests = _enc_spec[0] if len(_enc_spec) > 0 else []
657 enc_srcs = _enc_spec[1] if len(_enc_spec) > 1 else []
658 enc_op_mods = _enc_spec[2] if len(_enc_spec) > 2 else []
659
660 enc_mapping = f'{{0}}->instrs[{phase}] = {enc_op.bname}_({{1}}->parent_func'
661
662 for _ref in enc_dests + enc_srcs:
663 if _ref in IO.enum.elems.keys():
664 io = IO.enum.elems[_ref]
665 enc_mapping += f', pco_ref_io({io.cname})'
666 elif isinstance(_ref, OpRef):
667 origin = f'{{1}}->{_ref.type}[{_ref.index}]'
668
669 if _ref.type == 'src':
670 assert all(mod in enc_op.src_mods[_ref.index] for mod in _ref.mods)
671 else:
672 assert all(mod in enc_op.dest_mods[_ref.index] for mod in _ref.mods)
673
674 for mod in _ref.mods:
675 origin = f'pco_ref_{mod.t.tname}({origin})'
676
677 enc_mapping += f', {origin}'
678 elif isinstance(_ref, str):
679 if _ref == '_':
680 enc_mapping += ', pco_ref_null()'
681 else:
682 enc_mapping += f', {_ref}'
683 else:
684 assert False
685
686 for op_mod, _val in enc_op_mods:
687 assert isinstance(op_mod, OpMod)
688 assert op_mod in enc_op.op_mods
689
690 if isinstance(_val, str):
691 assert op_mod.t.base_type == BaseType.enum
692 enum = op_mod.t.enum
693 assert enum.parent is None
694 assert _val in enum.elems.keys()
695 val = enum.elems[_val].cname
696 elif isinstance(_val, bool):
697 assert op_mod.t.base_type == BaseType.bool
698 val = str(_val).lower()
699 elif isinstance(_val, int):
700 assert op_mod.t.base_type == BaseType.uint
701 val = str(_val)
702 elif isinstance(_val, OpMod):
703 assert op_mod in op.op_mods
704 val = f'pco_instr_get_mod({{1}}, {_val.cname})'
705 else:
706 assert False
707
708 enc_mapping += f', .{op_mod.t.tname} = {val}'
709
710 enc_mapping += ');'
711
712 op_mappings.append(enc_mapping)
713 op_mappings.append(f'{{0}}->instrs[{phase}]->phase = {phase};')
714 op_mappings.append(f'{{0}}->instrs[{phase}]->parent_igrp = {{0}};')
715
716 op_mappings.append(f'pco_instr_delete({{1}});')
717
718 assert bool(op_mappings)
719 mapping_sets.append(op_mappings);
720
721 # Emit source mappings.
722 src_mappings = []
723 for src, *_spec in srcs:
724
725 if len(_spec) == 2:
726 (_phase, val_spec), _io = _spec
727
728 assert _phase in OP_PHASE.enum.elems.keys()
729 phase = OP_PHASE.enum.elems[_phase].cname
730
731 assert isinstance(val_spec, OpRef)
732 assert not val_spec.mods
733 origin = f'{val_spec.type}[{val_spec.index}]'
734
735 assert _io in IO.enum.elems.keys()
736 io = IO.enum.elems[_io].cname
737
738 src_mappings.append(f'{{0}}->srcs.{src} = {{0}}->instrs[{phase}]->{origin};')
739 src_mappings.append(f'{{0}}->instrs[{phase}]->{origin} = pco_ref_io({io});')
740 src_mappings.append(f'pco_ref_xfer_mods(&{{0}}->instrs[{phase}]->{origin}, &{{0}}->srcs.{src}, true);')
741 elif len(_spec) == 1:
742 val = _spec[0]
743 assert isinstance(val, str)
744 src_mappings.append(f'{{0}}->srcs.{src} = {val};')
745 else:
746 assert False
747
748 if bool(src_mappings):
749 mapping_sets.append(src_mappings);
750
751 # Emit iss mappings.
752 iss_mappings = []
753 for iss, _io in iss:
754 if _io in IO.enum.elems.keys():
755 io = IO.enum.elems[_io].cname
756 else:
757 assert isinstance(_io, str)
758 io = _io
759
760 iss_mappings.append(f'{{}}->iss.{iss} = pco_ref_io({io});')
761
762 if bool(iss_mappings):
763 mapping_sets.append(iss_mappings);
764
765 # Emit destination mappings.
766 dest_mappings = []
767 for dest, (_phase, val_spec), _io in dests:
768 assert _phase in OP_PHASE.enum.elems.keys()
769 phase = OP_PHASE.enum.elems[_phase].cname
770
771 assert isinstance(val_spec, OpRef)
772 assert not val_spec.mods
773 origin = f'{val_spec.type}[{val_spec.index}]'
774
775 if _io in IO.enum.elems.keys():
776 io = IO.enum.elems[_io].cname
777 else:
778 assert isinstance(_io, str)
779 io = _io
780
781 dest_mappings.append(f'{{0}}->dests.{dest} = {{0}}->instrs[{phase}]->{origin};')
782 dest_mappings.append(f'{{0}}->instrs[{phase}]->{origin} = pco_ref_io({io});')
783 dest_mappings.append(f'pco_ref_xfer_mods(&{{0}}->instrs[{phase}]->{origin}, &{{0}}->dests.{dest}, true);')
784
785 if bool(dest_mappings):
786 mapping_sets.append(dest_mappings);
787
788 # Emit variant mappings.
789 variant_mappings = []
790 for _phase, enc_op, *_ in enc_ops:
791 assert _phase in OP_PHASE.enum.elems.keys()
792 phase = OP_PHASE.enum.elems[_phase].cname
793 variant_mappings.append(f'{{0}}->variant.instr[{phase}].{hdr_variant.bsname} = {enc_op.bname}_variant({{0}}->instrs[{phase}]);')
794
795 assert bool(variant_mappings)
796 mapping_sets.append(variant_mappings);
797
798 # Collect src/dest I/O
799 dest_intrn_map = []
800 src_intrn_map = []
801
802 for src, *_spec in srcs:
803 if len(_spec) != 2:
804 continue
805
806 (_phase, origin), _io = _spec
807 phase = OP_PHASE.enum.elems[_phase].cname
808 io = IO.enum.elems[_io]
809
810 if not io.string.startswith('s'):
811 continue
812
813 val = int(io.string[1:]) + 1
814
815 if is_self:
816 if origin.type == 'dest':
817 dest_intrn_map.append((origin.index, val))
818 else:
819 src_intrn_map.append((origin.index, val))
820 continue
821
822 origin_op = None
823 for enc_op in enc_ops:
824 if enc_op[0] != _phase:
825 continue
826
827 origin_op = enc_op
828 break
829 assert origin_op is not None
830
831 _enc_phase, enc_op, *_enc_spec = enc_op
832 enc_dests = _enc_spec[0] if len(_enc_spec) > 0 else []
833 enc_srcs = _enc_spec[1] if len(_enc_spec) > 1 else []
834
835 origin = enc_dests[origin.index] if origin.type == 'dest' else enc_srcs[origin.index]
836 if isinstance(origin, str):
837 continue
838 assert isinstance(origin, OpRef)
839
840 if origin.type == 'dest':
841 dest_intrn_map.append((origin.index, val))
842 else:
843 src_intrn_map.append((origin.index, val))
844
845 name = op.bname
846 cop_name = op.cname.upper()
847 group_maps[name] = GroupMap(name, cop_name, mapping_sets, dest_intrn_map, src_intrn_map)
848
849 # Encode mappings.
850 encode_map(O_FADD,
851 encodings=[
852 (I_FADD, [
853 ('sat', OM_SAT),
854 ('s0neg', (RM_NEG, SRC(0))),
855 ('s0abs', (RM_ABS, SRC(0))),
856 ('s1abs', (RM_ABS, SRC(1))),
857 ('s0flr', (RM_FLR, SRC(0)))
858 ])
859 ],
860 op_ref_maps=[
861 ('0', ['ft0'], ['s0', 's1']),
862 ('1', ['ft1'], ['s3', 's4'])
863 ]
864 )
865
866 encode_map(O_FMUL,
867 encodings=[
868 (I_FMUL, [
869 ('sat', OM_SAT),
870 ('s0neg', (RM_NEG, SRC(0))),
871 ('s0abs', (RM_ABS, SRC(0))),
872 ('s1abs', (RM_ABS, SRC(1))),
873 ('s0flr', (RM_FLR, SRC(0)))
874 ])
875 ],
876 op_ref_maps=[
877 ('0', ['ft0'], ['s0', 's1']),
878 ('1', ['ft1'], ['s3', 's4'])
879 ]
880 )
881
882 encode_map(O_FMAD,
883 encodings=[
884 (I_FMAD_EXT, [
885 ('s0neg', (RM_NEG, SRC(0))),
886 ('s0abs', (RM_ABS, SRC(0))),
887 ('s2neg', (RM_NEG, SRC(2))),
888 ('sat', OM_SAT),
889
890 ('lp', OM_LP),
891 ('s1abs', (RM_ABS, SRC(1))),
892 ('s1neg', (RM_NEG, SRC(1))),
893 ('s2flr', (RM_FLR, SRC(2))),
894 ('s2abs', (RM_ABS, SRC(2)))
895 ]),
896 (I_FMAD, [
897 ('s0neg', (RM_NEG, SRC(0))),
898 ('s0abs', (RM_ABS, SRC(0))),
899 ('s2neg', (RM_NEG, SRC(2))),
900 ('sat', OM_SAT)
901 ], [
902 (OM_LP, '== false'),
903 (RM_ABS, SRC(1), '== false'),
904 (RM_NEG, SRC(1), '== false'),
905 (RM_FLR, SRC(2), '== false'),
906 (RM_ABS, SRC(2), '== false')
907 ])
908 ],
909 op_ref_maps=[
910 ('0', ['ft0'], ['s0', 's1', 's2']),
911 ('1', ['ft1'], ['s3', 's4', 's5'])
912 ]
913 )
914
915 encode_map(O_FRCP,
916 encodings=[
917 (I_SNGL_EXT, [
918 ('sngl_op', 'rcp'),
919 ('s0neg', (RM_NEG, SRC(0))),
920 ('s0abs', (RM_ABS, SRC(0)))
921 ]),
922 (I_SNGL, [('sngl_op', 'rcp')], [
923 (RM_NEG, SRC(0), '== false'),
924 (RM_ABS, SRC(0), '== false')
925 ])
926 ],
927 op_ref_maps=[('0', ['w0'], ['s0'])]
928 )
929
930 encode_map(O_FRSQ,
931 encodings=[
932 (I_SNGL_EXT, [
933 ('sngl_op', 'rsq'),
934 ('s0neg', (RM_NEG, SRC(0))),
935 ('s0abs', (RM_ABS, SRC(0)))
936 ]),
937 (I_SNGL, [('sngl_op', 'rsq')], [
938 (RM_NEG, SRC(0), '== false'),
939 (RM_ABS, SRC(0), '== false')
940 ])
941 ],
942 op_ref_maps=[('0', ['w0'], ['s0'])]
943 )
944
945 encode_map(O_FLOG,
946 encodings=[
947 (I_SNGL_EXT, [
948 ('sngl_op', 'log'),
949 ('s0neg', (RM_NEG, SRC(0))),
950 ('s0abs', (RM_ABS, SRC(0)))
951 ]),
952 (I_SNGL, [('sngl_op', 'log')], [
953 (RM_NEG, SRC(0), '== false'),
954 (RM_ABS, SRC(0), '== false')
955 ])
956 ],
957 op_ref_maps=[('0', ['w0'], ['s0'])]
958 )
959
960 encode_map(O_FLOGCN,
961 encodings=[
962 (I_SNGL_EXT, [
963 ('sngl_op', 'logcn'),
964 ('s0neg', (RM_NEG, SRC(0))),
965 ('s0abs', (RM_ABS, SRC(0)))
966 ]),
967 (I_SNGL, [('sngl_op', 'logcn')], [
968 (RM_NEG, SRC(0), '== false'),
969 (RM_ABS, SRC(0), '== false')
970 ])
971 ],
972 op_ref_maps=[('0', ['w0'], ['s0'])]
973 )
974
975 encode_map(O_FEXP,
976 encodings=[
977 (I_SNGL_EXT, [
978 ('sngl_op', 'exp'),
979 ('s0neg', (RM_NEG, SRC(0))),
980 ('s0abs', (RM_ABS, SRC(0)))
981 ]),
982 (I_SNGL, [('sngl_op', 'exp')], [
983 (RM_NEG, SRC(0), '== false'),
984 (RM_ABS, SRC(0), '== false')
985 ])
986 ],
987 op_ref_maps=[('0', ['w0'], ['s0'])]
988 )
989
990 encode_map(O_FRED,
991 encodings=[
992 (I_FRED, [
993 ('red_part', OM_FRED_PART),
994 ('iter', ('pco_ref_get_imm', SRC(2))),
995 ('red_type', OM_FRED_TYPE),
996 ('pwen', ('!pco_ref_is_null', DEST(2))),
997 ('s0neg', (RM_NEG, SRC(0))),
998 ('s0abs', (RM_ABS, SRC(0)))
999 ])
1000 ],
1001 op_ref_maps=[('0', [['w0', '_'], ['w1', '_'], ['p0', '_']], ['s0', ['s3', '_'], 'imm'])]
1002 )
1003
1004 encode_map(O_FSINC,
1005 encodings=[
1006 (I_SNGL, [('sngl_op', 'sinc')], [
1007 (RM_NEG, SRC(0), '== false'),
1008 (RM_ABS, SRC(0), '== false')
1009 ])
1010 ],
1011 op_ref_maps=[('0', ['w0', 'p0'], ['s0'])]
1012 )
1013
1014 encode_map(O_MBYP,
1015 encodings=[
1016 (I_SNGL_EXT, [
1017 ('sngl_op', 'byp'),
1018 ('s0neg', (RM_NEG, SRC(0))),
1019 ('s0abs', (RM_ABS, SRC(0)))
1020 ]),
1021 (I_SNGL, [('sngl_op', 'byp')], [
1022 (RM_NEG, SRC(0), '== false'),
1023 (RM_ABS, SRC(0), '== false')
1024 ])
1025 ],
1026 op_ref_maps=[
1027 ('0', ['ft0'], ['s0']),
1028 ('1', ['ft1'], ['s3'])
1029 ]
1030 )
1031
1032 encode_map(O_FDSX,
1033 encodings=[
1034 (I_SNGL_EXT, [
1035 ('sngl_op', 'dsx'),
1036 ('s0neg', (RM_NEG, SRC(0))),
1037 ('s0abs', (RM_ABS, SRC(0)))
1038 ]),
1039 (I_SNGL, [('sngl_op', 'dsx')], [
1040 (RM_NEG, SRC(0), '== false'),
1041 (RM_ABS, SRC(0), '== false')
1042 ])
1043 ],
1044 op_ref_maps=[
1045 ('0', ['ft0'], ['s0']),
1046 ('1', ['ft1'], ['s3'])
1047 ]
1048 )
1049
1050 encode_map(O_FDSXF,
1051 encodings=[
1052 (I_SNGL_EXT, [
1053 ('sngl_op', 'dsxf'),
1054 ('s0neg', (RM_NEG, SRC(0))),
1055 ('s0abs', (RM_ABS, SRC(0)))
1056 ]),
1057 (I_SNGL, [('sngl_op', 'dsx')], [
1058 (RM_NEG, SRC(0), '== false'),
1059 (RM_ABS, SRC(0), '== false')
1060 ])
1061 ],
1062 op_ref_maps=[
1063 ('0', ['ft0'], ['s0']),
1064 ('1', ['ft1'], ['s3'])
1065 ]
1066 )
1067
1068 encode_map(O_FDSY,
1069 encodings=[
1070 (I_SNGL_EXT, [
1071 ('sngl_op', 'dsy'),
1072 ('s0neg', (RM_NEG, SRC(0))),
1073 ('s0abs', (RM_ABS, SRC(0)))
1074 ]),
1075 (I_SNGL, [('sngl_op', 'dsy')], [
1076 (RM_NEG, SRC(0), '== false'),
1077 (RM_ABS, SRC(0), '== false')
1078 ])
1079 ],
1080 op_ref_maps=[
1081 ('0', ['ft0'], ['s0']),
1082 ('1', ['ft1'], ['s3'])
1083 ]
1084 )
1085
1086 encode_map(O_FDSYF,
1087 encodings=[
1088 (I_SNGL_EXT, [
1089 ('sngl_op', 'dsyf'),
1090 ('s0neg', (RM_NEG, SRC(0))),
1091 ('s0abs', (RM_ABS, SRC(0)))
1092 ]),
1093 (I_SNGL, [('sngl_op', 'dsy')], [
1094 (RM_NEG, SRC(0), '== false'),
1095 (RM_ABS, SRC(0), '== false')
1096 ])
1097 ],
1098 op_ref_maps=[
1099 ('0', ['ft0'], ['s0']),
1100 ('1', ['ft1'], ['s3'])
1101 ]
1102 )
1103
1104 encode_map(O_PCK,
1105 encodings=[
1106 (I_PCK, [
1107 ('prog', False),
1108 ('rtz', OM_ROUNDZERO),
1109 ('scale', OM_SCALE),
1110 ('pck_format', OM_PCK_FMT)
1111 ])
1112 ],
1113 op_ref_maps=[('2_pck', ['ft2'], [['is3', '_']])]
1114 )
1115
1116 encode_map(O_PCK_PROG,
1117 encodings=[
1118 (I_PCK, [
1119 ('prog', True),
1120 ('rtz', OM_ROUNDZERO),
1121 ('scale', OM_SCALE),
1122 ('pck_format', 0)
1123 ])
1124 ],
1125 op_ref_maps=[('2_pck', ['ft2'], ['is3', 'fte'])]
1126 )
1127
1128 encode_map(O_UNPCK,
1129 encodings=[
1130 (I_UPCK, [
1131 ('elem', (RM_ELEM, SRC(0))),
1132 ('scale_rtz', {'or': [OM_SCALE, OM_ROUNDZERO]}),
1133 ('pck_format', OM_PCK_FMT)
1134 ])
1135 ],
1136 op_ref_maps=[('0', ['ft0'], ['s0'])]
1137 )
1138
1139 encode_map(O_TST,
1140 encodings=[
1141 (I_TST_EXT, [
1142 ('tst_op', OM_TST_OP_MAIN),
1143 ('pwen', ('!pco_ref_is_null', DEST(1))),
1144 ('type', OM_TST_TYPE_MAIN),
1145 ('p2end', OM_PHASE2END),
1146 ('elem', (RM_ELEM, SRC(0)))
1147 ]),
1148 (I_TST, [
1149 ('tst_op', OM_TST_OP_MAIN),
1150 ('pwen', ('!pco_ref_is_null', DEST(1))),
1151 ], [
1152 (OM_TST_OP_MAIN, '<= PCO_TST_OP_MAIN_NOTEQUAL'),
1153 (OM_TST_TYPE_MAIN, '== PCO_TST_TYPE_MAIN_F32'),
1154 (OM_PHASE2END, '== false'),
1155 (OM_TST_TYPE_MAIN, '== PCO_TST_TYPE_MAIN_F32'),
1156 (RM_ELEM, SRC(0), '== 0'),
1157 (RM_ELEM, SRC(1), '== 0'),
1158 ])
1159 ],
1160 op_ref_maps=[('2_tst', ['ftt', ['p0', '_']], [['is1', '_'], ['is2', '_']])]
1161 )
1162
1163 encode_map(O_MOVC,
1164 encodings=[
1165 (I_MOVC_EXT, [
1166 ('movw0', ('pco_ref_get_movw01', SRC(1))),
1167 ('movw1', ('pco_ref_get_movw01', SRC(3))),
1168 ('maskw0', (RM_ELEM, DEST(0))),
1169 ('aw', False),
1170 ('p2end', OM_PHASE2END)
1171 ]),
1172 (I_MOVC, [
1173 ('movw0', ('pco_ref_get_movw01', SRC(1))),
1174 ('movw1', ('pco_ref_get_movw01', SRC(3))),
1175 ], [
1176 (RM_ELEM, DEST(0), '== 0b1111'),
1177 (OM_PHASE2END, '== false'),
1178 ])
1179 ],
1180 op_ref_maps=[
1181 ('2_mov',
1182 [['w0', '_'], ['w1', '_']],
1183 ['ftt', ['_', 'ft0', 'ft1', 'ft2', 'fte'], ['_', 'is4'], ['_', 'ft0', 'ft1', 'ft2', 'fte'], ['_', 'is5']])
1184 ]
1185 )
1186
1187 encode_map(O_MOVWM,
1188 encodings=[
1189 (I_MOVC_EXT, [
1190 ('movw0', ('pco_ref_get_movw01', SRC(0))),
1191 ('movw1', 0),
1192 ('maskw0', (RM_ELEM, DEST(0))),
1193 ('aw', True),
1194 ('p2end', OM_PHASE2END)
1195 ])
1196 ],
1197 op_ref_maps=[('2_mov', ['w0'], [['_', 'ft0', 'ft1', 'ft2', 'fte'], 'is4'])]
1198 )
1199
1200 encode_map(O_ADD64_32,
1201 encodings=[
1202 (I_INT32_64_EXT, [
1203 ('s', OM_S),
1204 ('int32_64_op', 'add6432'),
1205 ('cin', ('!pco_ref_is_null', SRC(3))),
1206
1207 ('s0neg', (RM_NEG, SRC(0))),
1208 ('s0abs', (RM_ABS, SRC(0))),
1209 ('s1neg', False),
1210 ('s1abs', False),
1211 ('s2neg', (RM_NEG, SRC(2))),
1212 ('s2abs', (RM_ABS, SRC(2)))
1213 ]),
1214 (I_INT32_64, [
1215 ('s', OM_S),
1216 ('int32_64_op', 'add6432'),
1217 ('s2neg', (RM_NEG, SRC(2))),
1218 ], [
1219 ('pco_ref_is_null', SRC(3)),
1220 (RM_NEG, SRC(0), '== false'),
1221 (RM_ABS, SRC(0), '== false'),
1222 (RM_ABS, SRC(2), '== false')
1223 ])
1224 ],
1225 op_ref_maps=[('0', ['ft0', 'fte'], ['s0', 's1', 's2', ['_', 'p0']])]
1226 )
1227
1228 encode_map(O_IMADD64,
1229 encodings=[
1230 (I_INT32_64_EXT, [
1231 ('s', OM_S),
1232 ('int32_64_op', 'madd64'),
1233 ('cin', ('!pco_ref_is_null', SRC(4))),
1234
1235 ('s0neg', (RM_NEG, SRC(0))),
1236 ('s0abs', (RM_ABS, SRC(0))),
1237 ('s1neg', (RM_NEG, SRC(1))),
1238 ('s1abs', (RM_ABS, SRC(1))),
1239 ('s2neg', (RM_NEG, SRC(2))),
1240 ('s2abs', (RM_ABS, SRC(2)))
1241 ]),
1242 (I_INT32_64, [
1243 ('s', OM_S),
1244 ('int32_64_op', 'madd64'),
1245 ('s2neg', (RM_NEG, SRC(2))),
1246 ], [
1247 ('pco_ref_is_null', SRC(4)),
1248 (RM_NEG, SRC(0), '== false'),
1249 (RM_ABS, SRC(0), '== false'),
1250 (RM_NEG, SRC(1), '== false'),
1251 (RM_ABS, SRC(1), '== false'),
1252 (RM_ABS, SRC(2), '== false')
1253 ])
1254 ],
1255 op_ref_maps=[('0', [['ft0', '_'], ['fte', '_']], ['s0', 's1', 's2', 'is0', ['_', 'p0']])]
1256 )
1257
1258 encode_map(O_IMADD32,
1259 encodings=[
1260 (I_INT32_64_EXT, [
1261 ('s', OM_S),
1262 ('int32_64_op', 'madd32'),
1263 ('cin', ('!pco_ref_is_null', SRC(3))),
1264
1265 ('s0neg', (RM_NEG, SRC(0))),
1266 ('s0abs', (RM_ABS, SRC(0))),
1267 ('s1neg', (RM_NEG, SRC(1))),
1268 ('s1abs', (RM_ABS, SRC(1))),
1269 ('s2neg', (RM_NEG, SRC(2))),
1270 ('s2abs', (RM_ABS, SRC(2)))
1271 ]),
1272 (I_INT32_64, [
1273 ('s', OM_S),
1274 ('int32_64_op', 'madd32'),
1275 ('s2neg', (RM_NEG, SRC(2))),
1276 ], [
1277 ('pco_ref_is_null', SRC(3)),
1278 (RM_NEG, SRC(0), '== false'),
1279 (RM_ABS, SRC(0), '== false'),
1280 (RM_NEG, SRC(1), '== false'),
1281 (RM_ABS, SRC(1), '== false'),
1282 (RM_ABS, SRC(2), '== false'),
1283 ])
1284 ],
1285 op_ref_maps=[('0', ['ft0'], ['s0', 's1', 's2', ['_', 'p0']])]
1286 )
1287
1288 encode_map(O_UVSW_WRITE,
1289 encodings=[
1290 (I_UVSW_WRITE_IMM, [
1291 ('dsel', 'w0'),
1292 ('imm_addr', ('pco_ref_get_imm', SRC(1)))
1293 ])
1294 ],
1295 op_ref_maps=[('backend', [], ['w0', 'imm'])]
1296 )
1297
1298 encode_map(O_UVSW_EMIT, encodings=[(I_UVSW_EMIT, [])], op_ref_maps=[('backend', [], [])])
1299 encode_map(O_UVSW_ENDTASK, encodings=[(I_UVSW_ENDTASK, [])], op_ref_maps=[('backend', [], [])])
1300 encode_map(O_UVSW_EMIT_ENDTASK, encodings=[(I_UVSW_EMIT_ENDTASK, [])], op_ref_maps=[('backend', [], [])])
1301
1302 encode_map(O_UVSW_WRITE_EMIT_ENDTASK,
1303 encodings=[
1304 (I_UVSW_WRITE_EMIT_ENDTASK_IMM, [
1305 ('dsel', 'w0'),
1306 ('imm_addr', ('pco_ref_get_imm', SRC(1)))
1307 ])
1308 ],
1309 op_ref_maps=[('backend', [], ['w0', 'imm'])]
1310 )
1311
1312 encode_map(O_FITR,
1313 encodings=[
1314 (I_FITR, [
1315 ('p', False),
1316 ('drc', ('pco_ref_get_drc', SRC(0))),
1317 ('iter_mode', OM_ITR_MODE),
1318 ('sat', OM_SAT),
1319 ('count', ('pco_ref_get_imm', SRC(2)))
1320 ])
1321 ],
1322 op_ref_maps=[('backend', ['s3'], ['drc', 's0', 'imm'])]
1323 )
1324
1325 encode_map(O_FITRP,
1326 encodings=[
1327 (I_FITR, [
1328 ('p', True),
1329 ('drc', ('pco_ref_get_drc', SRC(0))),
1330 ('iter_mode', OM_ITR_MODE),
1331 ('sat', OM_SAT),
1332 ('count', ('pco_ref_get_imm', SRC(3)))
1333 ])
1334 ],
1335 op_ref_maps=[('backend', ['s3'], ['drc', 's0', 's2', 'imm'])]
1336 )
1337
1338 encode_map(O_LD,
1339 encodings=[
1340 (I_LD_IMMBL, [
1341 ('drc', ('pco_ref_get_drc', SRC(0))),
1342 ('burstlen', ('pco_ref_get_imm', SRC(1))),
1343
1344 ('srcseladd', ('pco_ref_srcsel', SRC(2))),
1345 ('cachemode_ld', OM_MCU_CACHE_MODE_LD)
1346 ])
1347 ],
1348 op_ref_maps=[('backend', ['s3'], ['drc', 'imm', ['s0', 's1', 's2', 's3', 's4', 's5']])]
1349 )
1350
1351 encode_map(O_LD_REGBL,
1352 encodings=[
1353 (I_LD_REGBL, [
1354 ('drc', ('pco_ref_get_drc', SRC(0))),
1355
1356 ('srcseladd', ('pco_ref_srcsel', SRC(2))),
1357 ('srcselbl', ('pco_ref_srcsel', SRC(1))),
1358 ('cachemode_ld', OM_MCU_CACHE_MODE_LD)
1359 ])
1360 ],
1361 op_ref_maps=[('backend', ['s3'], ['drc', ['s0', 's1', 's2', 's3', 's4', 's5'], ['s0', 's1', 's2', 's3', 's4', 's5']])]
1362 )
1363
1364 encode_map(O_ST,
1365 encodings=[
1366 (I_ST_IMMBL, [
1367 ('drc', ('pco_ref_get_drc', SRC(2))),
1368 ('srcseladd', ('pco_ref_srcsel', SRC(4))),
1369 ('burstlen', ('pco_ref_get_imm', SRC(3))),
1370 ('cachemode_st', OM_MCU_CACHE_MODE_ST),
1371 ('srcseldata', ('pco_ref_srcsel', SRC(0))),
1372 ('dsize', ('pco_ref_get_imm', SRC(1)))
1373 ])
1374 ],
1375 op_ref_maps=[('backend', [], [['s0', 's1', 's2', 's3', 's4', 's5'], 'imm', 'drc', 'imm', ['s0', 's1', 's2', 's3', 's4', 's5'], ['s0', 's1', 's2', 's3', 's4', 's5', '_']])]
1376 )
1377
1378 encode_map(O_ST_REGBL,
1379 encodings=[
1380 (I_ST_REGBL, [
1381 ('drc', ('pco_ref_get_drc', SRC(2))),
1382 ('srcseladd', ('pco_ref_srcsel', SRC(4))),
1383 ('srcselbl', ('pco_ref_srcsel', SRC(3))),
1384 ('cachemode_st', OM_MCU_CACHE_MODE_ST),
1385 ('srcseldata', ('pco_ref_srcsel', SRC(0))),
1386 ('dsize', ('pco_ref_get_imm', SRC(1)))
1387 ])
1388 ],
1389 op_ref_maps=[('backend', [], [['s0', 's1', 's2', 's3', 's4', 's5'], 'imm', 'drc', ['s0', 's1', 's2', 's3', 's4', 's5'], ['s0', 's1', 's2', 's3', 's4', 's5'], ['s0', 's1', 's2', 's3', 's4', 's5', '_']])]
1390 )
1391
1392 encode_map(O_ST_TILED,
1393 encodings=[
1394 (I_ST_IMMBL_TILED, [
1395 ('drc', ('pco_ref_get_drc', SRC(2))),
1396 ('srcseladd', ('pco_ref_srcsel', SRC(4))),
1397 ('burstlen', ('pco_ref_get_imm', SRC(3))),
1398 ('cachemode_st', OM_MCU_CACHE_MODE_ST),
1399 ('srcseldata', ('pco_ref_srcsel', SRC(0))),
1400 ('dsize', ('pco_ref_get_imm', SRC(1))),
1401 ('srcmask', ('pco_ref_srcsel', SRC(5)))
1402 ])
1403 ],
1404 op_ref_maps=[('backend', [], [['s0', 's1', 's2', 's3', 's4', 's5'], 'imm', 'drc', 'imm', ['s0', 's1', 's2', 's3', 's4', 's5'], ['s0', 's1', 's2', 's3', 's4', 's5', '_']])]
1405 )
1406
1407 encode_map(O_IDF,
1408 encodings=[
1409 (I_IDF, [
1410 ('drc', ('pco_ref_get_drc', SRC(0))),
1411 ('srcseladd', ('pco_ref_srcsel', SRC(1)))
1412 ])
1413 ],
1414 op_ref_maps=[('backend', [], ['drc', ['s0', 's1', 's2', 's3', 's4', 's5']])]
1415 )
1416
1417 encode_map(O_ATOMIC,
1418 encodings=[
1419 (I_ATOMIC, [
1420 ('drc', ('pco_ref_get_drc', SRC(0))),
1421 ('atomic_op', OM_ATOM_OP),
1422 ('srcsel', ('pco_ref_srcsel', SRC(1))),
1423 ('dstsel', ('pco_ref_srcsel', DEST(0)))
1424 ])
1425 ],
1426 op_ref_maps=[('backend', [['s0', 's1', 's2', 's3', 's4', 's5']], ['drc', ['s0', 's1', 's2', 's3', 's4', 's5']])]
1427 )
1428
1429 encode_map(O_SMP,
1430 encodings=[
1431 (I_SMP_EXTABC, [
1432 ('fcnorm', OM_FCNORM),
1433 ('drc', ('pco_ref_get_drc', SRC(0))),
1434 ('dmn', OM_DIM),
1435 ('chan', ('pco_ref_get_imm', SRC(5))),
1436 ('lodm', OM_LOD_MODE),
1437 ('pplod', OM_PPLOD),
1438 ('proj', OM_PROJ),
1439 ('sbmode', OM_SB_MODE),
1440 ('nncoords', OM_NNCOORDS),
1441 ('sno', OM_SNO),
1442 ('soo', OM_SOO),
1443 ('tao', OM_TAO),
1444 ('f16', OM_F16),
1445 ('swap', OM_SCHEDSWAP),
1446 ('cachemode_ld', OM_MCU_CACHE_MODE_LD),
1447 ('w', OM_WRT),
1448 ('integer', OM_INTEGER),
1449 ('array', OM_ARRAY),
1450 ]),
1451 (I_SMP_EXTAB, [
1452 ('fcnorm', OM_FCNORM),
1453 ('drc', ('pco_ref_get_drc', SRC(0))),
1454 ('dmn', OM_DIM),
1455 ('chan', ('pco_ref_get_imm', SRC(5))),
1456 ('lodm', OM_LOD_MODE),
1457 ('pplod', OM_PPLOD),
1458 ('proj', OM_PROJ),
1459 ('sbmode', OM_SB_MODE),
1460 ('nncoords', OM_NNCOORDS),
1461 ('sno', OM_SNO),
1462 ('soo', OM_SOO),
1463 ('tao', OM_TAO),
1464 ('f16', OM_F16),
1465 ('swap', OM_SCHEDSWAP),
1466 ('cachemode_ld', OM_MCU_CACHE_MODE_LD),
1467 ('w', OM_WRT)
1468 ], [
1469 (OM_INTEGER, '== false'),
1470 (OM_ARRAY, '== false')
1471 ]),
1472 (I_SMP_EXTA, [
1473 ('fcnorm', OM_FCNORM),
1474 ('drc', ('pco_ref_get_drc', SRC(0))),
1475 ('dmn', OM_DIM),
1476 ('chan', ('pco_ref_get_imm', SRC(5))),
1477 ('lodm', OM_LOD_MODE),
1478 ('pplod', OM_PPLOD),
1479 ('proj', OM_PROJ),
1480 ('sbmode', OM_SB_MODE),
1481 ('nncoords', OM_NNCOORDS),
1482 ('sno', OM_SNO),
1483 ('soo', OM_SOO),
1484 ('tao', OM_TAO)
1485 ], [
1486 (OM_INTEGER, '== false'),
1487 (OM_ARRAY, '== false'),
1488 (OM_F16, '== false'),
1489 (OM_SCHEDSWAP, '== PCO_SCHEDSWAP_NONE'),
1490 (OM_MCU_CACHE_MODE_LD, '== PCO_CACHEMODE_LD_NORMAL'),
1491 (OM_WRT, '== false')
1492 ]),
1493 (I_SMP_BRIEF, [
1494 ('fcnorm', OM_FCNORM),
1495 ('drc', ('pco_ref_get_drc', SRC(0))),
1496 ('dmn', OM_DIM),
1497 ('chan', ('pco_ref_get_imm', SRC(5))),
1498 ('lodm', OM_LOD_MODE)
1499 ], [
1500 (OM_INTEGER, '== false'),
1501 (OM_ARRAY, '== false'),
1502 (OM_F16, '== false'),
1503 (OM_SCHEDSWAP, '== PCO_SCHEDSWAP_NONE'),
1504 (OM_MCU_CACHE_MODE_LD, '== PCO_CACHEMODE_LD_NORMAL'),
1505 (OM_WRT, '== false'),
1506 (OM_PPLOD, '== false'),
1507 (OM_PROJ, '== false'),
1508 (OM_SB_MODE, '== PCO_SB_MODE_NONE'),
1509 (OM_NNCOORDS, '== false'),
1510 (OM_SNO, '== false'),
1511 (OM_SOO, '== false'),
1512 (OM_TAO, '== false')
1513 ])
1514 ],
1515 op_ref_maps=[('backend', ['s4'], ['drc', 's0', 's1', 's2', ['s3', '_'], 'imm'])]
1516 )
1517
1518 encode_map(O_ALPHATST,
1519 encodings=[
1520 (I_VISTEST_ATST, [
1521 ('pwen', ('!pco_ref_is_null', DEST(0))),
1522 ('ifb', True)
1523 ])
1524 ],
1525 op_ref_maps=[('backend', [['p0', '_']], ['drc', 's0', 's1', 's2'])]
1526 )
1527
1528 encode_map(O_ALPHAF,
1529 encodings=[
1530 (I_VISTEST_ATST, [
1531 ('pwen', ('!pco_ref_is_null', DEST(0))),
1532 ('ifb', False)
1533 ])
1534 ],
1535 op_ref_maps=[('backend', [['p0', '_']], ['drc', 's0', 's1', 's2'])]
1536 )
1537
1538 encode_map(O_DEPTHF,
1539 encodings=[(I_VISTEST_DEPTHF, [])],
1540 op_ref_maps=[('backend', [], ['drc', 'w0'])]
1541 )
1542
1543 encode_map(O_SAVMSK,
1544 encodings=[(I_SAVMSK, [('msk_mode', OM_SAVMSK_MODE)])],
1545 op_ref_maps=[('backend', [['w0', '_'], ['w1', '_']], [])]
1546 )
1547
1548 encode_map(O_EMITPIX,
1549 encodings=[(I_EMITPIX, [('freep', OM_FREEP)])],
1550 op_ref_maps=[('backend', [], ['s0', 's2'])]
1551 )
1552
1553 encode_map(O_BBYP0BM,
1554 encodings=[
1555 (I_PHASE0_SRC, [
1556 ('count_src', 's2'),
1557 ('count_op', 'byp'),
1558 ('bitmask_src_op', 'byp'),
1559 ('shift1_op', 'byp')
1560 ])
1561 ],
1562 op_ref_maps=[('0', ['ft0', 'ft1'], ['s0', 's1'])]
1563 )
1564
1565 encode_map(O_BBYP0BM_IMM32,
1566 encodings=[
1567 (I_PHASE0_IMM32, [
1568 ('count_src', 's2'),
1569 ('count_op', 'byp'),
1570 ('shift1_op', 'byp'),
1571 ('imm32', ('pco_ref_get_imm', SRC(1)))
1572 ])
1573 ],
1574 op_ref_maps=[('0', ['ft0', 'ft1'], ['s0', 'imm'])]
1575 )
1576
1577 encode_map(O_BBYP0S1,
1578 encodings=[
1579 (I_PHASE0_SRC, [
1580 ('count_src', 's2'),
1581 ('count_op', 'byp'),
1582 ('bitmask_src_op', 'byp'),
1583 ('shift1_op', 'byp')
1584 ])
1585 ],
1586 op_ref_maps=[('0', ['ft2', 'ft3'], ['s2'])]
1587 )
1588
1589 encode_map(O_MSK_BBYP0S1,
1590 encodings=[
1591 (I_PHASE0_SRC, [
1592 ('count_src', 's2'),
1593 ('count_op', 'byp'),
1594 ('bitmask_src_op', 'msk'),
1595 ('shift1_op', 'byp')
1596 ])
1597 ],
1598 op_ref_maps=[('0', ['ft0', 'ft1', 'ft2'], ['s0', 's1', 's2'])]
1599 )
1600
1601 encode_map(O_MSK_LSL,
1602 encodings=[
1603 (I_PHASE0_SRC, [
1604 ('count_src', 's2'),
1605 ('count_op', 'byp'),
1606 ('bitmask_src_op', 'msk'),
1607 ('shift1_op', 'lsl')
1608 ])
1609 ],
1610 op_ref_maps=[('0', ['ft0', 'ft1', 'ft2'], ['s0', 's1', 's2'])]
1611 )
1612
1613 encode_map(O_CBS,
1614 encodings=[
1615 (I_PHASE0_SRC, [
1616 ('count_src', ('pco_ref_count_src', SRC(0))),
1617 ('count_op', 'cbs'),
1618 ('bitmask_src_op', 'byp'),
1619 ('shift1_op', 'byp')
1620 ])
1621 ],
1622 op_ref_maps=[('0', ['ft3'], [['s2', 'ft2']])]
1623 )
1624
1625 encode_map(O_FTB,
1626 encodings=[
1627 (I_PHASE0_SRC, [
1628 ('count_src', ('pco_ref_count_src', SRC(0))),
1629 ('count_op', 'ftb'),
1630 ('bitmask_src_op', 'byp'),
1631 ('shift1_op', 'byp')
1632 ])
1633 ],
1634 op_ref_maps=[('0', ['ft3'], [['s2', 'ft2']])]
1635 )
1636
1637 encode_map(O_REV,
1638 encodings=[
1639 (I_PHASE0_SRC, [
1640 ('count_src', 'ft2'),
1641 ('count_op', 'byp'),
1642 ('bitmask_src_op', 'byp'),
1643 ('shift1_op', 'rev')
1644 ])
1645 ],
1646 op_ref_maps=[('0', ['ft2'], ['s2'])]
1647 )
1648
1649 encode_map(O_SHUFFLE,
1650 encodings=[
1651 (I_PHASE0_SRC, [
1652 ('count_src', 'ft2'),
1653 ('count_op', 'byp'),
1654 ('bitmask_src_op', 'byp'),
1655 ('shift1_op', 'shfl')
1656 ])
1657 ],
1658 op_ref_maps=[('0', ['ft2'], ['s2', 's1'])]
1659 )
1660
1661 encode_map(O_LOGICAL,
1662 encodings=[
1663 (I_PHASE1, [
1664 ('mskb', ('!pco_ref_is_null', SRC(2))),
1665 ('mska', ('!pco_ref_is_null', SRC(0))),
1666 ('logical_op', OM_LOGIOP),
1667 ])
1668 ],
1669 op_ref_maps=[('1', ['ft4'], [['ft1', '_'], 'ft2', ['ft1_invert', '_'], 's3'])]
1670 )
1671
1672 encode_map(O_SHIFT,
1673 encodings=[
1674 (I_PHASE2, [
1675 ('pwen', False),
1676 ('tst_src', 0),
1677 ('bw_tst_op', 0),
1678 ('shift2_op', OM_SHIFTOP),
1679 ])
1680 ],
1681 op_ref_maps=[('2', ['ft5'], ['ft4', 's4', ['_', 'ft0', 'ft3']])]
1682 )
1683
1684 encode_map(O_WOP, encodings=[(I_WOP, [])], op_ref_maps=[('ctrl', [], [])])
1685 encode_map(O_WDF, encodings=[(I_WDF, [])], op_ref_maps=[('ctrl', [], ['drc'])])
1686 encode_map(O_NOP, encodings=[(I_NOP, [])], op_ref_maps=[('ctrl', [], [])])
1687
1688 encode_map(O_DITR,
1689 encodings=[
1690 (I_DITR, [
1691 ('dest', ('pco_ref_get_temp', DEST(0))),
1692
1693 ('coff', ('pco_ref_get_coeff', SRC(1))),
1694 ('p', 'none'),
1695
1696 ('woff', 0),
1697 ('mode', OM_ITR_MODE),
1698
1699 ('count', ('pco_ref_get_imm', SRC(2))),
1700 ('coff_idx_ctrl', ('pco_ref_get_reg_idx_ctrl', SRC(1))),
1701 ('woff_idx_ctrl', 'none'),
1702
1703 ('f16', OM_F16),
1704 ('sched_ctrl', OM_SCHED),
1705 ('drc', ('pco_ref_get_drc', SRC(0))),
1706 ('sat', OM_SAT)
1707 ])
1708 ],
1709 op_ref_maps=[('ctrl', ['temp'], ['drc', 'coeff', 'imm'])]
1710 )
1711
1712 encode_map(O_DITRP,
1713 encodings=[
1714 (I_DITR, [
1715 ('dest', ('pco_ref_get_temp', DEST(0))),
1716
1717 ('coff', ('pco_ref_get_coeff', SRC(1))),
1718 ('p', 'iter_mul'),
1719
1720 ('woff', ('pco_ref_get_coeff', SRC(2))),
1721 ('mode', OM_ITR_MODE),
1722
1723 ('count', ('pco_ref_get_imm', SRC(3))),
1724 ('coff_idx_ctrl', ('pco_ref_get_reg_idx_ctrl', SRC(1))),
1725 ('woff_idx_ctrl', ('pco_ref_get_reg_idx_ctrl', SRC(2))),
1726
1727 ('f16', OM_F16),
1728 ('sched_ctrl', OM_SCHED),
1729 ('drc', ('pco_ref_get_drc', SRC(0))),
1730 ('sat', OM_SAT)
1731 ])
1732 ],
1733 op_ref_maps=[('ctrl', ['temp'], ['drc', 'coeff', 'coeff', 'imm'])]
1734 )
1735
1736 encode_map(O_CNDST,
1737 encodings=[
1738 (I_CND, [
1739 ('adjust', ('pco_ref_get_imm', SRC(1))),
1740 ('pcnd', OM_CND),
1741 ('cndinst', 'st')
1742 ])
1743 ],
1744 op_ref_maps=[('ctrl', ['pe', 'w0'], ['s0', 'imm'])]
1745 )
1746
1747 encode_map(O_CNDEF,
1748 encodings=[
1749 (I_CND, [
1750 ('adjust', ('pco_ref_get_imm', SRC(1))),
1751 ('pcnd', OM_CND),
1752 ('cndinst', 'ef')
1753 ])
1754 ],
1755 op_ref_maps=[('ctrl', ['pe', 'w0'], ['s0', 'imm'])]
1756 )
1757
1758 encode_map(O_CNDSM,
1759 encodings=[
1760 (I_CND, [
1761 ('adjust', 0),
1762 ('pcnd', OM_CND),
1763 ('cndinst', 'sm')
1764 ])
1765 ],
1766 op_ref_maps=[('ctrl', ['pe', 'w0'], ['s0', 's2'])]
1767 )
1768
1769 encode_map(O_CNDLT,
1770 encodings=[
1771 (I_CND, [
1772 ('adjust', ('pco_ref_get_imm', SRC(1))),
1773 ('pcnd', OM_CND),
1774 ('cndinst', 'lt')
1775 ])
1776 ],
1777 op_ref_maps=[('ctrl', ['pe', 'w0', 'p0'], ['s0', 'imm'])]
1778 )
1779
1780 encode_map(O_CNDEND,
1781 encodings=[
1782 (I_CND, [
1783 ('adjust', ('pco_ref_get_imm', SRC(1))),
1784 ('pcnd', 0),
1785 ('cndinst', 'end')
1786 ])
1787 ],
1788 op_ref_maps=[('ctrl', ['pe', 'w0'], ['s0', 'imm'])]
1789 )
1790
1791 encode_map(O_BR,
1792 encodings=[
1793 (I_BRANCH, [
1794 ('link', OM_LINK),
1795 ('bpred', OM_BRANCH_CND),
1796 ('abs', False),
1797 ('offset', 'target_cf_node')
1798 ])
1799 ],
1800 op_ref_maps=[('ctrl', [], [])]
1801 )
1802
1803 encode_map(O_BR_NEXT,
1804 encodings=[
1805 (I_BRANCH, [
1806 ('link', False),
1807 ('bpred', 'cc'),
1808 ('abs', False),
1809 ('offset', 'target_next_igrp')
1810 ])
1811 ],
1812 op_ref_maps=[('ctrl', [], [])]
1813 )
1814
1815 encode_map(O_MUTEX,
1816 encodings=[
1817 (I_MUTEX, [
1818 ('lr', OM_MUTEX_OP),
1819 ('id', ('pco_ref_get_imm', SRC(0))),
1820 ])
1821 ],
1822 op_ref_maps=[('ctrl', [], ['imm'])]
1823 )
1824
1825 # Group mappings.
1826 group_map(O_FADD,
1827 hdr=(I_IGRP_HDR_MAIN, [
1828 ('oporg', 'p0'),
1829 ('olchk', OM_OLCHK),
1830 ('w1p', False),
1831 ('w0p', True),
1832 ('cc', OM_EXEC_CND),
1833 ('end', OM_END),
1834 ('atom', OM_ATOM),
1835 ('rpt', OM_RPT)
1836 ]),
1837 enc_ops=[('0', O_FADD)],
1838 srcs=[
1839 ('s[0]', ('0', SRC(0)), 's0'),
1840 ('s[1]', ('0', SRC(1)), 's1')
1841 ],
1842 iss=[('is[4]', 'ft0')],
1843 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
1844 )
1845
1846 group_map(O_FMUL,
1847 hdr=(I_IGRP_HDR_MAIN, [
1848 ('oporg', 'p0'),
1849 ('olchk', OM_OLCHK),
1850 ('w1p', False),
1851 ('w0p', True),
1852 ('cc', OM_EXEC_CND),
1853 ('end', OM_END),
1854 ('atom', OM_ATOM),
1855 ('rpt', OM_RPT)
1856 ]),
1857 enc_ops=[('0', O_FMUL)],
1858 srcs=[
1859 ('s[0]', ('0', SRC(0)), 's0'),
1860 ('s[1]', ('0', SRC(1)), 's1')
1861 ],
1862 iss=[('is[4]', 'ft0')],
1863 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
1864 )
1865
1866 group_map(O_FMAD,
1867 hdr=(I_IGRP_HDR_MAIN, [
1868 ('oporg', 'p0'),
1869 ('olchk', OM_OLCHK),
1870 ('w1p', False),
1871 ('w0p', True),
1872 ('cc', OM_EXEC_CND),
1873 ('end', OM_END),
1874 ('atom', OM_ATOM),
1875 ('rpt', OM_RPT)
1876 ]),
1877 enc_ops=[('0', O_FMAD)],
1878 srcs=[
1879 ('s[0]', ('0', SRC(0)), 's0'),
1880 ('s[1]', ('0', SRC(1)), 's1'),
1881 ('s[2]', ('0', SRC(2)), 's2')
1882 ],
1883 iss=[('is[4]', 'ft0')],
1884 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
1885 )
1886
1887 group_map(O_FRCP,
1888 hdr=(I_IGRP_HDR_MAIN, [
1889 ('oporg', 'p0'),
1890 ('olchk', OM_OLCHK),
1891 ('w1p', False),
1892 ('w0p', True),
1893 ('cc', OM_EXEC_CND),
1894 ('end', OM_END),
1895 ('atom', OM_ATOM),
1896 ('rpt', OM_RPT)
1897 ]),
1898 enc_ops=[('0', O_FRCP)],
1899 srcs=[('s[0]', ('0', SRC(0)), 's0')],
1900 dests=[('w[0]', ('0', DEST(0)), 'w0')]
1901 )
1902
1903 group_map(O_FRSQ,
1904 hdr=(I_IGRP_HDR_MAIN, [
1905 ('oporg', 'p0'),
1906 ('olchk', OM_OLCHK),
1907 ('w1p', False),
1908 ('w0p', True),
1909 ('cc', OM_EXEC_CND),
1910 ('end', OM_END),
1911 ('atom', OM_ATOM),
1912 ('rpt', OM_RPT)
1913 ]),
1914 enc_ops=[('0', O_FRSQ)],
1915 srcs=[('s[0]', ('0', SRC(0)), 's0')],
1916 dests=[('w[0]', ('0', DEST(0)), 'w0')]
1917 )
1918
1919 group_map(O_FLOG,
1920 hdr=(I_IGRP_HDR_MAIN, [
1921 ('oporg', 'p0'),
1922 ('olchk', OM_OLCHK),
1923 ('w1p', False),
1924 ('w0p', True),
1925 ('cc', OM_EXEC_CND),
1926 ('end', OM_END),
1927 ('atom', OM_ATOM),
1928 ('rpt', OM_RPT)
1929 ]),
1930 enc_ops=[('0', O_FLOG)],
1931 srcs=[('s[0]', ('0', SRC(0)), 's0')],
1932 dests=[('w[0]', ('0', DEST(0)), 'w0')]
1933 )
1934
1935 group_map(O_FLOGCN,
1936 hdr=(I_IGRP_HDR_MAIN, [
1937 ('oporg', 'p0'),
1938 ('olchk', OM_OLCHK),
1939 ('w1p', False),
1940 ('w0p', True),
1941 ('cc', OM_EXEC_CND),
1942 ('end', OM_END),
1943 ('atom', OM_ATOM),
1944 ('rpt', OM_RPT)
1945 ]),
1946 enc_ops=[('0', O_FLOGCN)],
1947 srcs=[('s[0]', ('0', SRC(0)), 's0')],
1948 dests=[('w[0]', ('0', DEST(0)), 'w0')]
1949 )
1950
1951 group_map(O_FEXP,
1952 hdr=(I_IGRP_HDR_MAIN, [
1953 ('oporg', 'p0'),
1954 ('olchk', OM_OLCHK),
1955 ('w1p', False),
1956 ('w0p', True),
1957 ('cc', OM_EXEC_CND),
1958 ('end', OM_END),
1959 ('atom', OM_ATOM),
1960 ('rpt', OM_RPT)
1961 ]),
1962 enc_ops=[('0', O_FEXP)],
1963 srcs=[('s[0]', ('0', SRC(0)), 's0')],
1964 dests=[('w[0]', ('0', DEST(0)), 'w0')]
1965 )
1966
1967 group_map(O_FRED,
1968 hdr=(I_IGRP_HDR_MAIN, [
1969 ('oporg', 'p0'),
1970 ('olchk', OM_OLCHK),
1971 ('w1p', ('!pco_ref_is_null', DEST(1))),
1972 ('w0p', ('!pco_ref_is_null', DEST(0))),
1973 ('cc', OM_EXEC_CND),
1974 ('end', OM_END),
1975 ('atom', OM_ATOM),
1976 ('rpt', OM_RPT)
1977 ]),
1978 enc_ops=[('0', O_FRED)],
1979 srcs=[
1980 ('s[0]', ('0', SRC(0)), 's0'),
1981 ('s[3]', ('0', SRC(1)), 's3')
1982 ],
1983 dests=[
1984 ('w[0]', ('0', DEST(0)), 'w0'),
1985 ('w[1]', ('0', DEST(1)), 'w1')
1986 ]
1987 )
1988
1989 group_map(O_FSINC,
1990 hdr=(I_IGRP_HDR_MAIN, [
1991 ('oporg', 'p0'),
1992 ('olchk', OM_OLCHK),
1993 ('w1p', False),
1994 ('w0p', True),
1995 ('cc', OM_EXEC_CND),
1996 ('end', OM_END),
1997 ('atom', OM_ATOM),
1998 ('rpt', OM_RPT)
1999 ]),
2000 enc_ops=[('0', O_FSINC)],
2001 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2002 dests=[('w[0]', ('0', DEST(0)), 'w0')]
2003 )
2004
2005 group_map(O_MBYP,
2006 hdr=(I_IGRP_HDR_MAIN, [
2007 ('oporg', 'p0'),
2008 ('olchk', OM_OLCHK),
2009 ('w1p', False),
2010 ('w0p', True),
2011 ('cc', OM_EXEC_CND),
2012 ('end', OM_END),
2013 ('atom', OM_ATOM),
2014 ('rpt', OM_RPT)
2015 ]),
2016 enc_ops=[('0', O_MBYP)],
2017 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2018 iss=[('is[4]', 'ft0')],
2019 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2020 )
2021
2022 group_map(O_FDSX,
2023 hdr=(I_IGRP_HDR_MAIN, [
2024 ('oporg', 'p0'),
2025 ('olchk', OM_OLCHK),
2026 ('w1p', False),
2027 ('w0p', True),
2028 ('cc', OM_EXEC_CND),
2029 ('end', OM_END),
2030 ('atom', OM_ATOM),
2031 ('rpt', OM_RPT)
2032 ]),
2033 enc_ops=[('0', O_FDSX)],
2034 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2035 iss=[('is[4]', 'ft0')],
2036 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2037 )
2038
2039 group_map(O_FDSXF,
2040 hdr=(I_IGRP_HDR_MAIN, [
2041 ('oporg', 'p0'),
2042 ('olchk', OM_OLCHK),
2043 ('w1p', False),
2044 ('w0p', True),
2045 ('cc', OM_EXEC_CND),
2046 ('end', OM_END),
2047 ('atom', OM_ATOM),
2048 ('rpt', OM_RPT)
2049 ]),
2050 enc_ops=[('0', O_FDSXF)],
2051 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2052 iss=[('is[4]', 'ft0')],
2053 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2054 )
2055
2056 group_map(O_FDSY,
2057 hdr=(I_IGRP_HDR_MAIN, [
2058 ('oporg', 'p0'),
2059 ('olchk', OM_OLCHK),
2060 ('w1p', False),
2061 ('w0p', True),
2062 ('cc', OM_EXEC_CND),
2063 ('end', OM_END),
2064 ('atom', OM_ATOM),
2065 ('rpt', OM_RPT)
2066 ]),
2067 enc_ops=[('0', O_FDSY)],
2068 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2069 iss=[('is[4]', 'ft0')],
2070 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2071 )
2072
2073 group_map(O_FDSYF,
2074 hdr=(I_IGRP_HDR_MAIN, [
2075 ('oporg', 'p0'),
2076 ('olchk', OM_OLCHK),
2077 ('w1p', False),
2078 ('w0p', True),
2079 ('cc', OM_EXEC_CND),
2080 ('end', OM_END),
2081 ('atom', OM_ATOM),
2082 ('rpt', OM_RPT)
2083 ]),
2084 enc_ops=[('0', O_FDSYF)],
2085 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2086 iss=[('is[4]', 'ft0')],
2087 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2088 )
2089
2090 group_map(O_PCK,
2091 hdr=(I_IGRP_HDR_MAIN, [
2092 ('oporg', 'p2'),
2093 ('olchk', OM_OLCHK),
2094 ('w1p', False),
2095 ('w0p', True),
2096 ('cc', OM_EXEC_CND),
2097 ('end', OM_END),
2098 ('atom', OM_ATOM),
2099 ('rpt', OM_RPT)
2100 ]),
2101 enc_ops=[('2_pck', O_PCK)],
2102 srcs=[('s[2]', ('2_pck', SRC(0)), 'is3')],
2103 iss=[
2104 ('is[0]', 's2'),
2105 ('is[3]', 'fte'),
2106 ('is[4]', 'ft2')
2107 ],
2108 dests=[('w[0]', ('2_pck', DEST(0)), 'ft2')]
2109 )
2110
2111 group_map(O_PCK_PROG,
2112 hdr=(I_IGRP_HDR_MAIN, [
2113 ('oporg', 'p0_p2'),
2114 ('olchk', OM_OLCHK),
2115 ('w1p', False),
2116 ('w0p', True),
2117 ('cc', OM_EXEC_CND),
2118 ('end', OM_END),
2119 ('atom', OM_ATOM),
2120 ('rpt', OM_RPT)
2121 ]),
2122 enc_ops=[
2123 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2124 ('2_pck', O_PCK_PROG, [DEST(0)], ['is3', SRC(1)], [(OM_ROUNDZERO, OM_ROUNDZERO), (OM_SCALE, OM_SCALE)])
2125 ],
2126 srcs=[
2127 ('s[0]', ('0', SRC(0)), 's0'),
2128 ('s[3]', ('2_pck', SRC(1)), 'fte')
2129 ],
2130 iss=[
2131 ('is[0]', 's3'),
2132 ('is[3]', 'ft0'),
2133 ('is[4]', 'ft2')
2134 ],
2135 dests=[('w[0]', ('2_pck', DEST(0)), 'ft2')]
2136 )
2137
2138 group_map(O_UNPCK,
2139 hdr=(I_IGRP_HDR_MAIN, [
2140 ('oporg', 'p0'),
2141 ('olchk', OM_OLCHK),
2142 ('w1p', False),
2143 ('w0p', True),
2144 ('cc', OM_EXEC_CND),
2145 ('end', OM_END),
2146 ('atom', OM_ATOM),
2147 ('rpt', OM_RPT)
2148 ]),
2149 enc_ops=[('0', O_UNPCK)],
2150 srcs=[('s[0]', ('0', SRC(0)), 's0')],
2151 iss=[('is[4]', 'ft0')],
2152 dests=[('w[0]', ('0', DEST(0)), 'ft0')]
2153 )
2154
2155 group_map(O_MOVWM,
2156 hdr=(I_IGRP_HDR_MAIN, [
2157 ('oporg', 'p0_p2'),
2158 ('olchk', OM_OLCHK),
2159 ('w1p', False),
2160 ('w0p', True),
2161 ('cc', OM_EXEC_CND),
2162 ('end', OM_END),
2163 ('atom', OM_ATOM),
2164 ('rpt', OM_RPT)
2165 ]),
2166 enc_ops=[
2167 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2168 ('2_mov', O_MOVWM, [DEST(0)], ['ft0', SRC(1)], [(OM_PHASE2END, OM_PHASE2END)])
2169 ],
2170 srcs=[
2171 ('s[0]', ('0', SRC(0)), 's0'),
2172 ('s[1]', ('2_mov', SRC(1)), 'is4')
2173 ],
2174 iss=[
2175 ('is[0]', 's1'),
2176 ('is[4]', 'fte')
2177 ],
2178 dests=[('w[0]', ('2_mov', DEST(0)), 'w0')]
2179 )
2180
2181 group_map(O_MOVS1,
2182 hdr=(I_IGRP_HDR_MAIN, [
2183 ('oporg', 'p2'),
2184 ('olchk', OM_OLCHK),
2185 ('w1p', False),
2186 ('w0p', True),
2187 ('cc', OM_EXEC_CND),
2188 ('end', OM_END),
2189 ('atom', OM_ATOM),
2190 ('rpt', OM_RPT)
2191 ]),
2192 enc_ops=[('2_mov', O_MOVWM, [DEST(0)], [SRC(0), 'is4'], [(OM_PHASE2END, True)])],
2193 srcs=[('s[1]', ('2_mov', SRC(0)), 'fte')],
2194 iss=[
2195 ('is[0]', 's1'),
2196 ('is[4]', 'fte')
2197 ],
2198 dests=[('w[0]', ('2_mov', DEST(0)), 'w0')]
2199 )
2200
2201 group_map(O_ADD64_32,
2202 hdr=(I_IGRP_HDR_MAIN, [
2203 ('oporg', 'p0'),
2204 ('olchk', OM_OLCHK),
2205 ('w1p', ('!pco_ref_is_null', DEST(1))),
2206 ('w0p', ('!pco_ref_is_null', DEST(0))),
2207 ('cc', OM_EXEC_CND),
2208 ('end', OM_END),
2209 ('atom', OM_ATOM),
2210 ('rpt', OM_RPT)
2211 ]),
2212 enc_ops=[('0', O_ADD64_32)],
2213 srcs=[
2214 ('s[0]', ('0', SRC(0)), 's0'),
2215 ('s[1]', ('0', SRC(1)), 's1'),
2216 ('s[2]', ('0', SRC(2)), 's2')
2217 ],
2218 iss=[
2219 ('is[4]', 'ft0'),
2220 ('is[5]', 'fte')
2221 ],
2222 dests=[
2223 ('w[0]', ('0', DEST(0)), 'ft0'),
2224 ('w[1]', ('0', DEST(1)), 'fte')
2225 ]
2226 )
2227
2228 group_map(O_IMADD64,
2229 hdr=(I_IGRP_HDR_MAIN, [
2230 ('oporg', 'p0'),
2231 ('olchk', OM_OLCHK),
2232 # TODO: make this change to add64_32, etc. as well
2233 ('w1p', ('!pco_ref_is_null', DEST(1))),
2234 ('w0p', ('!pco_ref_is_null', DEST(0))),
2235 ('cc', OM_EXEC_CND),
2236 ('end', OM_END),
2237 ('atom', OM_ATOM),
2238 ('rpt', OM_RPT)
2239 ]),
2240 enc_ops=[('0', O_IMADD64)],
2241 srcs=[
2242 ('s[0]', ('0', SRC(0)), 's0'),
2243 ('s[1]', ('0', SRC(1)), 's1'),
2244 ('s[2]', ('0', SRC(2)), 's2'),
2245 ('s[3]', ('0', SRC(3)), 'is0')
2246 ],
2247 iss=[
2248 ('is[0]', 's3'),
2249 ('is[4]', 'ft0'),
2250 ('is[5]', 'fte')
2251 ],
2252 dests=[
2253 ('w[0]', ('0', DEST(0)), 'ft0'),
2254 ('w[1]', ('0', DEST(1)), 'fte')
2255 ]
2256 )
2257
2258 group_map(O_IMADD32,
2259 hdr=(I_IGRP_HDR_MAIN, [
2260 ('oporg', 'p0'),
2261 ('olchk', OM_OLCHK),
2262 ('w1p', False),
2263 ('w0p', True),
2264 ('cc', OM_EXEC_CND),
2265 ('end', OM_END),
2266 ('atom', OM_ATOM),
2267 ('rpt', OM_RPT)
2268 ]),
2269 enc_ops=[('0', O_IMADD32)],
2270 srcs=[
2271 ('s[0]', ('0', SRC(0)), 's0'),
2272 ('s[1]', ('0', SRC(1)), 's1'),
2273 ('s[2]', ('0', SRC(2)), 's2')
2274 ],
2275 iss=[
2276 ('is[4]', 'ft0'),
2277 ],
2278 dests=[
2279 ('w[0]', ('0', DEST(0)), 'ft0'),
2280 ]
2281 )
2282
2283 group_map(O_SCMP,
2284 hdr=(I_IGRP_HDR_MAIN, [
2285 ('oporg', 'p0_p1_p2'),
2286 ('olchk', OM_OLCHK),
2287 ('w1p', False),
2288 ('w0p', True),
2289 ('cc', OM_EXEC_CND),
2290 ('end', OM_END),
2291 ('atom', OM_ATOM),
2292 ('rpt', OM_RPT)
2293 ]),
2294 enc_ops=[
2295 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2296 ('1', O_MBYP, ['ft1'], [SRC(1)]),
2297 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, OM_TST_OP_MAIN), (OM_TST_TYPE_MAIN, 'f32')]),
2298 ('2_pck', O_PCK, ['ft2'], ['_'], [(OM_PCK_FMT, 'one')]),
2299 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft2', 'is4', '_', '_'])
2300 ],
2301 srcs=[
2302 ('s[0]', ('0', SRC(0)), 's0'),
2303 ('s[1]', 'pco_zero'),
2304 ('s[3]', ('1', SRC(0)), 's3'),
2305 ],
2306 iss=[
2307 ('is[0]', 's1'),
2308 ('is[1]', 'ft0'),
2309 ('is[2]', 'ft1'),
2310 ('is[4]', 'fte'),
2311 ],
2312 dests=[
2313 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2314 ]
2315 )
2316
2317 group_map(O_BCMP,
2318 hdr=(I_IGRP_HDR_MAIN, [
2319 ('oporg', 'p0_p1_p2'),
2320 ('olchk', OM_OLCHK),
2321 ('w1p', False),
2322 ('w0p', True),
2323 ('cc', OM_EXEC_CND),
2324 ('end', OM_END),
2325 ('atom', OM_ATOM),
2326 ('rpt', OM_RPT)
2327 ]),
2328 enc_ops=[
2329 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2330 ('1', O_MBYP, ['ft1'], [SRC(1)]),
2331 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, OM_TST_OP_MAIN), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN)]),
2332 ('2_pck', O_PCK, ['ft2'], ['_'], [(OM_PCK_FMT, 'zero')]),
2333 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'fte', 'is4', '_', '_'])
2334 ],
2335 srcs=[
2336 ('s[0]', ('0', SRC(0)), 's0'),
2337 ('s[1]', 'pco_true'),
2338 ('s[3]', ('1', SRC(0)), 's3'),
2339 ],
2340 iss=[
2341 ('is[0]', 's1'),
2342 ('is[1]', 'ft0'),
2343 ('is[2]', 'ft1'),
2344 ('is[4]', 'ft2'),
2345 ],
2346 dests=[
2347 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2348 ]
2349 )
2350
2351 group_map(O_BCSEL,
2352 hdr=(I_IGRP_HDR_MAIN, [
2353 ('oporg', 'p0_p1_p2'),
2354 ('olchk', OM_OLCHK),
2355 ('w1p', False),
2356 ('w0p', True),
2357 ('cc', OM_EXEC_CND),
2358 ('end', OM_END),
2359 ('atom', OM_ATOM),
2360 ('rpt', OM_RPT)
2361 ]),
2362 enc_ops=[
2363 ('0', O_MBYP, ['ft0'], [SRC(1)]),
2364 ('1', O_MBYP, ['ft1'], [SRC(2)]),
2365 ('2_tst', O_TST, ['ftt', '_'], [SRC(0), '_'], [(OM_TST_OP_MAIN, 'zero'), (OM_TST_TYPE_MAIN, 'u32'), (OM_PHASE2END, True)]),
2366 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft1', 'is4', '_', '_'])
2367 ],
2368 srcs=[
2369 ('s[0]', ('0', SRC(0)), 's0'),
2370 ('s[1]', ('2_tst', SRC(0)), 'is1'),
2371 ('s[3]', ('1', SRC(0)), 's3'),
2372 ],
2373 iss=[
2374 ('is[0]', 's1'),
2375 ('is[1]', 'fte'),
2376 ('is[4]', 'ft0'),
2377 ],
2378 dests=[
2379 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2380 ]
2381 )
2382
2383 group_map(O_CSEL,
2384 hdr=(I_IGRP_HDR_MAIN, [
2385 ('oporg', 'p0_p1_p2'),
2386 ('olchk', OM_OLCHK),
2387 ('w1p', False),
2388 ('w0p', True),
2389 ('cc', OM_EXEC_CND),
2390 ('end', OM_END),
2391 ('atom', OM_ATOM),
2392 ('rpt', OM_RPT)
2393 ]),
2394 enc_ops=[
2395 ('0', O_MBYP, ['ft0'], [SRC(1)]),
2396 ('1', O_MBYP, ['ft1'], [SRC(2)]),
2397 ('2_tst', O_TST, ['ftt', '_'], [SRC(0), '_'], [(OM_TST_OP_MAIN, OM_TST_OP_MAIN), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
2398 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft0', 'is4', '_', '_'])
2399 ],
2400 srcs=[
2401 ('s[0]', ('0', SRC(0)), 's0'),
2402 ('s[1]', ('2_tst', SRC(0)), 'is1'),
2403 ('s[3]', ('1', SRC(0)), 's3'),
2404 ],
2405 iss=[
2406 ('is[0]', 's1'),
2407 ('is[1]', 'fte'),
2408 ('is[4]', 'ft1'),
2409 ],
2410 dests=[
2411 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2412 ]
2413 )
2414
2415 group_map(O_PSEL,
2416 hdr=(I_IGRP_HDR_MAIN, [
2417 ('oporg', 'p0_p1_p2'),
2418 ('olchk', OM_OLCHK),
2419 ('w1p', False),
2420 ('w0p', True),
2421 ('cc', OM_EXEC_CND),
2422 ('end', OM_END),
2423 ('atom', OM_ATOM),
2424 ('rpt', OM_RPT)
2425 ]),
2426 enc_ops=[
2427 ('0', O_IMADD64, ['ft0', 'fte'], ['pco_zero', 'pco_zero', 'pco_zero', 'is0', SRC(0)]),
2428 ('1', O_MBYP, ['ft1'], [SRC(1)]),
2429 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'zero'), (OM_TST_TYPE_MAIN, 'u32'), (OM_PHASE2END, True)]),
2430 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', SRC(2), 'is4', '_', '_'])
2431 ],
2432 srcs=[
2433 ('s[0]', ('0', SRC(0)), 's0'),
2434 ('s[1]', ('0', SRC(1)), 's1'),
2435 ('s[2]', ('0', SRC(2)), 's2'),
2436 ('s[3]', ('1', SRC(0)), 's3'),
2437 ('s[4]', ('2_mov', SRC(1)), 'fte'),
2438 ],
2439 iss=[
2440 ('is[0]', 's4'),
2441 ('is[1]', 'ft0'),
2442 ('is[4]', 'ft1'),
2443 ],
2444 dests=[('w[0]', ('2_mov', DEST(0)), 'w0')]
2445 )
2446
2447 group_map(O_PSEL_TRIG,
2448 hdr=(I_IGRP_HDR_MAIN, [
2449 ('oporg', 'p0_p1_p2'),
2450 ('olchk', OM_OLCHK),
2451 ('w1p', False),
2452 ('w0p', True),
2453 ('cc', OM_EXEC_CND),
2454 ('end', OM_END),
2455 ('atom', OM_ATOM),
2456 ('rpt', OM_RPT)
2457 ]),
2458 enc_ops=[
2459 ('0', O_IMADD64, ['ft0', 'fte'], ['pco_zero', 'pco_zero', 'pco_zero', 'is0', SRC(0)]),
2460 ('1', O_FMUL, ['ft1'], [SRC(1), SRC(2)]),
2461 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'zero'), (OM_TST_TYPE_MAIN, 'u32'), (OM_PHASE2END, True)]),
2462 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'fte', 'is4', '_', '_'])
2463 ],
2464 srcs=[
2465 ('s[0]', ('0', SRC(0)), 's0'),
2466 ('s[1]', ('0', SRC(1)), 's1'),
2467 ('s[2]', ('0', SRC(2)), 's2'),
2468 ('s[3]', ('1', SRC(0)), 's3'),
2469 ('s[4]', ('1', SRC(1)), 's4'),
2470 ],
2471 iss=[
2472 ('is[0]', 's3'),
2473 ('is[1]', 'ft0'),
2474 ('is[4]', 'ft1'),
2475 ],
2476 dests=[
2477 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2478 ]
2479 )
2480
2481 group_map(O_FSIGN,
2482 hdr=(I_IGRP_HDR_MAIN, [
2483 ('oporg', 'p0_p1_p2'),
2484 ('olchk', OM_OLCHK),
2485 ('w1p', False),
2486 ('w0p', True),
2487 ('cc', OM_EXEC_CND),
2488 ('end', OM_END),
2489 ('atom', OM_ATOM),
2490 ('rpt', OM_RPT)
2491 ]),
2492 enc_ops=[
2493 ('0', O_FMUL, ['ft0'], [SRC(0), 'pco_finf'], [(OM_SAT, True)]),
2494 ('1', O_MBYP, ['ft1'], ['pco_fnegone']),
2495 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'gezero'), (OM_TST_TYPE_MAIN, 's32'), (OM_PHASE2END, True)]),
2496 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft0', 'is4', '_', '_'])
2497 ],
2498 srcs=[
2499 ('s[0]', ('0', SRC(0)), 's0'),
2500 ('s[1]', ('0', SRC(1)), 's1'),
2501 ('s[3]', ('1', SRC(0)), 's3'),
2502 ],
2503 iss=[
2504 ('is[0]', 's0'),
2505 ('is[1]', 'fte'),
2506 ('is[4]', 'ft1'),
2507 ],
2508 dests=[
2509 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2510 ]
2511 )
2512
2513 group_map(O_ISIGN,
2514 hdr=(I_IGRP_HDR_MAIN, [
2515 ('oporg', 'p0_p1_p2'),
2516 ('olchk', OM_OLCHK),
2517 ('w1p', False),
2518 ('w0p', True),
2519 ('cc', OM_EXEC_CND),
2520 ('end', OM_END),
2521 ('atom', OM_ATOM),
2522 ('rpt', OM_RPT)
2523 ]),
2524 enc_ops=[
2525 ('0', O_IMADD64, ['_', 'fte'], [SRC(0), 'pco_one', 'pco_zero', 'is0', '_'], [(OM_S, True)]),
2526 ('1', O_MBYP, ['ft1'], ['pco_one']),
2527 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'gzero'), (OM_TST_TYPE_MAIN, 's32'), (OM_PHASE2END, True)]),
2528 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft1', 'is4', '_', '_'])
2529 ],
2530 srcs=[
2531 ('s[0]', ('0', SRC(0)), 's0'),
2532 ('s[1]', ('0', SRC(1)), 's1'),
2533 ('s[2]', ('0', SRC(2)), 's2'),
2534 ('s[3]', ('1', SRC(0)), 's3'),
2535 ],
2536 iss=[
2537 ('is[0]', 's2'),
2538 ('is[1]', 'ft0'),
2539 ('is[4]', 'fte'),
2540 ],
2541 dests=[
2542 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2543 ]
2544 )
2545
2546 group_map(O_FCEIL,
2547 hdr=(I_IGRP_HDR_MAIN, [
2548 ('oporg', 'p0_p1_p2'),
2549 ('olchk', OM_OLCHK),
2550 ('w1p', False),
2551 ('w0p', True),
2552 ('cc', OM_EXEC_CND),
2553 ('end', OM_END),
2554 ('atom', OM_ATOM),
2555 ('rpt', OM_RPT)
2556 ]),
2557 enc_ops=[
2558 ('0', O_FADD, ['ft0'], [SRC(0, [RM_FLR]), 'pco_fone']),
2559 ('1', O_FADD, ['ft1'], [SRC(0, [RM_FLR]), 'pco_zero']),
2560 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'equal'), (OM_TST_TYPE_MAIN, 'f32'), (OM_PHASE2END, True)]),
2561 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft1', 'is4', '_', '_'])
2562 ],
2563 srcs=[
2564 ('s[0]', ('0', SRC(0)), 's0'),
2565 ('s[1]', ('0', SRC(1)), 's1'),
2566 ('s[3]', ('1', SRC(0)), 's3'),
2567 ('s[4]', ('1', SRC(1)), 's4'),
2568 ],
2569 iss=[
2570 ('is[0]', 's0'),
2571 ('is[1]', 'fte'),
2572 ('is[2]', 'ft1'),
2573 ('is[4]', 'ft0'),
2574 ],
2575 dests=[
2576 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2577 ]
2578 )
2579
2580 group_map(O_MIN,
2581 hdr=(I_IGRP_HDR_MAIN, [
2582 ('oporg', 'p0_p1_p2'),
2583 ('olchk', OM_OLCHK),
2584 ('w1p', False),
2585 ('w0p', True),
2586 ('cc', OM_EXEC_CND),
2587 ('end', OM_END),
2588 ('atom', OM_ATOM),
2589 ('rpt', OM_RPT)
2590 ]),
2591 enc_ops=[
2592 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2593 ('1', O_MBYP, ['ft1'], [SRC(1)]),
2594 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'less'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
2595 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft0', 'is4', '_', '_'])
2596 ],
2597 srcs=[
2598 ('s[0]', ('0', SRC(0)), 's0'),
2599 ('s[3]', ('1', SRC(0)), 's3'),
2600 ],
2601 iss=[
2602 ('is[1]', 'ft0'),
2603 ('is[2]', 'ft1'),
2604 ('is[4]', 'ft1'),
2605 ],
2606 dests=[
2607 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2608 ]
2609 )
2610
2611 group_map(O_MAX,
2612 hdr=(I_IGRP_HDR_MAIN, [
2613 ('oporg', 'p0_p1_p2'),
2614 ('olchk', OM_OLCHK),
2615 ('w1p', False),
2616 ('w0p', True),
2617 ('cc', OM_EXEC_CND),
2618 ('end', OM_END),
2619 ('atom', OM_ATOM),
2620 ('rpt', OM_RPT)
2621 ]),
2622 enc_ops=[
2623 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2624 ('1', O_MBYP, ['ft1'], [SRC(1)]),
2625 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'greater'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
2626 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft0', 'is4', '_', '_'])
2627 ],
2628 srcs=[
2629 ('s[0]', ('0', SRC(0)), 's0'),
2630 ('s[3]', ('1', SRC(0)), 's3'),
2631 ],
2632 iss=[
2633 ('is[1]', 'ft0'),
2634 ('is[2]', 'ft1'),
2635 ('is[4]', 'ft1'),
2636 ],
2637 dests=[
2638 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2639 ]
2640 )
2641
2642 group_map(O_IADD32,
2643 hdr=(I_IGRP_HDR_MAIN, [
2644 ('oporg', 'p0'),
2645 ('olchk', OM_OLCHK),
2646 ('w1p', False),
2647 ('w0p', True),
2648 ('cc', OM_EXEC_CND),
2649 ('end', OM_END),
2650 ('atom', OM_ATOM),
2651 ('rpt', OM_RPT)
2652 ]),
2653 enc_ops=[('0', O_IMADD32, [DEST(0)], [SRC(0), 'pco_one', SRC(1), SRC(2)], [(OM_S, OM_S)])],
2654 srcs=[
2655 ('s[0]', ('0', SRC(0)), 's0'),
2656 ('s[1]', ('0', SRC(1)), 's1'),
2657 ('s[2]', ('0', SRC(2)), 's2')
2658 ],
2659 iss=[
2660 ('is[4]', 'ft0'),
2661 ],
2662 dests=[
2663 ('w[0]', ('0', DEST(0)), 'ft0'),
2664 ]
2665 )
2666
2667 group_map(O_IMUL32,
2668 hdr=(I_IGRP_HDR_MAIN, [
2669 ('oporg', 'p0'),
2670 ('olchk', OM_OLCHK),
2671 ('w1p', False),
2672 ('w0p', True),
2673 ('cc', OM_EXEC_CND),
2674 ('end', OM_END),
2675 ('atom', OM_ATOM),
2676 ('rpt', OM_RPT)
2677 ]),
2678 enc_ops=[('0', O_IMADD32, [DEST(0)], [SRC(0), SRC(1), 'pco_zero', SRC(2)], [(OM_S, OM_S)])],
2679 srcs=[
2680 ('s[0]', ('0', SRC(0)), 's0'),
2681 ('s[1]', ('0', SRC(1)), 's1'),
2682 ('s[2]', ('0', SRC(2)), 's2')
2683 ],
2684 iss=[
2685 ('is[4]', 'ft0'),
2686 ],
2687 dests=[
2688 ('w[0]', ('0', DEST(0)), 'ft0'),
2689 ]
2690 )
2691
2692 group_map(O_UADD_CARRY,
2693 hdr=(I_IGRP_HDR_MAIN, [
2694 ('oporg', 'p0_p1_p2'),
2695 ('olchk', OM_OLCHK),
2696 ('w1p', ('!pco_ref_is_null', DEST(1))),
2697 ('w0p', ('!pco_ref_is_null', DEST(0))),
2698 ('cc', OM_EXEC_CND),
2699 ('end', OM_END),
2700 ('atom', OM_ATOM),
2701 ('rpt', OM_RPT)
2702 ]),
2703 enc_ops=[
2704 ('0', O_ADD64_32, ['ft0', 'fte'], [SRC(0), 'pco_zero', SRC(1), '_'], [(OM_S, False)]),
2705 ('1', O_MBYP, ['ft1'], ['pco_one']),
2706 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'gzero'), (OM_TST_TYPE_MAIN, 'u32')]),
2707 ('2_pck', O_PCK, ['ft2'], ['_'], [(OM_PCK_FMT, 'zero')]),
2708 ('2_mov', O_MOVC, [DEST(0), DEST(1)], ['ftt', 'ft0', 'is4', 'ft1', 'is5'])
2709 ],
2710 srcs=[
2711 ('s[0]', ('0', SRC(0)), 's0'),
2712 ('s[1]', ('0', SRC(1)), 's1'),
2713 ('s[2]', ('0', SRC(2)), 's2'),
2714 ('s[3]', ('1', SRC(0)), 's3'),
2715 ],
2716 iss=[
2717 ('is[0]', 's3'),
2718 ('is[1]', 'fte'),
2719 ('is[4]', 'ft0'),
2720 ('is[5]', 'ft2'),
2721 ],
2722 dests=[
2723 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2724 ('w[1]', ('2_mov', DEST(1)), 'w1'),
2725 ]
2726 )
2727
2728 group_map(O_UADD_SAT,
2729 hdr=(I_IGRP_HDR_MAIN, [
2730 ('oporg', 'p0_p1_p2'),
2731 ('olchk', OM_OLCHK),
2732 ('w1p', False),
2733 ('w0p', True),
2734 ('cc', OM_EXEC_CND),
2735 ('end', OM_END),
2736 ('atom', OM_ATOM),
2737 ('rpt', OM_RPT)
2738 ]),
2739 enc_ops=[
2740 ('0', O_ADD64_32, ['ft0', 'fte'], [SRC(0), 'pco_zero', SRC(1), '_']),
2741 ('1', O_MBYP, ['ft1'], [SRC(2)]),
2742 ('2_tst', O_TST, ['ftt', '_'], ['is1', '_'], [(OM_TST_OP_MAIN, 'gzero'), (OM_TST_TYPE_MAIN, 'u32'), (OM_PHASE2END, True)]),
2743 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'ft1', 'is4', '_', '_'])
2744 ],
2745 srcs=[
2746 ('s[0]', ('0', SRC(0)), 's0'),
2747 ('s[1]', ('0', SRC(1)), 's1'),
2748 ('s[2]', ('0', SRC(2)), 's2'),
2749 ('s[3]', ('1', SRC(0)), 's3'),
2750 ],
2751 iss=[
2752 ('is[0]', 's3'),
2753 ('is[1]', 'fte'),
2754 ('is[4]', 'ft0'),
2755 ],
2756 dests=[
2757 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2758 ]
2759 )
2760
2761 group_map(O_TSTZ,
2762 hdr=(I_IGRP_HDR_MAIN, [
2763 ('oporg', 'p0_p2'),
2764 ('olchk', OM_OLCHK),
2765 ('w1p', False),
2766 ('w0p', ('!pco_ref_is_null', DEST(0))),
2767 ('cc', OM_EXEC_CND),
2768 ('end', OM_END),
2769 ('atom', OM_ATOM),
2770 ('rpt', OM_RPT)
2771 ]),
2772 enc_ops=[
2773 ('0', O_MBYP, ['ft0'], [SRC(0)]),
2774 ('2_tst', O_TST, ['ftt', DEST(1)], ['is1', '_'], [(OM_TST_OP_MAIN, 'zero'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN)]),
2775 ('2_pck', O_PCK, ['ft2'], ['_'], [(OM_PCK_FMT, 'zero')]),
2776 ('2_mov', O_MOVC, [DEST(0), '_'], ['ftt', 'fte', 'is4', '_', '_'])
2777 ],
2778 srcs=[
2779 ('s[0]', ('0', SRC(0)), 's0'),
2780 ('s[1]', 'pco_true'),
2781 ],
2782 iss=[
2783 ('is[0]', 's1'),
2784 ('is[1]', 'ft0'),
2785 ('is[4]', 'ft2'),
2786 ],
2787 dests=[
2788 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2789 ]
2790 )
2791
2792 group_map(O_ST32,
2793 hdr=(I_IGRP_HDR_MAIN, [
2794 ('oporg', 'be'),
2795 ('olchk', OM_OLCHK),
2796 ('w1p', False),
2797 ('w0p', False),
2798 ('cc', OM_EXEC_CND),
2799 ('end', OM_END),
2800 ('atom', OM_ATOM),
2801 ('rpt', 1)
2802 ]),
2803 enc_ops=[('backend', O_ST, [], [SRC(0), 'pco_ref_imm8(PCO_DSIZE_32BIT)', SRC(1), SRC(2), SRC(3), SRC(4)], [(OM_MCU_CACHE_MODE_ST, OM_MCU_CACHE_MODE_ST), (OM_IDF, OM_IDF)])],
2804 srcs=[
2805 ('s[0]', ('backend', SRC(0)), 's0'),
2806 ('s[3]', ('backend', SRC(4)), 's3')
2807 ]
2808 )
2809
2810 group_map(O_ST32_REGBL,
2811 hdr=(I_IGRP_HDR_MAIN, [
2812 ('oporg', 'be'),
2813 ('olchk', OM_OLCHK),
2814 ('w1p', False),
2815 ('w0p', False),
2816 ('cc', OM_EXEC_CND),
2817 ('end', OM_END),
2818 ('atom', OM_ATOM),
2819 ('rpt', 1)
2820 ]),
2821 enc_ops=[('backend', O_ST_REGBL, [], [SRC(0), 'pco_ref_imm8(PCO_DSIZE_32BIT)', SRC(1), SRC(2), SRC(3), SRC(4)], [(OM_MCU_CACHE_MODE_ST, OM_MCU_CACHE_MODE_ST), (OM_IDF, OM_IDF)])],
2822 srcs=[
2823 ('s[0]', ('backend', SRC(0)), 's0'),
2824 ('s[2]', ('backend', SRC(3)), 's2'),
2825 ('s[3]', ('backend', SRC(4)), 's3')
2826 ]
2827 )
2828
2829 group_map(O_ST_TILED,
2830 hdr=(I_IGRP_HDR_MAIN, [
2831 ('oporg', 'be'),
2832 ('olchk', OM_OLCHK),
2833 ('w1p', False),
2834 ('w0p', False),
2835 ('cc', OM_EXEC_CND),
2836 ('end', OM_END),
2837 ('atom', OM_ATOM),
2838 ('rpt', 1)
2839 ]),
2840 enc_ops=[('backend', O_ST_TILED)],
2841 srcs=[
2842 ('s[0]', ('backend', SRC(0)), 's0'),
2843 ('s[3]', ('backend', SRC(4)), 's3'),
2844 ('s[4]', ('backend', SRC(5)), 's4')
2845 ]
2846 )
2847
2848 group_map(O_IDF,
2849 hdr=(I_IGRP_HDR_MAIN, [
2850 ('oporg', 'be'),
2851 ('olchk', OM_OLCHK),
2852 ('w1p', False),
2853 ('w0p', False),
2854 ('cc', OM_EXEC_CND),
2855 ('end', OM_END),
2856 ('atom', OM_ATOM),
2857 ('rpt', 1)
2858 ]),
2859 enc_ops=[('backend', O_IDF)],
2860 srcs=[('s[0]', ('backend', SRC(1)), 's0')]
2861 )
2862
2863 group_map(O_IADD32_ATOMIC,
2864 hdr=(I_IGRP_HDR_MAIN, [
2865 ('oporg', 'p0_p1'),
2866 ('olchk', OM_OLCHK),
2867 ('w1p', True),
2868 ('w0p', True),
2869 ('cc', OM_EXEC_CND),
2870 ('end', OM_END),
2871 ('atom', True),
2872 ('rpt', OM_RPT)
2873 ]),
2874 enc_ops=[
2875 ('0', O_IMADD32, [DEST(1)], [SRC(0), 'pco_one', SRC(1), SRC(2)], [(OM_S, OM_S)]),
2876 ('1', O_MBYP, [DEST(0)], [SRC(0)])
2877 ],
2878 srcs=[
2879 ('s[0]', ('0', SRC(0)), 's0'),
2880 ('s[1]', ('0', SRC(1)), 's1'),
2881 ('s[2]', ('0', SRC(2)), 's2'),
2882 ('s[3]', ('1', SRC(0)), 's3')
2883 ],
2884 iss=[
2885 ('is[4]', 'ft1'),
2886 ('is[5]', 'ft0'),
2887 ],
2888 dests=[
2889 ('w[0]', ('1', DEST(0)), 'ft1'),
2890 ('w[1]', ('0', DEST(0)), 'ft0'),
2891 ]
2892 )
2893
2894 group_map(O_XCHG_ATOMIC,
2895 hdr=(I_IGRP_HDR_MAIN, [
2896 ('oporg', 'p0_p1'),
2897 ('olchk', OM_OLCHK),
2898 ('w1p', True),
2899 ('w0p', True),
2900 ('cc', OM_EXEC_CND),
2901 ('end', OM_END),
2902 ('atom', True),
2903 ('rpt', OM_RPT)
2904 ]),
2905 enc_ops=[
2906 ('0', O_MBYP, [DEST(1)], [SRC(1)]),
2907 ('1', O_MBYP, [DEST(0)], [SRC(0)])
2908 ],
2909 srcs=[
2910 ('s[0]', ('0', SRC(0)), 's0'),
2911 ('s[3]', ('1', SRC(0)), 's3')
2912 ],
2913 iss=[
2914 ('is[4]', 'ft1'),
2915 ('is[5]', 'ft0'),
2916 ],
2917 dests=[
2918 ('w[0]', ('1', DEST(0)), 'ft1'),
2919 ('w[1]', ('0', DEST(0)), 'ft0'),
2920 ]
2921 )
2922
2923 group_map(O_CMPXCHG_ATOMIC,
2924 hdr=(I_IGRP_HDR_MAIN, [
2925 ('oporg', 'p0_p1_p2'),
2926 ('olchk', OM_OLCHK),
2927 ('w1p', True),
2928 ('w0p', True),
2929 ('cc', OM_EXEC_CND),
2930 ('end', OM_END),
2931 ('atom', True),
2932 ('rpt', OM_RPT)
2933 ]),
2934 enc_ops=[
2935 ('0', O_MBYP, ['ft0'], [SRC(1)]),
2936 ('1', O_MBYP, ['ft1'], [SRC(0)]),
2937 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'equal'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
2938 ('2_mov', O_MOVC, [DEST(1), DEST(0)], ['ftt', SRC(2), 'is4', 'ft1', 'is5'])
2939 ],
2940 srcs=[
2941 ('s[0]', ('0', SRC(0)), 's0'),
2942 ('s[1]', ('2_mov', SRC(1)), 'fte'),
2943 ('s[3]', ('1', SRC(0)), 's3')
2944 ],
2945 iss=[
2946 ('is[0]', 's1'),
2947 ('is[1]', 'ft0'),
2948 ('is[2]', 'ft1'),
2949 ('is[4]', 'ft1'),
2950 ('is[5]', 'ft1'),
2951 ],
2952 dests=[
2953 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2954 ('w[1]', ('2_mov', DEST(1)), 'w1')
2955 ]
2956 )
2957
2958 group_map(O_MIN_ATOMIC,
2959 hdr=(I_IGRP_HDR_MAIN, [
2960 ('oporg', 'p0_p1_p2'),
2961 ('olchk', OM_OLCHK),
2962 ('w1p', True),
2963 ('w0p', True),
2964 ('cc', OM_EXEC_CND),
2965 ('end', OM_END),
2966 ('atom', True),
2967 ('rpt', OM_RPT)
2968 ]),
2969 enc_ops=[
2970 ('0', O_MBYP, ['ft0'], [SRC(1)]),
2971 ('1', O_MBYP, ['ft1'], [SRC(0)]),
2972 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'less'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
2973 ('2_mov', O_MOVC, [DEST(1), DEST(0)], ['ftt', 'ft0', 'is4', 'ft1', 'is5'])
2974 ],
2975 srcs=[
2976 ('s[0]', ('0', SRC(0)), 's0'),
2977 ('s[3]', ('1', SRC(0)), 's3')
2978 ],
2979 iss=[
2980 ('is[1]', 'ft0'),
2981 ('is[2]', 'ft1'),
2982 ('is[4]', 'ft1'),
2983 ('is[5]', 'ft1')
2984 ],
2985 dests=[
2986 ('w[0]', ('2_mov', DEST(0)), 'w0'),
2987 ('w[1]', ('2_mov', DEST(1)), 'w1')
2988 ]
2989 )
2990
2991 group_map(O_MAX_ATOMIC,
2992 hdr=(I_IGRP_HDR_MAIN, [
2993 ('oporg', 'p0_p1_p2'),
2994 ('olchk', OM_OLCHK),
2995 ('w1p', True),
2996 ('w0p', True),
2997 ('cc', OM_EXEC_CND),
2998 ('end', OM_END),
2999 ('atom', True),
3000 ('rpt', OM_RPT)
3001 ]),
3002 enc_ops=[
3003 ('0', O_MBYP, ['ft0'], [SRC(1)]),
3004 ('1', O_MBYP, ['ft1'], [SRC(0)]),
3005 ('2_tst', O_TST, ['ftt', '_'], ['is1', 'is2'], [(OM_TST_OP_MAIN, 'greater'), (OM_TST_TYPE_MAIN, OM_TST_TYPE_MAIN), (OM_PHASE2END, True)]),
3006 ('2_mov', O_MOVC, [DEST(1), DEST(0)], ['ftt', 'ft0', 'is4', 'ft1', 'is5'])
3007 ],
3008 srcs=[
3009 ('s[0]', ('0', SRC(0)), 's0'),
3010 ('s[3]', ('1', SRC(0)), 's3')
3011 ],
3012 iss=[
3013 ('is[1]', 'ft0'),
3014 ('is[2]', 'ft1'),
3015 ('is[4]', 'ft1'),
3016 ('is[5]', 'ft1')
3017 ],
3018 dests=[
3019 ('w[0]', ('2_mov', DEST(0)), 'w0'),
3020 ('w[1]', ('2_mov', DEST(1)), 'w1')
3021 ]
3022 )
3023
3024 group_map(O_LOGICAL_ATOMIC,
3025 hdr=(I_IGRP_HDR_BITWISE, [
3026 ('opcnt', ['p0', 'p1']),
3027 ('olchk', OM_OLCHK),
3028 ('w1p', True),
3029 ('w0p', True),
3030 ('cc', OM_EXEC_CND),
3031 ('end', OM_END),
3032 ('atom', True),
3033 ('rpt', OM_RPT)
3034 ]),
3035 enc_ops=[
3036 ('0', O_BBYP0S1, ['ft2', DEST(0)], [SRC(0)]),
3037 ('1', O_LOGICAL, [DEST(1)], ['_', 'ft2', '_', SRC(1)], [(OM_LOGIOP, OM_LOGIOP)])
3038 ],
3039 srcs=[
3040 ('s[2]', ('0', SRC(0)), 's2'),
3041 ('s[3]', ('1', SRC(3)), 's3')
3042 ],
3043 dests=[
3044 ('w[0]', ('1', DEST(0)), 'ft4'),
3045 ('w[1]', ('0', DEST(1)), 'ft3')
3046 ]
3047 )
3048
3049 group_map(O_FLUSH_P0,
3050 hdr=(I_IGRP_HDR_MAIN, [
3051 ('oporg', 'p0_p2'),
3052 ('olchk', False),
3053 ('w1p', False),
3054 ('w0p', False),
3055 ('cc', OM_EXEC_CND),
3056 ('end', OM_END),
3057 ('atom', False),
3058 ('rpt', 1)
3059 ]),
3060 enc_ops=[
3061 ('0', O_IMADD32, ['ft0'], ['pco_zero', 'pco_zero', 'pco_zero', 'pco_p0'], [(OM_S, False)]),
3062 ('2_tst', O_TST, ['ftt', 'pco_p0'], ['is1', '_'], [(OM_TST_OP_MAIN, 'gzero'), (OM_TST_TYPE_MAIN, 'u32'), (OM_PHASE2END, True)]),
3063 ],
3064 srcs=[
3065 ('s[0]', ('0', SRC(0)), 's0'),
3066 ('s[1]', ('0', SRC(1)), 's1'),
3067 ('s[2]', ('0', SRC(2)), 's2')
3068 ],
3069 iss=[
3070 ('is[1]', 'ft0'),
3071 ]
3072 )
3073
3074 group_map(O_MBYP2,
3075 hdr=(I_IGRP_HDR_MAIN, [
3076 ('oporg', 'p0_p1'),
3077 ('olchk', OM_OLCHK),
3078 ('w1p', True),
3079 ('w0p', True),
3080 ('cc', OM_EXEC_CND),
3081 ('end', OM_END),
3082 ('atom', OM_ATOM),
3083 ('rpt', OM_RPT)
3084 ]),
3085 enc_ops=[
3086 ('0', O_MBYP, [DEST(0)], [SRC(0)]),
3087 ('1', O_MBYP, [DEST(1)], [SRC(1)])
3088 ],
3089 srcs=[
3090 ('s[0]', ('0', SRC(0)), 's0'),
3091 ('s[3]', ('1', SRC(0)), 's3')
3092 ],
3093 iss=[
3094 ('is[4]', 'ft0'),
3095 ('is[5]', 'ft1'),
3096 ],
3097 dests=[
3098 ('w[0]', ('0', DEST(0)), 'ft0'),
3099 ('w[1]', ('1', DEST(0)), 'ft1'),
3100 ]
3101 )
3102
3103 group_map(O_UVSW_WRITE,
3104 hdr=(I_IGRP_HDR_MAIN, [
3105 ('oporg', 'be'),
3106 ('olchk', False),
3107 ('w1p', False),
3108 ('w0p', False),
3109 ('cc', OM_EXEC_CND),
3110 ('end', False),
3111 ('atom', False),
3112 ('rpt', OM_RPT)
3113 ]),
3114 enc_ops=[('backend', O_UVSW_WRITE)],
3115 srcs=[('s[0]', ('backend', SRC(0)), 'w0')],
3116 iss=[
3117 ('is[0]', 's0'),
3118 ('is[4]', 'fte')
3119 ]
3120 )
3121
3122 group_map(O_UVSW_EMIT,
3123 hdr=(I_IGRP_HDR_MAIN, [
3124 ('oporg', 'be'),
3125 ('olchk', False),
3126 ('w1p', False),
3127 ('w0p', False),
3128 ('cc', OM_EXEC_CND),
3129 ('end', False),
3130 ('atom', False),
3131 ('rpt', 1)
3132 ]),
3133 enc_ops=[('backend', O_UVSW_EMIT)]
3134 )
3135
3136 group_map(O_UVSW_ENDTASK,
3137 hdr=(I_IGRP_HDR_MAIN, [
3138 ('oporg', 'be'),
3139 ('olchk', False),
3140 ('w1p', False),
3141 ('w0p', False),
3142 ('cc', 'e1_zx'),
3143 ('end', OM_END),
3144 ('atom', False),
3145 ('rpt', 1)
3146 ]),
3147 enc_ops=[('backend', O_UVSW_ENDTASK)]
3148 )
3149
3150 group_map(O_UVSW_EMIT_ENDTASK,
3151 hdr=(I_IGRP_HDR_MAIN, [
3152 ('oporg', 'be'),
3153 ('olchk', False),
3154 ('w1p', False),
3155 ('w0p', False),
3156 ('cc', 'e1_zx'),
3157 ('end', OM_END),
3158 ('atom', False),
3159 ('rpt', 1)
3160 ]),
3161 enc_ops=[('backend', O_UVSW_EMIT_ENDTASK)]
3162 )
3163
3164 group_map(O_UVSW_WRITE_EMIT_ENDTASK,
3165 hdr=(I_IGRP_HDR_MAIN, [
3166 ('oporg', 'be'),
3167 ('olchk', False),
3168 ('w1p', False),
3169 ('w0p', False),
3170 ('cc', 'e1_zx'),
3171 ('end', OM_END),
3172 ('atom', False),
3173 ('rpt', 1)
3174 ]),
3175 enc_ops=[('backend', O_UVSW_WRITE_EMIT_ENDTASK)],
3176 srcs=[('s[0]', ('backend', SRC(0)), 'w0')],
3177 iss=[
3178 ('is[0]', 's0'),
3179 ('is[4]', 'fte')
3180 ]
3181 )
3182
3183 group_map(O_FITR,
3184 hdr=(I_IGRP_HDR_MAIN, [
3185 ('oporg', 'be'),
3186 ('olchk', False),
3187 ('w1p', False),
3188 ('w0p', False),
3189 ('cc', OM_EXEC_CND),
3190 ('end', OM_END),
3191 ('atom', False),
3192 ('rpt', 1)
3193 ]),
3194 enc_ops=[('backend', O_FITR)],
3195 srcs=[
3196 ('s[0]', ('backend', SRC(1)), 's0'),
3197 ('s[3]', ('backend', DEST(0)), 's3')
3198 ]
3199 )
3200
3201 group_map(O_FITRP,
3202 hdr=(I_IGRP_HDR_MAIN, [
3203 ('oporg', 'be'),
3204 ('olchk', False),
3205 ('w1p', False),
3206 ('w0p', False),
3207 ('cc', OM_EXEC_CND),
3208 ('end', OM_END),
3209 ('atom', False),
3210 ('rpt', 1)
3211 ]),
3212 enc_ops=[('backend', O_FITRP)],
3213 srcs=[
3214 ('s[0]', ('backend', SRC(1)), 's0'),
3215 ('s[2]', ('backend', SRC(2)), 's2'),
3216 ('s[3]', ('backend', DEST(0)), 's3')
3217 ]
3218 )
3219
3220 group_map(O_LD,
3221 hdr=(I_IGRP_HDR_MAIN, [
3222 ('oporg', 'be'),
3223 ('olchk', OM_OLCHK),
3224 ('w1p', False),
3225 ('w0p', False),
3226 ('cc', OM_EXEC_CND),
3227 ('end', OM_END),
3228 ('atom', OM_ATOM),
3229 ('rpt', 1)
3230 ]),
3231 enc_ops=[('backend', O_LD)],
3232 srcs=[
3233 ('s[0]', ('backend', SRC(2)), 's0'),
3234 ('s[3]', ('backend', DEST(0)), 's3')
3235 ]
3236 )
3237
3238 group_map(O_LD_REGBL,
3239 hdr=(I_IGRP_HDR_MAIN, [
3240 ('oporg', 'be'),
3241 ('olchk', OM_OLCHK),
3242 ('w1p', False),
3243 ('w0p', False),
3244 ('cc', OM_EXEC_CND),
3245 ('end', OM_END),
3246 ('atom', OM_ATOM),
3247 ('rpt', 1)
3248 ]),
3249 enc_ops=[('backend', O_LD_REGBL)],
3250 srcs=[
3251 ('s[0]', ('backend', SRC(2)), 's0'),
3252 ('s[1]', ('backend', SRC(1)), 's1'),
3253 ('s[3]', ('backend', DEST(0)), 's3')
3254 ]
3255 )
3256
3257 group_map(O_ATOMIC,
3258 hdr=(I_IGRP_HDR_MAIN, [
3259 ('oporg', 'be'),
3260 ('olchk', OM_OLCHK),
3261 ('w1p', False),
3262 ('w0p', False),
3263 ('cc', OM_EXEC_CND),
3264 ('end', OM_END),
3265 ('atom', False),
3266 ('rpt', 1)
3267 ]),
3268 enc_ops=[('backend', O_ATOMIC)],
3269 srcs=[
3270 ('s[0]', ('backend', SRC(1)), 's0'),
3271 ('s[3]', ('backend', DEST(0)), 's3')
3272 ]
3273 )
3274
3275 group_map(O_SMP,
3276 hdr=(I_IGRP_HDR_MAIN, [
3277 ('oporg', 'be'),
3278 ('olchk', OM_OLCHK),
3279 ('w1p', False),
3280 ('w0p', False),
3281 ('cc', OM_EXEC_CND),
3282 ('end', OM_END),
3283 ('atom', False),
3284 ('rpt', 1)
3285 ]),
3286 enc_ops=[('backend', O_SMP)],
3287 srcs=[
3288 ('s[0]', ('backend', SRC(1)), 's0'),
3289 ('s[1]', ('backend', SRC(2)), 's1'),
3290 ('s[2]', ('backend', SRC(3)), 's2'),
3291 ('s[3]', ('backend', SRC(4)), 's3'),
3292 ('s[4]', ('backend', DEST(0)), 's4')
3293 ]
3294 )
3295
3296 group_map(O_ALPHATST,
3297 hdr=(I_IGRP_HDR_MAIN, [
3298 ('oporg', 'be'),
3299 ('olchk', OM_OLCHK),
3300 ('w1p', False),
3301 ('w0p', False),
3302 ('cc', OM_EXEC_CND),
3303 ('end', OM_END),
3304 ('atom', OM_ATOM),
3305 ('rpt', 1)
3306 ]),
3307 enc_ops=[('backend', O_ALPHATST)],
3308 srcs=[
3309 ('s[0]', ('backend', SRC(1)), 's0'),
3310 ('s[1]', ('backend', SRC(2)), 's1'),
3311 ('s[2]', ('backend', SRC(3)), 's2'),
3312 ]
3313 )
3314
3315 group_map(O_ALPHAF,
3316 hdr=(I_IGRP_HDR_MAIN, [
3317 ('oporg', 'be'),
3318 ('olchk', OM_OLCHK),
3319 ('w1p', False),
3320 ('w0p', False),
3321 ('cc', OM_EXEC_CND),
3322 ('end', OM_END),
3323 ('atom', OM_ATOM),
3324 ('rpt', 1)
3325 ]),
3326 enc_ops=[('backend', O_ALPHAF)],
3327 srcs=[
3328 ('s[0]', ('backend', SRC(1)), 's0'),
3329 ('s[1]', ('backend', SRC(2)), 's1'),
3330 ('s[2]', ('backend', SRC(3)), 's2'),
3331 ]
3332 )
3333
3334 group_map(O_DEPTHF,
3335 hdr=(I_IGRP_HDR_MAIN, [
3336 ('oporg', 'be'),
3337 ('olchk', OM_OLCHK),
3338 ('w1p', False),
3339 ('w0p', False),
3340 ('cc', OM_EXEC_CND),
3341 ('end', OM_END),
3342 ('atom', OM_ATOM),
3343 ('rpt', 1)
3344 ]),
3345 enc_ops=[('backend', O_DEPTHF)],
3346 srcs=[('s[0]', ('backend', SRC(1)), 'w0')],
3347 iss=[
3348 ('is[0]', 's0'),
3349 ('is[4]', 'fte')
3350 ]
3351 )
3352
3353 group_map(O_SAVMSK,
3354 hdr=(I_IGRP_HDR_MAIN, [
3355 ('oporg', 'be'),
3356 ('olchk', OM_OLCHK),
3357 ('w1p', ('!pco_ref_is_null', DEST(1))),
3358 ('w0p', ('!pco_ref_is_null', DEST(0))),
3359 ('cc', OM_EXEC_CND),
3360 ('end', OM_END),
3361 ('atom', OM_ATOM),
3362 ('rpt', 1)
3363 ]),
3364 enc_ops=[('backend', O_SAVMSK)],
3365 dests=[
3366 ('w[0]', ('backend', DEST(0)), 'w0'),
3367 ('w[1]', ('backend', DEST(1)), 'w1')
3368 ]
3369 )
3370
3371 group_map(O_EMITPIX,
3372 hdr=(I_IGRP_HDR_MAIN, [
3373 ('oporg', 'be'),
3374 ('olchk', OM_OLCHK),
3375 ('w1p', False),
3376 ('w0p', False),
3377 ('cc', OM_EXEC_CND),
3378 ('end', OM_END),
3379 ('atom', OM_ATOM),
3380 ('rpt', 1)
3381 ]),
3382 enc_ops=[('backend', O_EMITPIX)],
3383 srcs=[
3384 ('s[0]', ('backend', SRC(0)), 's0'),
3385 ('s[2]', ('backend', SRC(1)), 's2')
3386 ]
3387 )
3388
3389 group_map(O_MOVI32,
3390 hdr=(I_IGRP_HDR_BITWISE, [
3391 ('opcnt', 'p0'),
3392 ('olchk', OM_OLCHK),
3393 ('w1p', False),
3394 ('w0p', True),
3395 ('cc', OM_EXEC_CND),
3396 ('end', OM_END),
3397 ('atom', OM_ATOM),
3398 ('rpt', OM_RPT)
3399 ]),
3400 enc_ops=[('0', O_BBYP0BM_IMM32, ['ft0', DEST(0)], ['s0', SRC(0)])],
3401 dests=[('w[0]', ('0', DEST(1)), 'ft1')]
3402 )
3403
3404 group_map(O_CBS,
3405 hdr=(I_IGRP_HDR_BITWISE, [
3406 ('opcnt', 'p0'),
3407 ('olchk', OM_OLCHK),
3408 ('w1p', True),
3409 ('w0p', False),
3410 ('cc', OM_EXEC_CND),
3411 ('end', OM_END),
3412 ('atom', OM_ATOM),
3413 ('rpt', OM_RPT)
3414 ]),
3415 enc_ops=[('0', O_CBS)],
3416 srcs=[('s[2]', ('0', SRC(0)), 's2')],
3417 dests=[('w[1]', ('0', DEST(0)), 'ft3')]
3418 )
3419
3420 group_map(O_FTB,
3421 hdr=(I_IGRP_HDR_BITWISE, [
3422 ('opcnt', 'p0'),
3423 ('olchk', OM_OLCHK),
3424 ('w1p', True),
3425 ('w0p', False),
3426 ('cc', OM_EXEC_CND),
3427 ('end', OM_END),
3428 ('atom', OM_ATOM),
3429 ('rpt', OM_RPT)
3430 ]),
3431 enc_ops=[('0', O_FTB)],
3432 srcs=[('s[2]', ('0', SRC(0)), 's2')],
3433 dests=[('w[1]', ('0', DEST(0)), 'ft3')]
3434 )
3435
3436 group_map(O_REV,
3437 hdr=(I_IGRP_HDR_BITWISE, [
3438 ('opcnt', 'p0'),
3439 ('olchk', OM_OLCHK),
3440 ('w1p', True),
3441 ('w0p', False),
3442 ('cc', OM_EXEC_CND),
3443 ('end', OM_END),
3444 ('atom', OM_ATOM),
3445 ('rpt', OM_RPT)
3446 ]),
3447 enc_ops=[('0', O_REV)],
3448 srcs=[('s[2]', ('0', SRC(0)), 's2')],
3449 dests=[('w[1]', ('0', DEST(0)), 'ft2')]
3450 )
3451
3452 group_map(O_SHUFFLE,
3453 hdr=(I_IGRP_HDR_BITWISE, [
3454 ('opcnt', 'p0'),
3455 ('olchk', OM_OLCHK),
3456 ('w1p', True),
3457 ('w0p', False),
3458 ('cc', OM_EXEC_CND),
3459 ('end', OM_END),
3460 ('atom', OM_ATOM),
3461 ('rpt', OM_RPT)
3462 ]),
3463 enc_ops=[('0', O_SHUFFLE)],
3464 srcs=[
3465 ('s[1]', ('0', SRC(1)), 's1'),
3466 ('s[2]', ('0', SRC(0)), 's2')
3467 ],
3468 dests=[('w[1]', ('0', DEST(0)), 'ft2')]
3469 )
3470
3471 group_map(O_LOGICAL,
3472 hdr=(I_IGRP_HDR_BITWISE, [
3473 ('opcnt', ['p0', 'p1']),
3474 ('olchk', OM_OLCHK),
3475 ('w1p', False),
3476 ('w0p', True),
3477 ('cc', OM_EXEC_CND),
3478 ('end', OM_END),
3479 ('atom', OM_ATOM),
3480 ('rpt', OM_RPT)
3481 ]),
3482 enc_ops=[
3483 ('0', O_BBYP0S1, ['ft2', 'ft3'], [SRC(1)]),
3484 ('1', O_LOGICAL, [DEST(0)], [SRC(0), 'ft2', SRC(2), SRC(3)], [(OM_LOGIOP, OM_LOGIOP)])
3485 ],
3486 srcs=[
3487 ('s[2]', ('0', SRC(0)), 's2'),
3488 ('s[3]', ('1', SRC(3)), 's3')
3489 ],
3490 dests=[('w[0]', ('1', DEST(0)), 'ft4')]
3491 )
3492
3493 group_map(O_SHIFT,
3494 hdr=(I_IGRP_HDR_BITWISE, [
3495 ('opcnt', ['p0', 'p2']),
3496 ('olchk', OM_OLCHK),
3497 ('w1p', False),
3498 ('w0p', True),
3499 ('cc', OM_EXEC_CND),
3500 ('end', OM_END),
3501 ('atom', OM_ATOM),
3502 ('rpt', OM_RPT)
3503 ]),
3504 enc_ops=[
3505 ('0', O_BBYP0BM, ['ft0', 'ft1'], ['s0', SRC(0)]),
3506 ('2', O_SHIFT, [DEST(0)], ['ft4', SRC(1), SRC(2)], [(OM_SHIFTOP, OM_SHIFTOP)])
3507 ],
3508 srcs=[
3509 ('s[1]', ('0', SRC(1)), 's1'),
3510 ('s[4]', ('2', SRC(1)), 's4')
3511 ],
3512 dests=[('w[0]', ('2', DEST(0)), 'ft5')]
3513 )
3514
3515 group_map(O_COPYSIGN,
3516 hdr=(I_IGRP_HDR_BITWISE, [
3517 ('opcnt', ['p0', 'p1']),
3518 ('olchk', OM_OLCHK),
3519 ('w1p', False),
3520 ('w0p', True),
3521 ('cc', OM_EXEC_CND),
3522 ('end', OM_END),
3523 ('atom', OM_ATOM),
3524 ('rpt', OM_RPT)
3525 ]),
3526 enc_ops=[
3527 ('0', O_MSK_BBYP0S1, ['ft0', 'ft1', 'ft2'], ['pco_31', 'pco_zero', SRC(0)]),
3528 ('1', O_LOGICAL, [DEST(0)], ['ft1', 'ft2', 'ft1_invert', SRC(1)], [(OM_LOGIOP, 'or')])
3529 ],
3530 srcs=[
3531 ('s[0]', ('0', SRC(0)), 's0'),
3532 ('s[1]', ('0', SRC(1)), 's1'),
3533 ('s[2]', ('0', SRC(2)), 's2'),
3534 ('s[3]', ('1', SRC(3)), 's3')
3535 ],
3536 dests=[('w[0]', ('1', DEST(0)), 'ft4')]
3537 )
3538
3539 group_map(O_IBFE,
3540 hdr=(I_IGRP_HDR_BITWISE, [
3541 ('opcnt', ['p0', 'p1', 'p2']),
3542 ('olchk', OM_OLCHK),
3543 ('w1p', False),
3544 ('w0p', True),
3545 ('cc', OM_EXEC_CND),
3546 ('end', OM_END),
3547 ('atom', OM_ATOM),
3548 ('rpt', OM_RPT)
3549 ]),
3550 enc_ops=[
3551 ('0', O_MSK_BBYP0S1, ['ft0', 'ft1', 'ft2'], [SRC(2), SRC(1), SRC(0)]),
3552 ('1', O_LOGICAL, ['ft4'], ['ft1', 'ft2', 'ft1_invert', 'pco_zero'], [(OM_LOGIOP, 'or')]),
3553 ('2', O_SHIFT, [DEST(0)], ['ft4', SRC(1), 'ft0'], [(OM_SHIFTOP, 'asr_mtb')])
3554 ],
3555 srcs=[
3556 ('s[0]', ('0', SRC(0)), 's0'),
3557 ('s[1]', ('0', SRC(1)), 's1'),
3558 ('s[2]', ('0', SRC(2)), 's2'),
3559 ('s[3]', ('1', SRC(3)), 's3'),
3560 ('s[4]', ('2', SRC(1)), 's4')
3561 ],
3562 dests=[('w[0]', ('2', DEST(0)), 'ft5')]
3563 )
3564
3565 group_map(O_UBFE,
3566 hdr=(I_IGRP_HDR_BITWISE, [
3567 ('opcnt', ['p0', 'p1', 'p2']),
3568 ('olchk', OM_OLCHK),
3569 ('w1p', False),
3570 ('w0p', True),
3571 ('cc', OM_EXEC_CND),
3572 ('end', OM_END),
3573 ('atom', OM_ATOM),
3574 ('rpt', OM_RPT)
3575 ]),
3576 enc_ops=[
3577 ('0', O_MSK_BBYP0S1, ['ft0', 'ft1', 'ft2'], [SRC(2), SRC(1), SRC(0)]),
3578 ('1', O_LOGICAL, ['ft4'], ['ft1', 'ft2', 'ft1_invert', 'pco_zero'], [(OM_LOGIOP, 'or')]),
3579 ('2', O_SHIFT, [DEST(0)], ['ft4', SRC(1), '_'], [(OM_SHIFTOP, 'shr')])
3580 ],
3581 srcs=[
3582 ('s[0]', ('0', SRC(0)), 's0'),
3583 ('s[1]', ('0', SRC(1)), 's1'),
3584 ('s[2]', ('0', SRC(2)), 's2'),
3585 ('s[3]', ('1', SRC(3)), 's3'),
3586 ('s[4]', ('2', SRC(1)), 's4')
3587 ],
3588 dests=[('w[0]', ('2', DEST(0)), 'ft5')]
3589 )
3590
3591 group_map(O_BFI,
3592 hdr=(I_IGRP_HDR_BITWISE, [
3593 ('opcnt', ['p0', 'p1']),
3594 ('olchk', OM_OLCHK),
3595 ('w1p', False),
3596 ('w0p', True),
3597 ('cc', OM_EXEC_CND),
3598 ('end', OM_END),
3599 ('atom', OM_ATOM),
3600 ('rpt', OM_RPT)
3601 ]),
3602 enc_ops=[
3603 ('0', O_MSK_LSL, ['ft0', 'ft1', 'ft2'], [SRC(3), SRC(2), SRC(1)]),
3604 ('1', O_LOGICAL, [DEST(0)], ['ft1', 'ft2', 'ft1_invert', SRC(0)], [(OM_LOGIOP, 'or')]),
3605 ],
3606 srcs=[
3607 ('s[0]', ('0', SRC(0)), 's0'),
3608 ('s[1]', ('0', SRC(1)), 's1'),
3609 ('s[2]', ('0', SRC(2)), 's2'),
3610 ('s[3]', ('1', SRC(3)), 's3'),
3611 ],
3612 dests=[('w[0]', ('1', DEST(0)), 'ft4')]
3613 )
3614
3615 group_map(O_WOP,
3616 hdr=(I_IGRP_HDR_CONTROL, [
3617 ('olchk', False),
3618 ('w1p', False),
3619 ('w0p', False),
3620 ('cc', 'e1_zx'),
3621 ('miscctl', 0),
3622 ('ctrlop', 'wop')
3623 ]),
3624 enc_ops=[('ctrl', O_WOP),]
3625 )
3626
3627 group_map(O_WDF,
3628 hdr=(I_IGRP_HDR_CONTROL, [
3629 ('olchk', False),
3630 ('w1p', False),
3631 ('w0p', False),
3632 ('cc', 'e1_zx'),
3633 ('miscctl', ('pco_ref_get_drc', SRC(0))),
3634 ('ctrlop', 'wdf')
3635 ]),
3636 enc_ops=[('ctrl', O_WDF)]
3637 )
3638
3639 group_map(O_NOP,
3640 hdr=(I_IGRP_HDR_CONTROL, [
3641 ('olchk', False),
3642 ('w1p', False),
3643 ('w0p', False),
3644 ('cc', OM_EXEC_CND),
3645 ('miscctl', OM_END),
3646 ('ctrlop', 'nop')
3647 ]),
3648 enc_ops=[('ctrl', O_NOP)]
3649 )
3650
3651 group_map(O_DITR,
3652 hdr=(I_IGRP_HDR_CONTROL, [
3653 ('olchk', False),
3654 ('w1p', False),
3655 ('w0p', False),
3656 ('cc', OM_EXEC_CND),
3657 ('miscctl', False),
3658 ('ctrlop', 'ditr')
3659 ]),
3660 enc_ops=[('ctrl', O_DITR)]
3661 )
3662
3663 group_map(O_DITRP,
3664 hdr=(I_IGRP_HDR_CONTROL, [
3665 ('olchk', False),
3666 ('w1p', False),
3667 ('w0p', False),
3668 ('cc', OM_EXEC_CND),
3669 ('miscctl', False),
3670 ('ctrlop', 'ditr')
3671 ]),
3672 enc_ops=[('ctrl', O_DITRP)]
3673 )
3674
3675 group_map(O_CNDST,
3676 hdr=(I_IGRP_HDR_CONTROL, [
3677 ('olchk', False),
3678 ('w1p', False),
3679 ('w0p', True),
3680 ('cc', OM_EXEC_CND),
3681 ('miscctl', False),
3682 ('ctrlop', 'cnd')
3683 ]),
3684 enc_ops=[('ctrl', O_CNDST)],
3685 srcs=[
3686 ('s[0]', ('ctrl', SRC(0)), 's0'),
3687 ('s[3]', 'pco_zero')
3688 ],
3689 dests=[('w[0]', ('ctrl', DEST(1)), 'w0')]
3690 )
3691
3692 group_map(O_CNDEF,
3693 hdr=(I_IGRP_HDR_CONTROL, [
3694 ('olchk', False),
3695 ('w1p', False),
3696 ('w0p', True),
3697 ('cc', OM_EXEC_CND),
3698 ('miscctl', False),
3699 ('ctrlop', 'cnd')
3700 ]),
3701 enc_ops=[('ctrl', O_CNDEF)],
3702 srcs=[
3703 ('s[0]', ('ctrl', SRC(0)), 's0'),
3704 ('s[3]', 'pco_zero')
3705 ],
3706 dests=[('w[0]', ('ctrl', DEST(1)), 'w0')]
3707 )
3708
3709 group_map(O_CNDSM,
3710 hdr=(I_IGRP_HDR_CONTROL, [
3711 ('olchk', False),
3712 ('w1p', False),
3713 ('w0p', True),
3714 ('cc', OM_EXEC_CND),
3715 ('miscctl', False),
3716 ('ctrlop', 'cnd')
3717 ]),
3718 enc_ops=[('ctrl', O_CNDSM)],
3719 srcs=[
3720 ('s[0]', ('ctrl', SRC(0)), 's0'),
3721 ('s[2]', ('ctrl', SRC(1)), 's2'),
3722 ('s[3]', 'pco_zero')
3723 ],
3724 dests=[('w[0]', ('ctrl', DEST(1)), 'w0')]
3725 )
3726
3727 group_map(O_CNDLT,
3728 hdr=(I_IGRP_HDR_CONTROL, [
3729 ('olchk', False),
3730 ('w1p', False),
3731 ('w0p', True),
3732 ('cc', OM_EXEC_CND),
3733 ('miscctl', False),
3734 ('ctrlop', 'cnd')
3735 ]),
3736 enc_ops=[('ctrl', O_CNDLT)],
3737 srcs=[
3738 ('s[0]', ('ctrl', SRC(0)), 's0'),
3739 ('s[3]', 'pco_zero')
3740 ],
3741 dests=[('w[0]', ('ctrl', DEST(1)), 'w0')]
3742 )
3743
3744 group_map(O_CNDEND,
3745 hdr=(I_IGRP_HDR_CONTROL, [
3746 ('olchk', False),
3747 ('w1p', False),
3748 ('w0p', True),
3749 ('cc', OM_EXEC_CND),
3750 ('miscctl', False),
3751 ('ctrlop', 'cnd')
3752 ]),
3753 enc_ops=[('ctrl', O_CNDEND)],
3754 srcs=[
3755 ('s[0]', ('ctrl', SRC(0)), 's0'),
3756 ('s[3]', 'pco_zero')
3757 ],
3758 dests=[('w[0]', ('ctrl', DEST(1)), 'w0')]
3759 )
3760
3761 group_map(O_BR,
3762 hdr=(I_IGRP_HDR_CONTROL, [
3763 ('olchk', False),
3764 ('w1p', False),
3765 ('w0p', False),
3766 ('cc', OM_EXEC_CND),
3767 ('miscctl', False),
3768 ('ctrlop', 'b')
3769 ]),
3770 enc_ops=[('ctrl', O_BR)]
3771 )
3772
3773 group_map(O_BR_NEXT,
3774 hdr=(I_IGRP_HDR_CONTROL, [
3775 ('olchk', False),
3776 ('w1p', False),
3777 ('w0p', False),
3778 ('cc', OM_EXEC_CND),
3779 ('miscctl', False),
3780 ('ctrlop', 'b')
3781 ]),
3782 enc_ops=[('ctrl', O_BR_NEXT)]
3783 )
3784
3785 group_map(O_MUTEX,
3786 hdr=(I_IGRP_HDR_CONTROL, [
3787 ('olchk', False),
3788 ('w1p', False),
3789 ('w0p', False),
3790 ('cc', 'e1_zx'),
3791 ('miscctl', False),
3792 ('ctrlop', 'mutex')
3793 ]),
3794 enc_ops=[('ctrl', O_MUTEX)]
3795 )