[AMDGPU] Fix 64 bit DPP validation
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Wed, 5 May 2021 18:26:07 +0000 (11:26 -0700)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 6 May 2021 15:40:26 +0000 (08:40 -0700)
commit28f1d018b1c241968d3f426d81c6973b5cae7bcf
treee514177e5c660e11d1d4ad73e838635aef60e43c
parent338c1b701f23888eed67ca7e3214db175940df21
[AMDGPU] Fix 64 bit DPP validation

AMDGPUAsmParser::isSupportedDPPCtrl() was failing to correctly
find a DPP register operand, regadless of the position it is
always src0. Moved this check into a new validateDPP() method
where we have full instruction already. In particular it was
failing to reject this case:

v_cvt_u32_f64 v5, v[0:1] quad_perm:[0,2,1,1] row_mask:0xf bank_mask:0xf

Essentially it was broken for any case where size of dst and
src0 differ.

It also improves the diagnostics with a proper error message.

The check in the InstPrinter also drops verification of the dst
register as it does not have anything to do with the dpp operand.

Differential Revision: https://reviews.llvm.org/D101930
llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp
llvm/test/MC/AMDGPU/gfx9-asm-err.s
llvm/test/MC/AMDGPU/gfx90a_err.s