From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29452 invoked by alias); 27 Jun 2012 19:17:41 -0000 Received: (qmail 29441 invoked by uid 22791); 27 Jun 2012 19:17:40 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Jun 2012 19:17:26 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Sjxjw-0004yF-M7 from joseph_myers@mentor.com ; Wed, 27 Jun 2012 12:17:24 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 27 Jun 2012 12:17:24 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Wed, 27 Jun 2012 20:17:22 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1Sjxjt-0000FU-6i; Wed, 27 Jun 2012 19:17:21 +0000 Date: Wed, 27 Jun 2012 19:17:00 -0000 From: "Joseph S. Myers" To: Richard Henderson CC: , Subject: Re: Detecting support for trapping floating-point exceptions on ARM In-Reply-To: <4FEB49B3.2030602@twiddle.net> Message-ID: References: <4FEB49B3.2030602@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00091.txt.bz2 On Wed, 27 Jun 2012, Richard Henderson wrote: > On 06/12/2012 12:11 PM, Joseph S. Myers wrote: > > ARM VFPv3 and VFPv4 do not support trapping floating-point exceptions; > > VFPv2, VFPv3U and VFPv4U do. The lack of support causes the glibc > > math/test-fenv test to fail on VFPv3 and VFPv4 systems. > > > > The natural fix for that would be for fesetenv (FE_NOMASK_ENV) to fail on > > hardware not supporting trapping exceptions. There is, however, no HWCAP > > bit to indicate whether trapping floating-point exceptions is supported. > > Could one be added to the kernel, or is there a good way fesetenv could > > detect this from userspace without a new HWCAP bit? > > I don't suppose those SBZ/RAZ bits just so happen to be ignored in > actual hardware, so that you can write 1 and read it back and get 0 > to see if exceptions are unsupported? Good point. I tested on one VFPv3 system and the bits did read back as zero (and on one VFPv2 system and got back the expected 0x1f00). And DDI0406C (page 1552) says "They are reserved, RAZ/WI, on a system that implements VFPv3 or VFPv4.", where RAZ/WI is "Read-As-Zero, Writes Ignored. In any implementation, the bit must read as 0, or all 0s for a bit field, and writes to the field must be ignored. Software can rely on the bit reading as 0, or all 0s for a bit field, and on writes being ignored." (page 2676), so this can be relied upon. (This is a change in the documentation from DDI0406B which said RAZ/SBZP.) So it is possible to test for this in userspace the way you suggest. -- Joseph S. Myers joseph@codesourcery.com