This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Assembler: Fix VOP3 only instructions
ClosedPublic

Authored by nhaustov on Feb 1 2016, 10:06 AM.

Details

Summary

Separate methods to convert parsed instructions to MCInst:

  • VOP3 only instructions (always create modifiers as operands in MCInst)
  • VOP2 instrunctions with modifiers (create modifiers as operands in MCInst when e64 encoding is forced or modifiers are parsed)
  • VOP2 instructions without modifiers (do not create modifiers as operands in MCInst)

Add VOP3Only flag. Pass HasMods flag to VOP3Common.
Simplify code that deals with modifiers (-1 is now same as 0). This is no longer needed.
Mark f16 type as allowing modifiers.
Add few tests (more will be added separately).
Update error message now correct.

Diff Detail

Repository
rL LLVM

Event Timeline

nhaustov updated this revision to Diff 46555.Feb 1 2016, 10:06 AM
nhaustov retitled this revision from to [AMDGPU] Assembler: Fix VOP3 only instructions.
nhaustov updated this object.
nhaustov set the repository for this revision to rL LLVM.
nhaustov added a subscriber: SamWot.
arsenm added inline comments.Feb 1 2016, 11:15 AM
lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
1892 ↗(On Diff #46555)

Variables are supposed start with a capital letter

lib/Target/AMDGPU/SIInstrInfo.td
1102 ↗(On Diff #46555)

This comment should now be removed

lib/Target/AMDGPU/SIInstrInfo.td
1104–1109 ↗(On Diff #46555)

This change seems unrelated to the rest of this patch. Is this required to fix the VOP3 operands?

nhaustov updated this revision to Diff 46621.Feb 2 2016, 12:00 AM

Fix variable names.
Remove f16 changes for now as they are not needed.

This revision was automatically updated to reflect the committed changes.