R600: Use correct encoding for Vertex Fetch instructions on Cayman
[oota-llvm.git] / lib / Target / R600 / MCTargetDesc / R600MCCodeEmitter.cpp
index 4d6c25c190bdc3e288ace40b42047cb6b756e8c2..f470783fe2a1666f3611669437b56578906ae271 100644 (file)
@@ -99,7 +99,9 @@ void R600MCCodeEmitter::EncodeInstruction(const MCInst &MI, raw_ostream &OS,
   } else if (IS_VTX(Desc)) {
     uint64_t InstWord01 = getBinaryCodeForInstr(MI, Fixups);
     uint32_t InstWord2 = MI.getOperand(2).getImm(); // Offset
-    InstWord2 |= 1 << 19;
+    if (!(STI.getFeatureBits() & AMDGPU::FeatureCaymanISA)) {
+      InstWord2 |= 1 << 19; // Mega-Fetch bit
+    }
 
     Emit(InstWord01, OS);
     Emit(InstWord2, OS);