[llvm] [AMDGPU][True16][MC] 16bit vsrc and vdst support in MC (PR #104510)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 07:26:37 PDT 2024


================
@@ -1242,12 +1244,19 @@ class FPInputMods <FPInputModsMatchClass matchClass> : InputMods <matchClass> {
 }
 
 def FP16InputMods : FPInputMods<FP16InputModsMatchClass>;
-def FPT16InputMods : FPInputMods<FPT16InputModsMatchClass>;
+class FPT16InputMods<bit IsFake16> : FPInputMods<FPT16InputModsMatchClass<IsFake16>> {
+  let EncoderMethod = "getMachineOpValueT16";
+}
 def FP32InputMods : FPInputMods<FP32InputModsMatchClass>;
+def FP32T16DstInputMods : FPInputMods<FP32InputModsMatchClass> {
+  let EncoderMethod = "getMachineOpValueT16";
+}
 def FP64InputMods : FPInputMods<FP64InputModsMatchClass>;
 
-class FP16VCSrcInputMods<bit IsFake16>
-  : FPInputMods<FP16VCSrcInputModsMatchClass<IsFake16>>;
+class FPT16VCSrcInputMods<bit IsFake16 = 1>
----------------
kosarev wrote:

This looks a bit like an invitation to use the default value, which I'm not sure would be a good idea for these particular classes, considering the default semantics is not obvious in at least one of the mainline or the downstream branches, if not both. Also, adding things that we don't really use goes a bit against common practice for reasons such as wasting resources changing and maintaining them. But probably not a big deal either way, so up to you to decide.

https://github.com/llvm/llvm-project/pull/104510


More information about the llvm-commits mailing list