This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Assembler: Swap operands of flat_store instructions to match AMD assembler
ClosedPublic

Authored by nhaustov on Feb 5 2016, 7:51 AM.

Details

Summary

Historically, AMD internal sp3 assembler has flat_store* addr, data format. To match existing code and to enable reuse, change LLVM definitions to match.
Also update MC and CodeGen tests.

Diff Detail

Repository
rL LLVM

Event Timeline

nhaustov updated this revision to Diff 47017.Feb 5 2016, 7:51 AM
nhaustov retitled this revision from to AMDGPU: Assembler: Swap operands of flat_store instructions to match AMD assembler.
nhaustov updated this object.
nhaustov added reviewers: tstellarAMD, arsenm.
nhaustov set the repository for this revision to rL LLVM.
nhaustov added subscribers: vpykhtin, SamWot, artem.tamazov.
nhaustov retitled this revision from AMDGPU: Assembler: Swap operands of flat_store instructions to match AMD assembler to [AMDGPU] Assembler: Swap operands of flat_store instructions to match AMD assembler.Feb 5 2016, 7:56 AM
arsenm added inline comments.Feb 5 2016, 11:10 AM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

You should leave these trailing commas. These are to prevent doing something like matching v1 and succeeding on v10.

nhaustov added inline comments.Feb 5 2016, 1:06 PM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

This [[RESULT]] is the last operand of flat_store_dword after the change. I did not find any better way to match it, any suggestions?

arsenm added inline comments.Feb 5 2016, 1:09 PM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

You can use {{$}} to match the end of line

nhaustov added inline comments.Feb 5 2016, 1:13 PM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

Then it won't match for buffer, because it's not last operand.

arsenm added inline comments.Feb 5 2016, 1:15 PM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

We can use a different lines with a different check prefix for SI/VI, although it's probably not worth it for this. This is good enough

nhaustov added a project: Restricted Project.Feb 12 2016, 6:21 AM
nhaustov added inline comments.Feb 12 2016, 6:33 AM
test/CodeGen/AMDGPU/sint_to_fp.ll
106

If this is good enough, could you ok the review?

tstellarAMD accepted this revision.Feb 12 2016, 11:58 AM
tstellarAMD edited edge metadata.
This revision is now accepted and ready to land.Feb 12 2016, 11:58 AM