nir/opcodes: Simplify and fix the unpack_half_*_split_* constant expressions
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 26 Jan 2015 17:36:58 +0000 (09:36 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 26 Jan 2015 19:25:02 +0000 (11:25 -0800)
Previously, these functions were explicitly writing to dst.x and dst.y.
However they both return only one component so writing to dst.y is invalid.
Also, since they only return one component, we don't need the explicit
assignment in the expression and can simplify it use an implicit
assignment.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_opcodes.py

index 5fe957296ebcf61f6f466b29ad05024978123c55..0fa8bf543da4de7e3b509be35810042232ae1143 100644 (file)
@@ -252,12 +252,10 @@ unpack_2x16("half")
 # Lowered floating point unpacking operations.
 
 
-unop_horiz("unpack_half_2x16_split_x", 1, tfloat, 1, tunsigned, """
-dst.x = unpack_half_1x16((uint16_t)(src0.x & 0xffff));
-""")
-unop_horiz("unpack_half_2x16_split_y", 1, tfloat, 1, tunsigned, """
-dst.y = unpack_half_1x16((uint16_t)(src0.x >> 16));
-""")
+unop_horiz("unpack_half_2x16_split_x", 1, tfloat, 1, tunsigned,
+           "unpack_half_1x16((uint16_t)(src0.x & 0xffff))")
+unop_horiz("unpack_half_2x16_split_y", 1, tfloat, 1, tunsigned,
+           "unpack_half_1x16((uint16_t)(src0.x >> 16))")
 
 
 # Bit operations, part of ARB_gpu_shader5.