From patchwork Thu Feb 19 18:40:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 441725 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BB3601400B6 for ; Fri, 20 Feb 2015 05:41:33 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 9EC701A0FCE for ; Fri, 20 Feb 2015 05:41:33 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 6FF1D1A0D07 for ; Fri, 20 Feb 2015 05:40:42 +1100 (AEDT) Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YOW1e-0000XJ-9V from joseph_myers@mentor.com ; Thu, 19 Feb 2015 10:40:38 -0800 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.3.224.2; Thu, 19 Feb 2015 18:40:36 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1YOW1a-0007rt-T6; Thu, 19 Feb 2015 18:40:35 +0000 Date: Thu, 19 Feb 2015 18:40:34 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: David Miller Subject: Re: [PATCH RFC] Update kernel math-emu code from current glibc soft-fp In-Reply-To: <20150219.132122.204795202277130266.davem@davemloft.net> Message-ID: References: <20150219.132122.204795202277130266.davem@davemloft.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Cc: linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kkojima@rr.iij4u.or.jp X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, 19 Feb 2015, David Miller wrote: > From: Joseph Myers > Date: Fri, 6 Feb 2015 17:25:29 +0000 > > > * On SPARC, comparisons now use raw unpacking (this should not in fact > > change how the emulation behaves, just make it more efficient). > > I did a sparc64 test build and it failed like so: > > arch/sparc/math-emu/math_64.c: In function ‘do_mathemu’: > arch/sparc/math-emu/math_64.c:487:1: error: expected expression before ‘return’ > arch/sparc/math-emu/math_64.c:488:1: error: expected expression before ‘return’ > arch/sparc/math-emu/math_64.c:490:1: error: expected expression before ‘return’ > arch/sparc/math-emu/math_64.c:491:1: error: expected expression before ‘return’ > arch/sparc/math-emu/math_64.c:495:1: error: expected expression before ‘return’ > > I'm attaching a CPP processed math_64.c for your convenience: Please try this patch on top of the previous one. The way abort is redefined in the kernel code doesn't work for one place using it in an expression; this patch changes a comma expression to a statement expression. This didn't appear in my powerpc testing because the powerpc emulation never uses FP_FROM_INT; I'm not sure how Kaz's sh testing avoided the problem appearing there. diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h index b9f5e1a..8c059c3 100644 --- a/include/math-emu/op-common.h +++ b/include/math-emu/op-common.h @@ -1818,7 +1818,7 @@ X##_e = (_FP_EXPBIAS_##fs + 2 * _FP_W_TYPE_SIZE - 1 \ - _FP_FROM_INT_lz); \ }) \ - : (abort (), 0))); \ + : ({ abort (); 0; }))); \ \ if ((rsize) - 1 + _FP_EXPBIAS_##fs >= _FP_EXPMAX_##fs \ && X##_e >= _FP_EXPMAX_##fs) \