pan/bit: Add swizzles to round tests
[mesa.git] / src / panfrost / bifrost / bifrost_nir_algebraic.py
index 1fb49b1c69063d9e678e0bf04f326813a86444aa..5e2c65c68ac59bf68eb3a24102fd2214586cf91a 100644 (file)
@@ -38,8 +38,9 @@ algebraic_late = [
     (('ineg', a), ('isub', 0, a)),
 ]
 
-for sz in ('16', '32', '64'):
-        algebraic_late += [(('b2f' + sz, 'a@1'), ('bcsel', a, 1.0, 0.0))]
+for isz in ('8', '16', '32'):
+        for osz in ('16', '32', '64'):
+                algebraic_late += [(('b2f' + osz, 'a@' + isz), ('b' + isz + 'csel', a, 1.0, 0.0))]
 
 # Midgard is able to type convert down by only one "step" per instruction; if
 # NIR wants more than one step, we need to break up into multiple instructions
@@ -79,6 +80,12 @@ for op in ('u2u', 'i2i', 'f2f', 'i2f', 'u2f', 'f2i', 'f2u'):
             srcsz *= 2
         dstsz *= 2
 
+# Bifrost doesn't have fp16 for a lot of special ops
+SPECIAL = ['fexp2', 'flog2', 'fsin', 'fcos']
+
+for op in SPECIAL:
+        converts += [((op + '@16', a), ('f2f16', (op, ('f2f32', a))))]
+
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument('-p', '--import-path', required=True)