R600/SI: Fix indirect addressing with a negative constant offset
authorTom Stellard <thomas.stellard@amd.com>
Thu, 23 Apr 2015 20:32:01 +0000 (20:32 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Thu, 23 Apr 2015 20:32:01 +0000 (20:32 +0000)
commit8b0182af2fe4ce877824cb16c857248c1de13e58
tree795fd59394f6a99fa07d5d46eb545bdff1a67a7d
parent167668f8c82fb49949a058c867ddabb0c1ec48fe
R600/SI: Fix indirect addressing with a negative constant offset

When the base register index of the vector plus the constant offset
was less than zero, we were passing the wrong base register to the indirect
addressing instruction.

In this case, we need to set the base register to v0 and then add
the computed (negative) index to m0.

llvm-svn: 235641
llvm/lib/Target/R600/SILowerControlFlow.cpp
llvm/test/CodeGen/R600/indirect-addressing-si.ll