1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 #include "../int_math.h"
8 #define makeFinite(x) \
10 (x).s.hi = crt_copysign(crt_isinf((x).s.hi) ? 1.0 : 0.0, (x).s.hi); \
16 if (crt_isnan((x).s.hi)) { \
17 (x).s.hi = crt_copysign(0.0, (x).s.hi); \
22 long double _Complex __multc3(long double a, long double b, long double c,
24 long double ac = __gcc_qmul(a, c);
25 long double bd = __gcc_qmul(b, d);
26 long double ad = __gcc_qmul(a, d);
27 long double bc = __gcc_qmul(b, c);
29 DD real = {.ld = __gcc_qsub(ac, bd)};
30 DD imag = {.ld = __gcc_qadd(ad, bc)};
32 if (crt_isnan(real.s.hi) && crt_isnan(imag.s.hi)) {
40 if (crt_isinf(aDD.s.hi) || crt_isinf(bDD.s.hi)) {
48 if (crt_isinf(cDD.s.hi) || crt_isinf(dDD.s.hi)) {
62 if (crt_isinf(acDD.s.hi) || crt_isinf(bdDD.s.hi) ||
63 crt_isinf(adDD.s.hi) || crt_isinf(bcDD.s.hi)) {
73 real.s.hi = CRT_INFINITY * (aDD.s.hi * cDD.s.hi - bDD.s.hi * dDD.s.hi);
75 imag.s.hi = CRT_INFINITY * (aDD.s.hi * dDD.s.hi + bDD.s.hi * cDD.s.hi);
80 long double _Complex z;