compiler/blob: Allow for fixed-size blobs with a NULL data pointer
[mesa.git] / src / compiler / nir / nir_opcodes.py
index 98692da7be6f6ad30e0895c239144cfd88246444..06ae820c3e88a73132716afdca3eb152323ee216 100644 (file)
@@ -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