tint = "int"
tbool = "bool"
tbool1 = "bool1"
+tbool16 = "bool16"
tbool32 = "bool32"
tuint = "uint"
tuint16 = "uint16"
if type_has_size(type_):
return [type_size(type_)]
elif type_ == 'bool':
- return [1, 32]
+ return [1, 16, 32]
elif type_ == 'float':
return [16, 32, 64]
else:
def binop_compare(name, ty, alg_props, const_expr):
binop_convert(name, tbool1, ty, alg_props, const_expr)
+def binop_compare16(name, ty, alg_props, const_expr):
+ binop_convert(name, tbool16, ty, alg_props, const_expr)
+
def binop_compare32(name, ty, alg_props, const_expr):
binop_convert(name, tbool32, ty, alg_props, const_expr)
def binop_compare_all_sizes(name, ty, alg_props, const_expr):
binop_compare(name, ty, alg_props, const_expr)
+ binop_compare16(name + "16", ty, alg_props, const_expr)
binop_compare32(name + "32", ty, alg_props, const_expr)
def binop_horiz(name, out_size, out_type, src1_size, src1_type, src2_size,
reduce_expr, final_expr):
binop_reduce(name, output_size, tbool1, src_type,
prereduce_expr, reduce_expr, final_expr)
+ binop_reduce("b16" + name[1:], output_size, tbool16, src_type,
+ prereduce_expr, reduce_expr, final_expr)
binop_reduce("b32" + name[1:], output_size, tbool32, src_type,
prereduce_expr, reduce_expr, final_expr)
opcode("bcsel", 0, tuint, [0, 0, 0],
[tbool1, tuint, tuint], False, "", "src0 ? src1 : src2")
+opcode("b16csel", 0, tuint, [0, 0, 0],
+ [tbool16, tuint, tuint], False, "", "src0 ? src1 : src2")
opcode("b32csel", 0, tuint, [0, 0, 0],
[tbool32, tuint, tuint], False, "", "src0 ? src1 : src2")