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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 21:12:37 PST 2025


================
@@ -446,10 +448,11 @@ ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const {
 
     // The structure is passed as an unextended integer, a float, or a double.
     if (isFPArgumentType(SingleElementTy)) {
-      assert(Size == 32 || Size == 64);
+      assert(Size == 16 || Size == 32 || Size == 64);
       return ABIArgInfo::getDirect(
-          Size == 32 ? llvm::Type::getFloatTy(getVMContext())
-                     : llvm::Type::getDoubleTy(getVMContext()));
+          Size == 16   ? llvm::Type::getHalfTy(getVMContext())
----------------
arsenm wrote:

I don't think it matters if it's reachable or not, should write future proof code and avoid repeating this pattern 

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


More information about the llvm-commits mailing list