Re: [Mesa-dev] [PATCH] i965/fs: Fix extract_i8/u8 to a 64-bit destination

2017-11-14 Thread Matt Turner
On Mon, Nov 13, 2017 at 11:20 PM, Jason Ekstrand wrote: > On November 13, 2017 22:54:02 Matt Turner wrote: > >> On Mon, Nov 13, 2017 at 10:06 PM, Jason Ekstrand >> wrote: >>> >>> On Mon, Nov 13, 2017 at 3:23 PM, Matt Turner wrote: The MOV instruction can extract bytes to words/do

Re: [Mesa-dev] [PATCH] i965/fs: Fix extract_i8/u8 to a 64-bit destination

2017-11-13 Thread Jason Ekstrand
On November 13, 2017 22:54:02 Matt Turner wrote: On Mon, Nov 13, 2017 at 10:06 PM, Jason Ekstrand wrote: On Mon, Nov 13, 2017 at 3:23 PM, Matt Turner wrote: The MOV instruction can extract bytes to words/double words, and words/double words to quadwords, but not byte to quadwords. For uns

Re: [Mesa-dev] [PATCH] i965/fs: Fix extract_i8/u8 to a 64-bit destination

2017-11-13 Thread Matt Turner
On Mon, Nov 13, 2017 at 10:06 PM, Jason Ekstrand wrote: > On Mon, Nov 13, 2017 at 3:23 PM, Matt Turner wrote: >> >> The MOV instruction can extract bytes to words/double words, and >> words/double words to quadwords, but not byte to quadwords. >> >> For unsigned byte to quadword, we can read them

Re: [Mesa-dev] [PATCH] i965/fs: Fix extract_i8/u8 to a 64-bit destination

2017-11-13 Thread Jason Ekstrand
On Mon, Nov 13, 2017 at 3:23 PM, Matt Turner wrote: > The MOV instruction can extract bytes to words/double words, and > words/double words to quadwords, but not byte to quadwords. > > For unsigned byte to quadword, we can read them as words and AND off the > high byte and extract to quadword in

[Mesa-dev] [PATCH] i965/fs: Fix extract_i8/u8 to a 64-bit destination

2017-11-13 Thread Matt Turner
The MOV instruction can extract bytes to words/double words, and words/double words to quadwords, but not byte to quadwords. For unsigned byte to quadword, we can read them as words and AND off the high byte and extract to quadword in one instruction. For signed bytes, we need to first sign extend