From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1944) id 730493851532; Wed, 26 Oct 2022 15:09:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 730493851532 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666796951; bh=5Jb7b1+CpnSJXZ0Ae6gFbavPTuPuk6PJJTuWZablELE=; h=From:To:Subject:Date:From; b=xhwjwp/OGGAMqNmuPxRivPUdUb5FeckO/Ngm/8wbCZLkfpc02egNL56o2NcV3ataM 746Irq+7xY+v/4aFQ3d3gJzznYyg291z4uL991rG4eSrbA9lwiIPBqWyMc1pl4w0No zhOu+dY9AweFN0BUelTCcd3FwYnbsAtdZu0ps4zU= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Szabolcs Nagy To: glibc-cvs@sourceware.org Subject: [glibc/arm/morello/main] Ensure calculations happen with desired rounding mode in y1lf128 X-Act-Checkin: glibc X-Git-Author: Michael Hudson-Doyle X-Git-Refname: refs/heads/arm/morello/main X-Git-Oldrev: 2bd815d8347851212b9a91dbdca8053f4dbdac87 X-Git-Newrev: 3e279192749cfcae4ceebb1f21a3275e677d0561 Message-Id: <20221026150911.730493851532@sourceware.org> Date: Wed, 26 Oct 2022 15:09:11 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3e279192749cfcae4ceebb1f21a3275e677d0561 commit 3e279192749cfcae4ceebb1f21a3275e677d0561 Author: Michael Hudson-Doyle Date: Fri Aug 12 11:29:31 2022 +1200 Ensure calculations happen with desired rounding mode in y1lf128 math/test-float128-y1 fails on x86_64 and ppc64el with gcc 12 and -O3, because code inside a block guarded by SET_RESTORE_ROUNDL is being moved after the rounding mode has been restored. Use math_force_eval to prevent this (and insert some math_opt_barrier calls to prevent code from being moved before the rounding mode is set). Fixes #29463 Reviewed-By: Wilco Dijkstra (cherry picked from commit 2b274fd8c9c776cf70fcdb8356e678ada522a7b0) Diff: --- NEWS | 1 + sysdeps/ieee754/ldbl-128/e_j1l.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 63e26d7062..bea1d8a11f 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ The following bugs are resolved with this release: [29446] _dlopen now ignores dl_caller argument in static mode [29485] Linux: Terminate subprocess on late failure in tst-pidfd [29490] alpha: New __brk_call implementation is broken + [29463] math/test-float128-y1 fails on x86_64 [29528] elf: Call __libc_early_init for reused namespaces [29537] libc: [2.34 regression]: Alignment issue on m68k when using [29539] libc: LD_TRACE_LOADED_OBJECTS changed how vDSO library are diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index 54c457681a..9a9c5c6f00 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -869,10 +869,13 @@ __ieee754_y1l (_Float128 x) { /* 0 <= x <= 2 */ SET_RESTORE_ROUNDL (FE_TONEAREST); + xx = math_opt_barrier (xx); + x = math_opt_barrier (x); z = xx * xx; p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D); p = -TWOOPI / xx + p; p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p; + math_force_eval (p); return p; }