================
@@ -4002,8 +4012,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl 
GD, unsigned BuiltinID,
       Result = Builder.CreateBinaryIntrinsic(
           Ty->isSignedIntegerType() ? Intrinsic::smin : Intrinsic::umin, Op0,
           Op1, nullptr, "elt.min");
-    } else
-      Result = Builder.CreateMinNum(Op0, Op1, /*FMFSource=*/nullptr, 
"elt.min");
+    } else {
+      FastMathFlags FMF;
+      FMF.setNoSignedZeros(true);
----------------
wzssyqa wrote:

> I agree this should not continue to use minnum/maxnum, though that change 
> should not be part of this PR.
> 

So can we merge this PR?

> minnum/maxnum behavior has never been consistent across targets (or across 
> scenarios). 

In fact, all of the architectures that claims implement IEEE754-2008, has the 
same behavior:
     AArch64, MIPSr6, LoongArch, PowerPC/VSX
That's why I'd plan to define `minnum/maxnum` as the same as these 
architectures.

> But we could also add 
> __builtin_elementwise_maximumnum/__builtin_elementwise_minimnumnum

I will do it.

https://github.com/llvm/llvm-project/pull/113133
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to