upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/salu_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/salu_diff.py')
-rw-r--r--tools/salu_diff.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/salu_diff.py b/tools/salu_diff.py
index 244bee384..e34c5c96f 100644
--- a/tools/salu_diff.py
+++ b/tools/salu_diff.py
@@ -71,7 +71,8 @@ OUT_SCC = 30 # s_cselect_b32 s30, 1, 0 observes SCC at the end
71BFE_ANY = False # any s_bfe_* control word (--bfe-any), not only offset + width <= 32 71BFE_ANY = False # any s_bfe_* control word (--bfe-any), not only offset + width <= 32
72INLINE64 = False # inline constants in 64-bit positions (--inline64); the translator reads those as lane masks 72INLINE64 = False # inline constants in 64-bit positions (--inline64); the translator reads those as lane masks
73 73
74LANE_MASK_OPS = ("s_and_b64", "s_or_b64", "s_xor_b64", "s_andn2_b64", "s_orn2_b64", "s_not_b64", "s_wqm_b64", 74LANE_MASK_OPS = ("s_and_b64", "s_or_b64", "s_xor_b64", "s_andn2_b64", "s_orn2_b64", "s_nand_b64", "s_nor_b64",
75 "s_xnor_b64", "s_not_b64", "s_wqm_b64",
75 "s_wqm_b32", "s_cselect_b64", "s_bfm_b64") 76 "s_wqm_b32", "s_cselect_b64", "s_bfm_b64")
76 77
77INTERESTING = (0, 1, 2, 3, 31, 32, 33, 63, 64, 0x7FFFFFFF, 0x80000000, 0x80000001, 0xFFFFFFFF, 0xFFFFFFFE, 78INTERESTING = (0, 1, 2, 3, 31, 32, 33, 63, 64, 0x7FFFFFFF, 0x80000000, 0x80000001, 0xFFFFFFFF, 0xFFFFFFFE,
@@ -172,7 +173,9 @@ def _sop2():
172def _sop2_64(): 173def _sop2_64():
173 ops = {} 174 ops = {}
174 for name, f in (("and", lambda a, b: a & b), ("or", lambda a, b: a | b), ("xor", lambda a, b: a ^ b), 175 for name, f in (("and", lambda a, b: a & b), ("or", lambda a, b: a | b), ("xor", lambda a, b: a ^ b),
175 ("andn2", lambda a, b: a & ~b), ("orn2", lambda a, b: a | ~b)): 176 ("andn2", lambda a, b: a & ~b), ("orn2", lambda a, b: a | ~b),
177 ("nand", lambda a, b: ~(a & b)), ("nor", lambda a, b: ~(a | b)),
178 ("xnor", lambda a, b: ~(a ^ b))):
176 ops[f"s_{name}_b64"] = ("sop2_64", lambda a, b, c, f=f: (f(a, b) & M64, int(f(a, b) & M64 != 0))) 179 ops[f"s_{name}_b64"] = ("sop2_64", lambda a, b, c, f=f: (f(a, b) & M64, int(f(a, b) & M64 != 0)))
177 ops["s_cselect_b64"] = ("sop2_64", lambda a, b, c: (a if c else b, None)) 180 ops["s_cselect_b64"] = ("sop2_64", lambda a, b, c: (a if c else b, None))
178 ops["s_lshl_b64"] = ("sop2_64s", lambda a, b, c: ((a << (b & 63)) & M64, int((a << (b & 63)) & M64 != 0))) 181 ops["s_lshl_b64"] = ("sop2_64s", lambda a, b, c: ((a << (b & 63)) & M64, int((a << (b & 63)) & M64 != 0)))