This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Allow accvgpr_read/write decode with opsel
ClosedPublic

Authored by rampitec on Feb 11 2021, 1:41 PM.

Details

Summary

These two instructions are VOP3P and have op_sel_hi bits,
however do not use op_sel_hi. That is recommended to set
unused op_sel_hi bits to 1. However, we cannot decode
both representations with 1 and 0 if bits are set to
default value 1. If bits are set to be ignored with '?'
initializer then encoding defaults them to 0.

The patch is a hack to force ignored '?' bits to 1 on
encoding for these instructions.

There is still canonicalization happens on disasm print
if incoming values are non-default, so that disasm output
does not match binary input, but this is pre-existing
problem for all instructions with '?' bits.

Fixes: SWDEV-272540

Diff Detail

Event Timeline

rampitec created this revision.Feb 11 2021, 1:41 PM
rampitec requested review of this revision.Feb 11 2021, 1:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2021, 1:41 PM
Herald added a subscriber: wdng. · View Herald Transcript
dp accepted this revision.Feb 12 2021, 6:35 AM

It is a pity we have to use such hacks but I do not see how to make it cleaner.

This revision is now accepted and ready to land.Feb 12 2021, 6:35 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Feb 12 2021, 12:21 PM

This seems to break tests on windows: http://45.33.8.238/win/33173/step_11.txt

PTAL, and revert for now if it takes a while to fix.

This seems to break tests on windows: http://45.33.8.238/win/33173/step_11.txt

PTAL, and revert for now if it takes a while to fix.

Ouch! Fix is trivial, constant shall be 1ull and not 1ul. I will fix it now.

This seems to break tests on windows: http://45.33.8.238/win/33173/step_11.txt

PTAL, and revert for now if it takes a while to fix.

Ouch! Fix is trivial, constant shall be 1ull and not 1ul. I will fix it now.

Sorry, fixed: https://reviews.llvm.org/rGc96e214b9ca7739737cf257baf32ff819854027d