================ @@ -126,3 +138,23 @@ define void @f9(ptr %cptr, ptr %aptr, ptr %bptr) { store fp128 %c, ptr %cptr ret void } + +; Test f16 copies in which the sign comes from an f16. +define half @f10(half %a, half %b) { +; CHECK-LABEL: f10: +; CHECK: brasl %r14, copysignh@PLT ---------------- JonPsson1 wrote:
I have come to realize that these tests actually shouldn't involve copysignh at all, as here *libcalls* are tested. On the other hand, if I compile a C program with copysign() using _Float16, Clang emits calls to the *intrinsic*: ``` %0 = load half, ptr %v0, align 2, !tbaa !4 %conv = fpext half %0 to double %1 = load half, ptr %v1, align 2, !tbaa !4 %conv2 = fpext half %1 to double %2 = call double @llvm.copysign.f64(double %conv, double %conv2) ``` However the DAGCombiner will remove FPEXTs of the operands, so the backend still has to handle FCOPYSIGNs with one or two half operands (the ISD::FCOPYSIGN node can have the second argument of a different type). This is now implemented in lowerFCOPYSIGN() and tested in fp-copysign-03.ll. https://github.com/llvm/llvm-project/pull/109164 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits