Re: [Mesa-dev] [PATCH 1/3] nir: Recognize open-coded extract_u8.

2016-03-02 Thread Kenneth Graunke
On Wednesday, March 2, 2016 3:45:57 PM PST Matt Turner wrote: > 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)

[Mesa-dev] [PATCH 1/3] nir: Recognize open-coded extract_u8.

2016-03-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)