[llvm] [NFC] Add useFPRegsForHalfType(). (PR #74147)

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 12:31:07 PST 2024


================
@@ -505,12 +505,18 @@ class TargetLoweringBase {
     return TypePromoteInteger;
   }
 
-  // Return true if the half type should be passed around as i16, but promoted
-  // to float around arithmetic. The default behavior is to pass around as
-  // float and convert around loads/stores/bitcasts and other places where
-  // the size matters.
+  // Return true if the half type should be promoted using soft promotion rules
+  // where each operation is promoted to f32 individually, then converted to
+  // fp16. The default behavior is to promote links of operations, keeping
+  // intermediate results in f32 precision and range.
   virtual bool softPromoteHalfType() const { return false; }
 
+  // Return true if, for soft-promoted half, the half type should be passed
+  // around as f32. The default behavior is to pass around as i16. If
----------------
kparzysz wrote:

Maybe instead of "should be passed around" have "should be passed in function calls".  Does this apply to return values as well?

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


More information about the llvm-commits mailing list