OSDN Git Service

R600: Use a mask for offsets when encoding instructions
authorVincent Lejeune <vljn@ovi.com>
Thu, 4 Apr 2013 14:00:09 +0000 (14:00 +0000)
committerVincent Lejeune <vljn@ovi.com>
Thu, 4 Apr 2013 14:00:09 +0000 (14:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178763 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp

index 6ef4d40..927bcbd 100644 (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) {