nir: enforce 32-bit src type requirement for f2fmp and i2imp
authorMarek Olšák <marek.olsak@amd.com>
Fri, 4 Sep 2020 06:07:43 +0000 (02:07 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Sep 2020 23:35:13 +0000 (23:35 +0000)
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6283>

src/compiler/nir/nir_opcodes.py

index f3ed96a..99194af 100644 (file)
@@ -272,10 +272,9 @@ for src_t in [tint, tuint, tfloat, tbool]:
 # to remove it if the result is immediately converted back to 32 bits again.
 # This is generated as part of the precision lowering pass. mp stands for medium
 # precision.
-unop_numeric_convert("f2fmp", tfloat16, tfloat, opcodes["f2f16"].const_expr)
-unop_numeric_convert("i2imp", tint16, tint, opcodes["i2i16"].const_expr)
-# u2ump isn't defined, because the behavior is equal to i2imp if src has more
-# than 16 bits.
+unop_numeric_convert("f2fmp", tfloat16, tfloat32, opcodes["f2f16"].const_expr)
+unop_numeric_convert("i2imp", tint16, tint32, opcodes["i2i16"].const_expr)
+# u2ump isn't defined, because the behavior is equal to i2imp
 
 # Unary floating-point rounding operations.