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)
commit2aab32cade85edffed419419b1eb5f2beb43c358
tree1a9908faf0ab9865c762cf755ccb761c7db15394
parent391b2c39f7d738a9bf49fe404cdbf0fa0825e1a5
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235641 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/R600/SILowerControlFlow.cpp
test/CodeGen/R600/indirect-addressing-si.ll