Lines Matching +full:y +full:- +full:min

2  * Double-precision SVE log2 function.
4 * Copyright (c) 2022-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
14 #define Min (0x0010000000000000) macro
15 #define Thresh (0x7fe0000000000000) /* Max - Min. */
24 .c0 = -0x1.71547652b83p-1,
25 .c1 = 0x1.ec709dc340953p-2,
26 .c2 = -0x1.71547651c8f35p-2,
27 .c3 = 0x1.2777ebe12dda5p-2,
28 .c4 = -0x1.ec738d616fe26p-3,
34 special_case (svfloat64_t w, svuint64_t tmp, svfloat64_t y, svfloat64_t r2, in special_case() argument
37 svfloat64_t x = svreinterpret_f64 (svadd_x (svptrue_b64 (), tmp, d->off)); in special_case()
38 return sv_call_f64 (log2, x, svmla_x (svptrue_b64 (), w, r2, y), special); in special_case()
41 /* Double-precision SVE log2 routine.
45 SV_NAME_D1 (log2)(0x1.0b556b093869bp+0) got 0x1.fffb34198d9dap-5
46 want 0x1.fffb34198d9ddp-5. */
52 svbool_t special = svcmpge (pg, svsub_x (pg, ix, Min), Thresh); in SV_NAME_D1()
57 svuint64_t tmp = svsub_x (pg, ix, d->off); in SV_NAME_D1()
58 svuint64_t i = svlsr_x (pg, tmp, 51 - V_LOG2_TABLE_BITS); in SV_NAME_D1()
59 i = svand_x (pg, i, (N - 1) << 1); in SV_NAME_D1()
68 /* log2(x) = log1p(z/c-1)/log(2) + log2(c) + k. */ in SV_NAME_D1()
70 svfloat64_t invln2_and_c4 = svld1rq_f64 (svptrue_b64 (), &d->invln2); in SV_NAME_D1()
71 svfloat64_t r = svmad_x (pg, invc, z, -1.0); in SV_NAME_D1()
75 svfloat64_t odd_coeffs = svld1rq_f64 (svptrue_b64 (), &d->c1); in SV_NAME_D1()
77 svfloat64_t y = svmla_lane_f64 (sv_f64 (d->c2), r, odd_coeffs, 1); in SV_NAME_D1() local
78 svfloat64_t p = svmla_lane_f64 (sv_f64 (d->c0), r, odd_coeffs, 0); in SV_NAME_D1()
79 y = svmla_lane_f64 (y, r2, invln2_and_c4, 1); in SV_NAME_D1()
80 y = svmla_x (pg, p, r2, y); in SV_NAME_D1()
83 return special_case (w, tmp, y, r2, special, d); in SV_NAME_D1()
84 return svmla_x (pg, w, r2, y); in SV_NAME_D1()
90 TEST_INTERVAL (SV_NAME_D1 (log2), -0.0, -0x1p126, 1000)
91 TEST_INTERVAL (SV_NAME_D1 (log2), 0.0, 0x1p-126, 4000)
92 TEST_INTERVAL (SV_NAME_D1 (log2), 0x1p-126, 0x1p-23, 50000)
93 TEST_INTERVAL (SV_NAME_D1 (log2), 0x1p-23, 1.0, 50000)