This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix handling of 16-bit immediates
ClosedPublic

Authored by arsenm on Dec 1 2016, 12:33 PM.

Details

Reviewers
tstellarAMD
Summary

Since 32-bit instructions with 32-bit input immediate behavior
are used to materialize 16-bit constants in 32-bit registers
for 16-bit instructions, determining the legality based
on the size is incorrect. Change operands to have the size
specified in the type.

Also adds a workaround for a disassembler bug that
produces an immediate MCOperand for an operand that
is supposed to be OPERAND_REGISTER.

The assembler appears to accept out of bounds immediates and
truncates them, but this seems to be an issue for 32-bit
already.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 79969.Dec 1 2016, 12:33 PM
arsenm retitled this revision from to AMDGPU: Fix handling of 16-bit immediates.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
arsenm updated this revision to Diff 80181.Dec 3 2016, 10:28 AM
arsenm edited edge metadata.
tstellarAMD accepted this revision.Dec 6 2016, 12:42 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 6 2016, 12:42 PM
arsenm closed this revision.EditedDec 9 2016, 10:23 AM

Actually r289306