This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC][GFX10] Corrected definition of FLAT GLOBAL/SCRATCH instructions
ClosedPublic

Authored by dp on Oct 2 2019, 10:44 AM.

Details

Summary

Opcodes with negative offset are decoded incorrectly - the offset value is invalid. An example:

0xff,0x4f,0x30,0xdc,0x00,0x00,0x02,0x05

Should be decoded as follows:

scratch_load_dword v5, off, s2 offset:-1

Actual result is:

scratch_load_dword v5, off, s2 offset:2047

This issue is observed with GLOBAL/SCRATCH GFX10 instructions, FLAT opcodes are unaffected.

See bug 43483: https://bugs.llvm.org/show_bug.cgi?id=43483

Diff Detail

Event Timeline

dp created this revision.Oct 2 2019, 10:44 AM
rampitec accepted this revision.Oct 2 2019, 10:54 AM

LGTM with a nit: add a new line at the end of the test and submit.

test/MC/Disassembler/AMDGPU/flat_gfx10.txt
76

Please add a newline here.

This revision is now accepted and ready to land.Oct 2 2019, 10:54 AM
dp added a comment.Oct 2 2019, 11:10 AM

Sure. Thanks!

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2019, 5:14 AM