Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Hans de Goede
Hi, On 08-04-16 17:45, Ilia Mirkin wrote: On Fri, Apr 8, 2016 at 11:28 AM, Hans de Goede wrote: When dealing with non vector variables the llvm register allocator will use TEMP[0].x then TEMP[0].y, etc. When loading something from a global buffer it will calculate the address to use, and stor

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Ilia Mirkin
On Fri, Apr 8, 2016 at 11:28 AM, Hans de Goede wrote: > When dealing with non vector variables the llvm register allocator > will use TEMP[0].x then TEMP[0].y, etc. > > When loading something from a global buffer it will calculate the > address to use, and store that in say TEMP[0].x, so it ends u

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Hans de Goede
Hi, On 08-04-16 17:02, Ilia Mirkin wrote: On Fri, Apr 8, 2016 at 5:27 AM, Hans de Goede wrote: Hi, On 07-04-16 15:58, Ilia Mirkin wrote: That's wrong. It used to work with the old RES[] code and if one cannot specify a source swizzle, then how can I do something like LOAD TEMP[0].y, MEM

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Ilia Mirkin
On Fri, Apr 8, 2016 at 5:27 AM, Hans de Goede wrote: > Hi, > > On 07-04-16 15:58, Ilia Mirkin wrote: >> >> That's wrong. > > > It used to work with the old RES[] code and if one cannot specify > a source swizzle, then how can I do something like > > LOAD TEMP[0].y, MEMORY[0], address > > And get t

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Ilia Mirkin
Ah, I may have read over your commit too hastily. Will have another look. On Apr 8, 2016 5:27 AM, "Hans de Goede" wrote: > Hi, > > On 07-04-16 15:58, Ilia Mirkin wrote: > >> That's wrong. >> > > It used to work with the old RES[] code and if one cannot specify > a source swizzle, then how can I d

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-08 Thread Hans de Goede
Hi, On 07-04-16 15:58, Ilia Mirkin wrote: That's wrong. It used to work with the old RES[] code and if one cannot specify a source swizzle, then how can I do something like LOAD TEMP[0].y, MEMORY[0], address And get the data at absolute global memory address "address" into TEMP[0].y ? This

Re: [Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-07 Thread Ilia Mirkin
That's wrong. The spec for the instruction needs to be clarified... The current nouveau impl is correct - only the .x of the address should be loaded, with up to 16 bytes read into the destination. On Thu, Apr 7, 2016 at 9:27 AM, Hans de Goede wrote: > The llvm TGSI backend does things like: > >

[Mesa-dev] [PATCH] nouveau: codegen: Take src swizzle into account on loads

2016-04-07 Thread Hans de Goede
The llvm TGSI backend does things like: LOAD TEMP[0].y, MEMORY[0]., TEMP[0].x Expecting the data at address TEMP[0].x to get loaded to TEMP[0].y. Before this commit the data at TEMP[0].x + 4 would be loaded instead. This commit fixes this. Signed-off-by: Hans de Goede --- src/gallium/drive