# helper variables for strings
tfloat = "float"
tint = "int"
-tbool = "bool32"
+tbool32 = "bool32"
tuint = "uint"
tuint16 = "uint16"
tfloat32 = "float32"
# We'll hand-code the to/from bool conversion opcodes. Because bool doesn't
# have multiple bit-sizes, we can always infer the size from the other type.
-unop_convert("f2b", tbool, tfloat, "src0 != 0.0")
-unop_convert("i2b", tbool, tint, "src0 != 0")
-unop_convert("b2f", tfloat, tbool, "src0 ? 1.0 : 0.0")
-unop_convert("b2i", tint, tbool, "src0 ? 1 : 0")
+unop_convert("f2b", tbool32, tfloat, "src0 != 0.0")
+unop_convert("i2b", tbool32, tint, "src0 != 0")
+unop_convert("b2f", tfloat, tbool32, "src0 ? 1.0 : 0.0")
+unop_convert("b2i", tint, tbool32, "src0 ? 1 : 0")
# Unary floating-point rounding operations.
binop_convert(name, ty, ty, alg_props, const_expr)
def binop_compare(name, ty, alg_props, const_expr):
- binop_convert(name, tbool, ty, alg_props, const_expr)
+ binop_convert(name, tbool32, ty, alg_props, const_expr)
def binop_horiz(name, out_size, out_type, src1_size, src1_type, src2_size,
src2_type, const_expr):
# integer-aware GLSL-style comparisons that compare floats and ints
-binop_reduce("ball_fequal", 1, tbool, tfloat, "{src0} == {src1}",
+binop_reduce("ball_fequal", 1, tbool32, tfloat, "{src0} == {src1}",
"{src0} && {src1}", "{src}")
-binop_reduce("bany_fnequal", 1, tbool, tfloat, "{src0} != {src1}",
+binop_reduce("bany_fnequal", 1, tbool32, tfloat, "{src0} != {src1}",
"{src0} || {src1}", "{src}")
-binop_reduce("ball_iequal", 1, tbool, tint, "{src0} == {src1}",
+binop_reduce("ball_iequal", 1, tbool32, tint, "{src0} == {src1}",
"{src0} && {src1}", "{src}")
-binop_reduce("bany_inequal", 1, tbool, tint, "{src0} != {src1}",
+binop_reduce("bany_inequal", 1, tbool32, tint, "{src0} != {src1}",
"{src0} || {src1}", "{src}")
# non-integer-aware GLSL-style comparisons that return 0.0 or 1.0
triop("umed3", tuint, "MAX2(MIN2(MAX2(src0, src1), src2), MIN2(src0, src1))")
opcode("bcsel", 0, tuint, [0, 0, 0],
- [tbool, tuint, tuint], "", "src0 ? src1 : src2")
+ [tbool32, tuint, tuint], "", "src0 ? src1 : src2")
# SM5 bfi assembly
triop("bfi", tuint32, """