From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32593 invoked by alias); 17 Jun 2013 17:21:44 -0000 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 Received: (qmail 32579 invoked by uid 89); 17 Jun 2013 17:21:43 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_40,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 17 Jun 2013 17:21:43 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Uod7d-0002X8-QG from joseph_myers@mentor.com for libc-ports@sourceware.org; Mon, 17 Jun 2013 10:21:41 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 17 Jun 2013 10:21:42 -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.2.247.3; Mon, 17 Jun 2013 18:21:40 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1Uod7b-0003jS-5L for libc-ports@sourceware.org; Mon, 17 Jun 2013 17:21:39 +0000 Date: Mon, 17 Jun 2013 17:21:00 -0000 From: "Joseph S. Myers" To: Subject: Make ARM feenableexcept detect failure (bug 14907) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-06/txt/msg00022.txt.bz2 I've committed this patch to make ARM feenableexcept test whether enabling exception traps succeeded, similarly to the tests in fesetenv. Tested on hardware with VFPv2 (supports exception traps) and VFPv3 (doesn't). (This doesn't fix the failures of math/test-fenv for VFPv3 - that test currently has no way to handle runtime failure of either fesetenv or feenableexcept as being expected on some systems - but is a prerequisite for fixing those failures. Of course with proper reporting of the status of individual test assertions, ideally the affected assertions in test-fenv would report UNSUPPORTED status on the affected hardware rather than being quietly skipped.) 2013-06-17 Joseph Myers [BZ #14907] * sysdeps/arm/feenablxcpt.c (feenableexcept): Test whether all requested exception traps were enabled and return -1 if not. diff --git a/ports/sysdeps/arm/feenablxcpt.c b/ports/sysdeps/arm/feenablxcpt.c index baad432..e2e287b 100644 --- a/ports/sysdeps/arm/feenablxcpt.c +++ b/ports/sysdeps/arm/feenablxcpt.c @@ -39,6 +39,18 @@ feenableexcept (int excepts) _FPU_SETCW(new_exc); + if (excepts != 0) + { + /* VFPv3 and VFPv4 do not support trapping exceptions, so + test whether the relevant bits were set and fail if + not. */ + unsigned int temp; + _FPU_GETCW (temp); + if ((temp & (excepts << FE_EXCEPT_SHIFT)) + != (excepts << FE_EXCEPT_SHIFT)) + return -1; + } + return old_exc; } -- Joseph S. Myers joseph@codesourcery.com