This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix check prefix for VOP3 VI disassembler tests
ClosedPublic

Authored by foad on Oct 27 2020, 8:57 AM.

Details

Summary

Also, following D81841, don't try to encode f16 literals in i16/u16
instructions.

Diff Detail

Event Timeline

foad created this revision.Oct 27 2020, 8:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 8:57 AM
foad requested review of this revision.Oct 27 2020, 8:57 AM

These tests were added in D36322.

A similar fix for the VOP2 GFX9 tests was made in D36674.

llvm/test/MC/Disassembler/AMDGPU/vop3_vi.txt
299–300

The inline constant is disassembled as 0x3800 not 0.5.

SIMCCodeEmitter does not recognise this constant as an inline 16-bit integer, so the encoding: line shows 0xff not 0xf0.

What is the correct behaviour here?

rampitec added inline comments.Oct 27 2020, 9:36 AM
llvm/test/MC/Disassembler/AMDGPU/vop3_vi.txt
299–300

It should be f0.

dp added inline comments.Oct 27 2020, 9:55 AM
llvm/test/MC/Disassembler/AMDGPU/vop3_vi.txt
299–300

I believe 0xff is an expected result. Change 5f5f566 disabled use of fp inline constants with 16-bit integer operands. When disassembled, these inline constants are deliberately printed in hex to stress that the value is not an inline constant but a literal.

And yes, the produced dump is incorrect (missing literal) but so is the original code.

rampitec added inline comments.Oct 27 2020, 10:07 AM
llvm/test/MC/Disassembler/AMDGPU/vop3_vi.txt
299–300

I would probably say the expected result is an error message if 0.5 cannot really be supported. Isn't it?

foad updated this revision to Diff 301051.Oct 27 2020, 10:24 AM

Update.

foad edited the summary of this revision. (Show Details)Oct 27 2020, 10:25 AM
dp added inline comments.Oct 27 2020, 10:26 AM
llvm/test/MC/Disassembler/AMDGPU/vop3_vi.txt
299–300

I agree, an error message would be helpful, but possibility to disassemble incorrect code is useful as well.

This revision is now accepted and ready to land.Oct 27 2020, 10:30 AM
This revision was landed with ongoing or failed builds.Oct 27 2020, 11:45 AM
This revision was automatically updated to reflect the committed changes.