[PATCH] D11604: AMDGPU/SI: Add support for 32-bit immediate SMRD offsets on SI

Tom Stellard thomas.stellard at amd.com
Thu Jul 30 11:18:30 PDT 2015


tstellarAMD marked an inline comment as done.

================
Comment at: lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:1587-1589
@@ +1586,5 @@
+bool AMDGPUOperand::isSMRDLiteralOffset() const {
+  // 32-bit literals are only supported on CI and we only want to use them
+  // when the offset is > 8-bits.
+  return isImm() && !isUInt<8>(getImm()) && isUInt<32>(getImm());
+}
----------------
Are you concerned that the value 0xff will be read as SRC_LITERAL rather than the actual offset?  Because there is no way to specify SRC_LITERAL using the assembler.

================
Comment at: test/CodeGen/AMDGPU/smrd.ll:19
@@ -17,3 +18,3 @@
 ; GCN-LABEL: {{^}}smrd1:
-; SI: s_load_dword s{{[0-9]}}, s[{{[0-9]:[0-9]}}], 0xff ; encoding: [0xff
+; SICI: s_load_dword s{{[0-9]}}, s[{{[0-9]:[0-9]}}], 0xff ; encoding: [0xff,0x{{[0-9]+[137]}}
 ; VI: s_load_dword s{{[0-9]}}, s[{{[0-9]:[0-9]}}], 0x3fc
----------------
I double -checked and 32-bit immediates are only supported on CI.  I updated this test to make sure it is using the 32-bit encoding of SMRD.


http://reviews.llvm.org/D11604







More information about the llvm-commits mailing list