This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][GFX11] Fix dst register class for V_CVT_U32_U16
ClosedPublic

Authored by Joe_Nash on Aug 29 2022, 12:19 PM.

Details

Summary

This instruction was referring to the wrong VOPProfile, likely due to a
typo, leading to an incorrect destination register type.

The MC layer will care about this change, but is NFC while 16-bit values
actually use 32 bit registers.

Diff Detail

Event Timeline

Joe_Nash created this revision.Aug 29 2022, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 12:19 PM
Joe_Nash requested review of this revision.Aug 29 2022, 12:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 29 2022, 12:19 PM

This instruction may not even be being used. Did we forget to implement an ISel pattern?

foad added a comment.Aug 30 2022, 4:04 AM

This instruction may not even be being used. Did we forget to implement an ISel pattern?

I'm not sure "forget" is the right word. Without True16 this, instruction is of marginal utility, it's just a slightly shorter encoding of an AND with 0xFFFF. Even with True16 it's not necessary, since you could always use either an AND or a LSHR by 16, but I suppose having a single instruction for both cases is nice for readability.

foad accepted this revision.Aug 30 2022, 4:04 AM
This revision is now accepted and ready to land.Aug 30 2022, 4:04 AM

This instruction may not even be being used. Did we forget to implement an ISel pattern?

I'm not sure "forget" is the right word. Without True16 this, instruction is of marginal utility, it's just a slightly shorter encoding of an AND with 0xFFFF. Even with True16 it's not necessary, since you could always use either an AND or a LSHR by 16, but I suppose having a single instruction for both cases is nice for readability.

Ok, thanks for that explanation. I was wondering how this instruction would be used. I will commit this to fix the obvious mistake.

This revision was landed with ongoing or failed builds.Aug 30 2022, 11:32 AM
This revision was automatically updated to reflect the committed changes.