Page MenuHomePhabricator

[AMDGPU] SDWA: Add assembler support for GFX9
ClosedPublic

Authored by SamWot on May 12 2017, 8:45 AM.

Details

Summary

Added separate pseudo and real instruction for GFX9 SDWA instructions.
Currently supports only in assembler.
Depends D32493

Event Timeline

SamWot created this revision.May 12 2017, 8:45 AM
arsenm added inline comments.May 12 2017, 12:07 PM
include/llvm/Target/Target.td
683–686

These generic code changes should be split into a separate patch

lib/Target/AMDGPU/SIDefines.h
121–124

SDWA9 isn't a clear description.

Can you add a comment somewhere describing the difference in SDWA encodings? I'm not sure what changed that requires all of this hassle

test/MC/AMDGPU/vop_sdwa.s
2

The convention I've been using so far for the VI+GFX9 has been GFX89, but it doesn't really matter

arsenm added inline comments.May 12 2017, 12:09 PM
lib/Target/AMDGPU/SIDefines.h
121–124

In particular it would be greatly preferable if we could have a single set of SDWA instructions for codegen purposes and have encoding pseudos for emission similar to the SI vs. VI handling currently

SamWot updated this revision to Diff 99309.May 17 2017, 8:34 AM

Rebased on top of master.
Renamed VI9 tests to GFX89.
Added commentary for SDWA on GFX9.

SamWot added inline comments.May 17 2017, 9:10 AM
lib/Target/AMDGPU/SIDefines.h
121–124

I wanted to combine pseudo instructions for VI and GFX9 but there are problems with that: VI and GFX9 SDWA instructions have different operands. E.g. GFX9 supports omod. Also on GFX9 there is no clamp for VOPC SDWA instructions.
Another problem is that on GFX9 it is allowed to pass SGPR as operand while on VI only VGPRs are allowed.

vpykhtin added a reviewer: dp.May 18 2017, 4:05 AM
SamWot updated this revision to Diff 99551.May 19 2017, 5:39 AM

Removed omod operand from pseudo instructions with integer dst

dp accepted this revision.May 22 2017, 11:25 AM

Looks good to me

This revision is now accepted and ready to land.May 22 2017, 11:25 AM

Removed omod operand from pseudo instructions with integer dst

It seems that have been done for Gfx9 only. Any reason for this? Perhaps it is worth to add a comment.

Removed omod operand from pseudo instructions with integer dst

It seems that have been done for Gfx9 only. Any reason for this? Perhaps it is worth to add a comment.

This was done only for this changes. It was done because it is not supported for SDWA on GFX9.

This revision was automatically updated to reflect the committed changes.