Skip to content

Misleading error message when trying to use v128-v255 in VOPC encoding #59390

@Pierre-vh

Description

@Pierre-vh

On GFX10, this seems to be allowed:

echo "v_cmp_gt_u16 s2, v128" | /opt/rocm/llvm/bin/llvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encoding  -show-inst

But on GFX11, this results in an error:

echo "v_cmp_gt_u16 s2, v128" | /opt/rocm/llvm/bin/llvm-mc -arch=amdgcn -mcpu=gfx1100 -show-encoding  -show-inst

This appears to be an intentional limit added in https://reviews.llvm.org/D133723 - VOPC cannot encode registers >v127.
However, users could simply use the VOP3 encoding and use those registers just fine. For that, all they need to do is pass an explicit destination register (instead of the implied VCC), e.g.
v_cmp_gt_u16 vcc, s2, v128

Desired outcome:

A better error message indicating that the VOP3 variant of the instruction needs to be used would be helpful.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions