From owner-freebsd-bugs@freebsd.org Fri Apr 9 21:34:30 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F39075BED71 for ; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FHBGt6Nkrz4g6V for ; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id D93565BEBF0; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8EC45BEF45 for ; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FHBGt5fzvz4ftM for ; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B13C625683 for ; Fri, 9 Apr 2021 21:34:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 139LYUKU099109 for ; Fri, 9 Apr 2021 21:34:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 139LYUI9099108 for bugs@FreeBSD.org; Fri, 9 Apr 2021 21:34:30 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: =?UTF-8?B?W0J1ZyAyNTQ5MTFdIGxpYi9tc3VuL2N0cmlnX3Rlc3QgZmFpbHMg?= =?UTF-8?B?aWYgY29tcGlsZWQgd2l0aCBBVljCoCgtbWF2eCkgb3IgYW55IENQVVNFVCBl?= =?UTF-8?B?bmFibGluZyBBVlg=?= Date: Fri, 09 Apr 2021 21:34:31 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2021 21:34:31 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254911 --- Comment #2 from Dimitry Andric --- OK, for some reason the divide operation in the imaginary part in line 77 g= ives rise to FE_INVALID (0x1), but *only* if more advanced CPU instructions are used: 41 float complex 42 ctanhf(float complex z) 43 { ... 72 t =3D tanf(y); 73 beta =3D 1.0 + t * t; 74 s =3D sinhf(x); 75 rho =3D sqrtf(1 + s * s); 76 denom =3D 1 + beta * s * s; 77 return (CMPLXF((beta * rho * s) / denom, t / denom)); For example, one of the test cases has both x and y at zero, and this resul= ts in the values: t=3D0, beta=3D1, s=3D0, rho=3D1, denom=3D1 The real part of the return statement calculates (beta * rho * s) / denom = =3D (1 * 1 * 0) / 1 =3D 0, but this does *not* change the FP exception flags. The imaginary part calculates t / denom =3D 0 / 1, and for some reason this= sets FE_INVALID! It's tricky to debug this using printfs though, since this also causes FE_INEXACT, due to some floating point logic in the guts of printf. Now, as to why compiling for bog-standard x86_64, which *does* use SSE and SSE2, does not raise FE_INVALID, I'm not sure yet. --=20 You are receiving this mail because: You are the assignee for the bug.=