R600: Use a mask for offsets when encoding instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178763 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vincent Lejeune 2013-04-04 14:00:09 +00:00
parent 51f7225f55
commit af6f407432

View File

@ -201,8 +201,11 @@ void R600MCCodeEmitter::EncodeInstruction(const MCInst &MI, raw_ostream &OS,
uint64_t CoordType[4] = {1, 1, 1, 1};
if (HasOffsets)
for (unsigned i = 0; i < 3; i++)
Offsets[i] = MI.getOperand(i + 2).getImm();
for (unsigned i = 0; i < 3; i++) {
int SignedOffset = MI.getOperand(i + 2).getImm();
Offsets[i] = (SignedOffset & 0x1F);
}
if (TextureType == TEXTURE_RECT ||
TextureType == TEXTURE_SHADOWRECT) {