From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 6C51A3857829 for ; Wed, 17 Mar 2021 21:08:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6C51A3857829 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: B/N1Ufhm9hhRw984b/8aVB3mEdWbwTO6oiivydx4Ifv0UrVNF6BpmA5bD9mGq2wfktKH92KWBq Co/e0/UBc/kVLWxpfbpA5NdBaEOxRm2QiptTB8tKO0qQ24JfEI2ARcNoWBl/rqgSlJTcovFi0R cBqejkyC3P/mRwByzZ0ee5v9w6mkQEAM2qbOGh5HCh8U3k4Yp1va5Jgckcj3hPQwxb+7FPiDd1 kAB+AI1E8HPwbSm3Tm6JNAo/jsmLWfEpGS1Iqqr226CpK+UK9Wg4ZcK6wU6mBhNsFHL2YxrRC8 djQ= X-IronPort-AV: E=Sophos;i="5.81,257,1610438400"; d="scan'208";a="61562832" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 17 Mar 2021 13:08:37 -0800 IronPort-SDR: oe3PYTM3oicg+sK1nw9uPeO+MCCj4HolqXGwh9xUo2jSApKiM4o4pvNZ7DcM9qyPps5yNjJfqk 8hyWyIM0hQZ6iaJDGK6wuv1Q+8TgKRB4N4RpRsBfzzmnXL8txmR3SEK69GzD8b8c7Phv66oTNU H7RPWyNn2GNfSEooQrCGC+phVgQ1c0uqIhKi8b1BaX1Drwhi2b/58n5aW9pSB6+2/KzTYScTWf gP7qpZO5WoNKRRk6yEKspHoG5fPFhosugilpnKLScPqRUM4wfK/K1wxTsnWGgXaflPP/UbuFDK GtI= Date: Wed, 17 Mar 2021 21:08:32 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Adhemerval Zanella CC: Fengkai Sun , GNU C Library Subject: Re: why don't setjmp save MXCSR register and x87 control word? In-Reply-To: <41f234be-0fbe-0ae1-74be-084bab59bef6@linaro.org> Message-ID: References: <41f234be-0fbe-0ae1-74be-084bab59bef6@linaro.org> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3122.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 21:08:39 -0000 On Wed, 17 Mar 2021, Adhemerval Zanella via Libc-alpha wrote: > Because afaik the C standard specify that any state of floating-point status > flag should *not* be saved: > > 7.13 Nonlocal jumps > [...] > It does not include the state of the floating-point status flags, of open files, > or of any other component of the abstract machine. Indeed, the floating-point exception flags, rounding mode and any other such state are essentially thread-local variables, and should be handled just like such variables. setjmp and longjmp don't save and restore thread-local or global variables, so they shouldn't save and restore floating-point flags or control modes either. (In psABI terms, we invented the term "limited-access bits" to describe this state in the 32-bit Power Architecture ABI.) -- Joseph S. Myers joseph@codesourcery.com