New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMDGPU][MC][GFX11] Lacking MC tests for several gfx11 instructions #56887
Comments
@llvm/issue-subscribers-backend-amdgpu |
Sure. I can also generate tests in true 16-bit syntax (SP3-like) - they can be disabled by |
Thanks! I've got no issue with splitting large tests. Generating tests in true 16-bit syntax (.l/.h) will need to happen eventually, so if you have a clear idea how to do that, please go ahead. |
Do you prefer tests without VGPRs>127? These tests may be correctly assembled by SP3, for example:
It is accepted by SP3 and interpreted as follows:
If syntax w/o suffices will be supported by llvm assembler, such tests will require no modifications after switching to new syntax. |
Yes, I would prefer tests without VGPRs>127 (in the _e32 versions of the instructions). Unfortunately, it is not so easy to deduce whether a register is 16 or 32 bit in the AsmParser, so I think suffixes .l/.h will be required. Therefore, the current tests should have no suffixes, but when the True16 support is in place they will require modification (hopefully very mechanically) to be parsed correctly. |
Are you planning to support |
Good question, I don't have an answer to this yet. Yes I want to support the .h/.l syntax in VOP3/VOP3P. |
Well, it seems to me that it would be feasible to support I'm asking because I want to prepare test generator for new syntax before you start working on these features. Any estimations on when this may happen? Thanks. |
I think it is feasible as well. Thanks for working on the test suite. I am working on the true16 features and would guess given the current priorities the first emission with that syntax would be in about a month. |
I am almost done with what can be called True16 patch1. In this patch, I will restrict VOP1, VOP2, and VOPC instructions using 16 bit operands to only allow VGPRs <=127 for those operands. In addition to what coverage we have now, I think there should be the following MC Test coverage.
Disassembly
Does any of that overlap with your planned work @dpreobra? |
I planned to generate tests for these cases, but it will take some time.
I assume we do not need full-fledged tests for this case, do we? Because eventually (with full true 16 bit operand support) every encoded VGPR value would be valid. Maybe a few tests for this case would suffice? |
Ok, thanks for letting me know. I will plan to generate all these tests that are required for the short term. Good point about the disassembler tests not needing to be full-fledged because of the eventual change again. |
The script supports a ‘legacy’ mode with v0..v127 and no .h/.l and a ‘true16bit’ mode with 128 .h/.l registers. It would not be difficult to generate tests we discussed above. Does this have higher priority than GFX11 test coverage analysis and update? |
From that description, neither of the modes directly supports the tests I suggested. I think they are roughly equal in priority. Thanks for being flexible; no need to change your focus. |
There is a comment in VOP3P.DPP tests stating that
I saw this requirement in SPG but was unsure if it was a mistake or not. SP3 does allow using arbitrary
Do you think we shall enforce this requirement on |
My comment is about what is done in code generation. AMDGPUDAGToDAGISel::SelectFMAD_FMA Says we only use these instructions when "there is actually an operand using the conversion from f16." @arsenm wrote that code and can confirm if that is the behavior
So I think its fine to test all op_sel combinations and accept them in the Assembler. |
Thanks, I see. Actually my question was about Ok, I'll generate tests for |
Enclosed are tests for true 16 bit operands (VOP1, VOP2 and VOPC). They are intended as a drop-in replacement for existing tests when true 16bit support is implemented. Please let me know if you find any issues while using the tests. |
I am using those test for my current True16 development. They are very useful, thanks! I think this ticket can be considered done, I will close it. |
We have tests for the dpp versions of these instructions, but not the base _e32 or _e64 versions.
These tests will be useful for catching regressions in planned work to support true16 instructions.
Currently, these instructions will not be emitted using registers above 127, but they can be assembled or disassembled with those high registers. The asm and disasm will be incorrect from the perspective of what the hardware will do. For example
Input:
Output:
True behavior of object code with 0xff,0xb9,0x00,0x7e :
VOP2:
v_mul_f16
v_min_f16
v_max_f16
v_ldexp_f16
v_add_f16
v_sub_f16
VOP1:
V_CVT_F16_U16
V_CVT_F16_I16
V_CVT_U16_F16
V_CVT_I16_F16
V_RCP_F16
V_SQRT_F16
V_RSQ_F16
V_LOG_F16
V_EXP_F16
V_SIN_F16
V_COS_F16
V_FREXP_MANT_F16
V_FREXP_EXP_I16_F16
V_FLOOR_F16
V_CEIL_F16
V_TRUNC_F16
V_RNDNE_F16
V_FRACT_F16
V_CVT_NORM_I16_F16
V_CVT_NORM_U16_F16
V_NOT_B16
V_CVT_I32_I16
@dpreobra Can you please help with creating the tests?
The text was updated successfully, but these errors were encountered: