nouveau: codegen: LOAD: Take src swizzle into account
authorHans de Goede <hdegoede@redhat.com>
Thu, 31 Mar 2016 06:53:40 +0000 (08:53 +0200)
committerHans de Goede <hdegoede@redhat.com>
Wed, 27 Apr 2016 14:11:48 +0000 (16:11 +0200)
commitb5e7907f3089d72109610769f083e80e452b0ff2
treebb70a104242451f5b148cb56eead9a962e3f0ca2
parent90f45357abd4f0007aa3f047464b43188fed4ef1
nouveau: codegen: LOAD: Take src swizzle into account

The llvm TGSI backend uses pointers in registers and does things
like:

LOAD TEMP[0].y, MEMORY[0], TEMP[0]

Expecting the data at address TEMP[0].x to get loaded to
TEMP[0].y. But this will cause the data at TEMP[0].x + 4 to be
loaded instead.

This commit adds support for a swizzle suffix for the 1st source
operand, which allows using:

LOAD TEMP[0].y, MEMORY[0].xxxx, TEMP[0]

And actually getting the desired behavior

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/docs/source/tgsi.rst
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp