[llvm] [AMDGPU][MC] Implement fft and rotate modes for ds_swizzle_b32 (PR #108064)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 09:12:57 PDT 2024
================
@@ -8141,6 +8138,54 @@ AMDGPUAsmParser::parseSwizzleBitmaskPerm(int64_t &Imm) {
return true;
}
+bool AMDGPUAsmParser::parseSwizzleFFT(int64_t &Imm) {
+ using namespace llvm::AMDGPU::Swizzle;
+
+ if (!AMDGPU::isGFX9Plus(getSTI())) {
+ Error(getLoc(), "FFT mode swizzle not supported on this GPU");
+ return false;
+ }
+
+ int64_t Swizzle;
+ SMLoc Loc;
+ if (!parseSwizzleOperand(Swizzle, 0, FFT_SWIZZLE_MAX,
+ "FFT swizzle must be in the interval [0," +
+ Twine(FFT_SWIZZLE_MAX) + Twine(']'),
+ Loc))
+ return false;
+
+ Imm = FFT_MODE_ENC | Swizzle;
+ return true;
+}
+
+bool AMDGPUAsmParser::parseSwizzleRotate(int64_t &Imm) {
+ using namespace llvm::AMDGPU::Swizzle;
+
+ if (!AMDGPU::isGFX9Plus(getSTI())) {
----------------
jayfoad wrote:
@DadSchoorse I believe this is one of those cases that might happen to work, but for whatever reason was never fully verified in GFX8 hardware. So you can use it at your own risk if you want, but the decision not to document it was deliberate, and for the same reason I would be reluctant to support it in the LLVM assembler/disassembler.
https://github.com/llvm/llvm-project/pull/108064
More information about the llvm-commits
mailing list