nir/opcodes: Make unpack_half_2x16_split_* variable-width
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 15 Aug 2018 16:58:50 +0000 (11:58 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 29 Aug 2018 19:04:02 +0000 (14:04 -0500)
There is nothing inherent about these opcodes that requires them to only
take scalars.  It's very convenient if we let them take vectors as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir_opcodes.py

index ed8e0ae9f395471769ccde4b4035380028c79090..4ef4ecc6f221ba42bf809050f0801910823b9076 100644 (file)
@@ -304,10 +304,10 @@ unop_horiz("unpack_32_2x16", 2, tuint16, 1, tuint32,
 # Lowered floating point unpacking operations.
 
 
-unop_horiz("unpack_half_2x16_split_x", 1, tfloat32, 1, tuint32,
-           "unpack_half_1x16((uint16_t)(src0.x & 0xffff))")
-unop_horiz("unpack_half_2x16_split_y", 1, tfloat32, 1, tuint32,
-           "unpack_half_1x16((uint16_t)(src0.x >> 16))")
+unop_convert("unpack_half_2x16_split_x", tfloat32, tuint32,
+             "unpack_half_1x16((uint16_t)(src0 & 0xffff))")
+unop_convert("unpack_half_2x16_split_y", tfloat32, tuint32,
+             "unpack_half_1x16((uint16_t)(src0 >> 16))")
 
 unop_convert("unpack_32_2x16_split_x", tuint16, tuint32, "src0")
 unop_convert("unpack_32_2x16_split_y", tuint16, tuint32, "src0 >> 16")