From: Vincent Lejeune Date: Thu, 4 Apr 2013 14:00:09 +0000 (+0000) Subject: R600: Use a mask for offsets when encoding instructions X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=af6f407432b0ef52efd82bd0da7256278e6efc58;p=oota-llvm.git 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 --- diff --git a/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp b/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp index 6ef4d40934a..927bcbd8305 100644 --- a/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp +++ b/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp @@ -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) {