Re: [Mesa-dev] [RFC PATCH] nir: Add byte_extract operation.

2015-12-02 Thread Eric Anholt
Matt Turner writes: > Two shaders that appear in Unigine benchmarks (Heaven and Valley) unpack > three bytes from an integer and convert each into a float: > >float((val >> 16u) & 0xffu) >float((val >> 8u) & 0xffu) >float((val >> 0u) & 0xffu) > > Instead of shifting, masking, and ty

[Mesa-dev] [RFC PATCH] nir: Add byte_extract operation.

2015-12-02 Thread Matt Turner
Two shaders that appear in Unigine benchmarks (Heaven and Valley) unpack three bytes from an integer and convert each into a float: float((val >> 16u) & 0xffu) float((val >> 8u) & 0xffu) float((val >> 0u) & 0xffu) Instead of shifting, masking, and type converting like this: shr(8)