(('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
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)