[clang] [llvm] [SystemZ] Add support for half (fp16) (PR #109164)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 7 00:16:36 PDT 2024


================
@@ -784,6 +791,20 @@ bool SystemZTargetLowering::useSoftFloat() const {
   return Subtarget.hasSoftFloat();
 }
 
+MVT SystemZTargetLowering::getRegisterTypeForCallingConv(
+      LLVMContext &Context, CallingConv::ID CC,
+      EVT VT) const {
+  // 128-bit single-element vector types are passed like other vectors,
+  // not like their element type.
+  if (VT.isVector() && VT.getSizeInBits() == 128 &&
+      VT.getVectorNumElements() == 1)
+    return MVT::v16i8;
+  // Keep f16 so that they can be recognized and handled.
+  if (VT == MVT::f16)
----------------
arsenm wrote:

I assume this is because it's an illegal type. It would be much nicer if calling convention code just always worked on the original types to begin with 

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


More information about the llvm-commits mailing list