From patchwork Tue Nov 17 15:55:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 545642 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 3096014076B for ; Wed, 18 Nov 2015 03:10:35 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id E4CAF1A06A7 for ; Wed, 18 Nov 2015 03:10:34 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org X-Greylist: delayed 803 seconds by postgrey-1.35 at bilbo; Wed, 18 Nov 2015 03:09:27 AEDT 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 124611A0485 for ; Wed, 18 Nov 2015 03:09:27 +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 1Zyibv-0002V0-IB from joseph_myers@mentor.com ; Tue, 17 Nov 2015 07:55:59 -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; Tue, 17 Nov 2015 15:55:56 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1Zyibq-0005sp-Me; Tue, 17 Nov 2015 15:55:54 +0000 Date: Tue, 17 Nov 2015 15:55:54 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: kbuild test robot Subject: Re: [powerpc:test 7/8] include/math-emu/quad.h:72:1: error: unable to emulate 'TF' In-Reply-To: <201511171656.yqpXMbFx%fengguang.wu@intel.com> Message-ID: References: <201511171656.yqpXMbFx%fengguang.wu@intel.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kbuild-all@01.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 17 Nov 2015, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git test > head: e37d8480fbd6b9ad3665ac85a903098413ba67ae > commit: 71fa67f178c6c3c338d0b99644bce808f2f0965e [7/8] sparc/math-emu: Move sparc from math-emu-old to math-emu > config: sparc-defconfig (attached as .config) > reproduce: > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout 71fa67f178c6c3c338d0b99644bce808f2f0965e > # save the attached .config to linux build tree > make.cross ARCH=sparc > > All errors (new ones prefixed by >>): > > In file included from arch/sparc/math-emu/math_32.c:77:0: > >> include/math-emu/quad.h:72:1: error: unable to emulate 'TF' > typedef float TFtype __attribute__ ((mode (TF))); Is this with a compiler that defaults to -mlong-double-64 (which is, I think, now an unusual configuration on SPARC - it might arise for bootstrap compilers, but any normal distribution compiler should default to -mlong-double-128)? If so, the old code would have been quietly building with a union that contains the "wrong" long double type, when using such a compiler. And actually I think that because of the particular subset of macros used, this would have worked; the long double member of the union wouldn't have been used in this code. My inclination would be to use CFLAGS_math_32.o = -mlong-double-128 CFLAGS_math_64.o = -mlong-double-128 in arch/sparc/math-emu/Makefile to fix this properly (the "unable to emulate" error is for modes that fail GCC's scalar_mode_supported_p hook, which by default allows the modes for all standard types, hence an error for -mlong-double-64 when TFmode isn't used by a standard type). Untested incremental patch follows. Signed-off-by: Joseph Myers diff --git a/arch/sparc/math-emu/Makefile b/arch/sparc/math-emu/Makefile index 825dbee..6df8769 100644 --- a/arch/sparc/math-emu/Makefile +++ b/arch/sparc/math-emu/Makefile @@ -5,4 +5,9 @@ # suppress all warnings - as math.c produces a lot! ccflags-y := -w +# Emulation of quad instructions requires -mlong-double-128 for +# __attribute__ ((mode (TF))) to be accepted. +CFLAGS_math_32.o = -mlong-double-128 +CFLAGS_math_64.o = -mlong-double-128 + obj-y := math_$(BITS).o