X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fcompiler%2Fnir%2Fnir_opcodes.py;h=06ae820c3e88a73132716afdca3eb152323ee216;hb=8ae03af4ed1ca47a106e5fd7b2d11ce4003aad54;hp=98692da7be6f6ad30e0895c239144cfd88246444;hpb=1fa432741c45cf9cdbdd416cd0f7b424f2ffc7a5;p=mesa.git diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py index 98692da7be6..06ae820c3e8 100644 --- a/src/compiler/nir/nir_opcodes.py +++ b/src/compiler/nir/nir_opcodes.py @@ -156,7 +156,7 @@ unop("fsign", tfloat, ("bit_size == 64 ? " + "((src0 == 0.0f) ? 0.0f : ((src0 > 0.0f) ? 1.0f : -1.0f))")) unop("isign", tint, "(src0 == 0) ? 0 : ((src0 > 0) ? 1 : -1)") unop("iabs", tint, "(src0 < 0) ? -src0 : src0") -unop("fabs", tfloat, "bit_size == 64 ? fabs(src0) : fabsf(src0)") +unop("fabs", tfloat, "fabs(src0)") unop("fsat", tfloat, ("bit_size == 64 ? " + "((src0 > 1.0) ? 1.0 : ((src0 <= 0.0) ? 0.0 : src0)) : " + "((src0 > 1.0f) ? 1.0f : ((src0 <= 0.0f) ? 0.0f : src0))")) @@ -174,7 +174,11 @@ for src_t in [tint, tuint, tfloat]: dst_types = [tint, tuint, tfloat] for dst_t in dst_types: - for bit_size in [32, 64]: + if dst_t == tfloat: + bit_sizes = [16, 32, 64] + else: + bit_sizes = [8, 16, 32, 64] + for bit_size in bit_sizes: unop_convert("{0}2{1}{2}".format(src_t[0], dst_t[0], bit_size), dst_t + str(bit_size), src_t, "src0") @@ -463,7 +467,7 @@ binop_reduce("fany_nequal", 1, tfloat32, tfloat32, "{src0} != {src1}", # and false respectively binop("slt", tfloat32, "", "(src0 < src1) ? 1.0f : 0.0f") # Set on Less Than -binop("sge", tfloat32, "", "(src0 >= src1) ? 1.0f : 0.0f") # Set on Greater or Equal +binop("sge", tfloat, "", "(src0 >= src1) ? 1.0f : 0.0f") # Set on Greater or Equal binop("seq", tfloat32, commutative, "(src0 == src1) ? 1.0f : 0.0f") # Set on Equal binop("sne", tfloat32, commutative, "(src0 != src1) ? 1.0f : 0.0f") # Set on Not Equal