From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.216]) by sourceware.org (Postfix) with ESMTPS id A05C53858D37 for ; Tue, 24 Oct 2023 13:43:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A05C53858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=clisp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A05C53858D37 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=81.169.146.216 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698155010; cv=pass; b=Fqv2v4itMc2t9+9oz/4okqDyXNYqc5xFds2tUIF574jcXz3+8wFdaEeSPNApmafV+eVqkC+fiEcPWPuUtsBV1IBLNnskZ4XhMOuqhfFELFGxeD5o9QNFoOM9/gJjBdsQYwyySvQVRk2xhSyyp+LQTIEQlzu2r+jQV6apPyMG8dc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698155010; c=relaxed/simple; bh=P/DL2uAYmv3rDpjsMofaFqj4LuCYWSTmK64I7vyjiIg=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=My00DZ5AAFJFm0h/zFlb/3Zi8GYCOun47ErHyaeb7vOHQr4rIV1gKxpqEVqfgpsRCXgEx3yNH7knulUqYRbTXz8Ud+obzG3yxWK426g6vN05TLbclIr1hPlI2BhcXwdcGgPXGHo2djKPKPs9yWB9Ajty7Rnevlwd4hIbk6Afh3Q= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1698155005; cv=none; d=strato.com; s=strato-dkim-0002; b=Y/pypQVWYSE6ko7wJdTPD+P0Z1PDrKcWSZAatkcFzCD3mmXx1rNE2T3Fr4G/t9peGD XRplD6yuLxp9KnTm6AD0eSz3CgFohMe+kM2MbZ0q7fHl0Zqx0Uhzxa+MelJu1qWwv+Qs y7/mJ5q7vJ41itln6ee/slGVMoqFGyQfPRbf8IQZFfhJo6KymXNYeKzbU9LrtonCY4Bx suwVHvju/GWlLPgxMwJxazwBXSduc/9ed9u1oyNynhtWzDzMaz3XQ3r0YkC2uV+hNAJr +rn8iq1Ts8Qr2kCKzc/T6zSzeTipjU3Fo6p7DoTHYjo9K5Ql9S0wg2YvFDJYI+z/nkyR Y/Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1698155005; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=goxMQqwJbYEuTp979pgda8KDDlWkTazjAUWKWOjTYxo=; b=eZMztIZRo9ZRfAVLF5jTBCmu7bTPuVjRItU4jp6V1RuUE1Ijvrq/j3+iepD2wUEVYN ZJavjg0lDvV/2aNap+MKYL5qX3Q6+VCRsh1bVFCVBxzPLC1dacQuexrfTSYlKh4GlF0c Gsi/kPG96v01jS+M8GGCkKge+814Von8ou5bzKMmUc3Wb/H9Meb985Pck/ioZj2IeDJm HSLNrU1mdM4LXhappf40gsd2eKIJyixSRmkhybNw5HqIut1mSXoUKIAvVL46p/zgc62h LdnfGg4FY7KoDo+JxuPZGxCO22GKpNZTGO2Ab7VZFE4pvgbFh3K2UwqryWniiK9zCqsx YsOA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1698155005; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=goxMQqwJbYEuTp979pgda8KDDlWkTazjAUWKWOjTYxo=; b=nBQTaN2e+opcYZC+XiH6FBnDG6tN1SfV6RwiYF7RvyUNejl3G3Mo7wd1RlohutFHrl 6eEDg6OzRH2afUpAlJu/JB3k8rf3RmikAiGGbFJ96Rr2FHMxf2WqXtEK3oa3bBQRki8/ 1EHywQJ7Up7bBNeC0CVHo9BhKaJbCQkoZw8kbxOK0PTa7MvBizdj8K5LMlR0BL2CRDco uB7RDJO7GNoEXSfVhPxzFVRTOgoh14+j1WaBpyokUEE7jYc/0KCudUF0wMnLGXnKirSP fChl5kPgDLSxnLgdZA3yqFb7kKm6ppC46XAWI9qIjZBblyurd/4OvlvvONfuKzaLSU0X PONQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1698155005; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From: Subject:Sender; bh=goxMQqwJbYEuTp979pgda8KDDlWkTazjAUWKWOjTYxo=; b=dWl1uhJP+F2HW4/Bsq1ydxdGGSKeCT4ahZY+fIn8fmiowRpJBDo1tPA1y6dIPXY+4z bM8aGYAc/LkjNbP4L1BQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOV3fDuwlLcKVnb9GfsTtNpJiAwvA==" Received: from nimes.localnet by smtp.strato.de (RZmta 49.9.0 AUTH) with ESMTPSA id Y1a68az9ODhPlAH (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 24 Oct 2023 15:43:25 +0200 (CEST) From: Bruno Haible To: libc-alpha@sourceware.org, Adhemerval Zanella Subject: Re: [PATCH v2 2/3] i686: Do not raise exception traps on fesetexcept (BZ 30989) Date: Tue, 24 Oct 2023 15:43:25 +0200 Message-ID: <3864706.3VsfAaAtOV@nimes> In-Reply-To: <20231024113716.3911015-3-adhemerval.zanella@linaro.org> References: <20231024113716.3911015-1-adhemerval.zanella@linaro.org> <20231024113716.3911015-3-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Looks all good, except for two comments: Adhemerval Zanella wrote: > diff --git a/sysdeps/i386/fpu/fesetexcept.c b/sysdeps/i386/fpu/fesetexcept.c > index 18949e982a..6eeb5ab5b0 100644 > --- a/sysdeps/i386/fpu/fesetexcept.c > +++ b/sysdeps/i386/fpu/fesetexcept.c > @@ -17,15 +17,48 @@ > . */ > > #include > +#include > > int > fesetexcept (int excepts) > { > - fenv_t temp; > + /* The flags can be set in the 387 unit or in the SSE unit. To set a flag, > + it is sufficient to do it in the SSE unit, because that is guaranteed to > + not trap. However, on i386 CPUs that have only a 387 unit, set the flags > + in the 387, as long as this cannot trap. */ > > - __asm__ ("fnstenv %0" : "=m" (*&temp)); > - temp.__status_word |= excepts & FE_ALL_EXCEPT; > - __asm__ ("fldenv %0" : : "m" (*&temp)); > + excepts &= FE_ALL_EXCEPT; > + > + if (CPU_FEATURE_USABLE (SSE)) > + { > + /* And now similarly for SSE. */ > + unsigned int mxcsr; > + __asm__ ("stmxcsr %0" : "=m" (*&mxcsr)); The comment "And now similarly for SSE." is odd, since there was no similar code before it. How about /* Set the flags in the SSE unit. */ > + /* Set relevant flags. */ > + mxcsr |= excepts; > + > + /* Put the new data in effect. */ > + __asm__ ("ldmxcsr %0" : : "m" (*&mxcsr)); > + } > + else > + { > + fenv_t temp; > + > + __asm__ ("fnstenv %0" : "=m" (*&temp)); > + > + /* Clear or set relevant flags. */ > + temp.__status_word |= temp.__status_word & excepts; The comment here should be /* Set relevant flags. */ since here, unlike in fesetexceptflag(), we don't need to clear any flags. Bruno