See bug 35988:
Details
Diff Detail
Event Timeline
lib/Target/AMDGPU/MIMGInstructions.td | ||
---|---|---|
107 | What does the addr_rc.Size have to do with this? |
lib/Target/AMDGPU/MIMGInstructions.td | ||
---|---|---|
107 | We cannot disassemble all _V* variants of atomics. They have different address size, bit the size is not encoded. So we have to pick one address size and the smallest size looks the safest. BTW do you know why there are _V1, _V2 and _V4 variants but not V3? According to AMD docs, 3-element addresses are also valid. |
lib/Target/AMDGPU/MIMGInstructions.td | ||
---|---|---|
107 | I think that needs a comment. I don't think V3 is allowed for atomics based on the listed allowed dmask values |
lib/Target/AMDGPU/MIMGInstructions.td | ||
---|---|---|
107 | AFAIK dmask affects data size rather than address size. |
I started implementing 64-bit atomics and found out that disassembler should be enabled using 'MIMG_Mask' and 'channels'.
Otherwise we won't be able to reconstruct dst size.
I'm going to update this change one more time...
Dmitry, please consider the following (excerpt from GCN ISA manual):
It seems that data format and allowed DMASK values are implicitly defined by T#.
The number of address components also defined by T#.
Shall we invent a syntax elements to pass required surface information to the MIMG instructions?
This is an interesting idea, but T# is assumed to be in registers. Also note that GFX10 added a 'dim' field to encode address size.
I think we should fix known issues first and have at least 95% tests passed before contemplating any extensions/improvements.
The idea is to pass assumptions about T# to the assembler when MIMG instructions are being handled. Actual value of T# is obviously unavailable.
I think we should fix known issues first and have at least 95% tests passed before contemplating any extensions/improvements.
Absolutely. For now, let's make some (default) assumptions about T#. It would be nice (but not necessary) to see these assumptions implemented programmatically in this patch.
Looks like this is the final version. Initial implementation of 64-bit image atomics did not require any changes in this code.
Please review when you have time.
LGTM.
BTW it would be nice to have a comment explaining the limitations of MIMG support. In short:
- There is a fundamental limitation: only index of the beginning VGPR of address and data is specified/encoded. The number of actually used VGPRs are set implicitly (in the T#) and thus not known during assembling and disassembling.
- This limitation can not be overcame unless violation of the SP3 compatibility requirement
- Also there is a drawback related to CodeGen: the number of used VGPRs can be set to the power of 2 only, but actual number of VGPRs used is more diverse.
What does the addr_rc.Size have to do with this?