[clang] [llvm] [X86] Enable HasFastHalfType to prevent FP16 promotion and perform FABS/FNEG lowering (PR #189395)

Tharun V K via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 02:43:38 PDT 2026


================
@@ -471,6 +471,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
     SSELevel = std::max(SSELevel, Level);
 
     HasFloat16 = SSELevel >= SSE2;
+    if (HasFloat16)
+      HasFastHalfType = true;
----------------
tharunvk wrote:

Yes I agree other fp insts like fadd will be impacted. So I have removed this logic and handled fabs and fneg case separately in SelectionDAG LowerFP_ROUND

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


More information about the cfe-commits mailing list