Lines Matching +full:y +full:- +full:offset
2 * Single-precision vector log function.
4 * Copyright (c) 2019-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
19 .c0 = -0x1.3e737cp-3f,
20 .c1 = 0x1.5a9aa2p-3f,
21 .c2 = V4 (-0x1.4f9934p-3f),
22 .c3 = 0x1.961348p-3f,
23 .c4 = V4 (-0x1.00187cp-2f),
24 .c5 = 0x1.555d7cp-2f,
25 .c6 = V4 (-0x1.ffffc8p-2f),
26 .ln2 = V4 (0x1.62e43p-1f),
28 optimised register use subnormals are detected after offset has been
29 subtracted, so lower bound is 0x0080000 - offset (which wraps around). */
30 .offset_lower_bound = V4 (0x00800000 - 0x3f2aaaab),
31 .special_bound = V8 (0x7f00), /* top16(asuint32(inf) - 0x00800000). */
37 special_case (float32x4_t p, uint32x4_t u_off, float32x4_t y, float32x4_t r2, in special_case() argument
41 return v_call_f32 (logf, vreinterpretq_f32_u32 (vaddq_u32 (u_off, d->off)), in special_case()
42 vfmaq_f32 (p, y, r2), vmovl_u16 (cmp)); in special_case()
48 float32x4_t c1350 = vld1q_f32 (&d->c1); in V_NAME_F1()
50 /* To avoid having to mov x out of the way, keep u after offset has been in V_NAME_F1()
51 applied, and recover x by adding the offset back in the special-case in V_NAME_F1()
53 uint32x4_t u_off = vsubq_u32 (vreinterpretq_u32_f32 (x), d->off); in V_NAME_F1()
58 uint16x4_t cmp = vcge_u16 (vsubhn_u32 (u_off, d->offset_lower_bound), in V_NAME_F1()
59 vget_low_u16 (d->special_bound)); in V_NAME_F1()
61 uint32x4_t u = vaddq_u32 (vandq_u32 (u_off, d->mantissa_mask), d->off); in V_NAME_F1()
64 /* y = log(1+r) + n*ln2. */ in V_NAME_F1()
67 float32x4_t p = vfmaq_laneq_f32 (d->c2, r, c1350, 0); in V_NAME_F1()
68 float32x4_t q = vfmaq_laneq_f32 (d->c4, r, c1350, 1); in V_NAME_F1()
69 float32x4_t y = vfmaq_laneq_f32 (d->c6, r, c1350, 2); in V_NAME_F1() local
73 y = vfmaq_f32 (y, q, r2); in V_NAME_F1()
74 p = vfmaq_f32 (r, d->ln2, n); in V_NAME_F1()
77 return special_case (p, u_off, y, r2, cmp, d); in V_NAME_F1()
78 return vfmaq_f32 (p, y, r2); in V_NAME_F1()
87 TEST_INTERVAL (V_NAME_F1 (log), 0x1p-4, 0x1p4, 500000)