From owner-svn-src-head@freebsd.org Fri Oct 14 19:54:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 082A8C118B3; Fri, 14 Oct 2016 19:54:33 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay105.isp.belgacom.be (mailrelay105.isp.belgacom.be [195.238.20.132]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D6E9A7E8; Fri, 14 Oct 2016 19:54:31 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AWBQBJNgFY/1QiyVBcGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBgzwBAQEBAR1JDnykOZZAKIV6AoIWPRABAgEBAQEBAQFeJ4RiAQEEOhw?= =?us-ascii?q?jEAsYCSUPKh4GE4hWCsMaAQEBAQEBBAEBAQEBAR0FixKCY4FkhV8FmgaGKIlNc?= =?us-ascii?q?o8OSYwwg381H1KEazw0AYg0AQEB?= Received: from 84.34-201-80.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([80.201.34.84]) by relay.skynet.be with ESMTP; 14 Oct 2016 21:53:16 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id u9EJrCSt062739; Fri, 14 Oct 2016 21:53:12 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Fri, 14 Oct 2016 21:53:11 +0200 From: Tijl Coosemans To: Dimitry Andric Cc: Ed Maste , Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r307231 - head/lib/libgcc_s Message-ID: <20161014215311.6b723fab@kalimero.tijl.coosemans.org> In-Reply-To: References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 19:54:33 -0000 On Fri, 14 Oct 2016 20:55:30 +0200 Dimitry Andric wrot= e: > On 14 Oct 2016, at 04:06, Ed Maste wrote: >> On 14 October 2016 at 01:53, Bruce Evans wrote: = =20 >>>> compiler-rt's complex division support routines contain calls to >>>> compiler builtins such as `__builtin_scalbnl`. Unfortunately Clang >>>> turns these back into a call to `scalbnl`. =20 >>>=20 >>> gcc-4.2 has the same bug. =20 >>=20 >> Oh, interesting. Do you know off hand if it's resolved in later GCC? =20 >=20 > Not for x86, in any case (I think I talked about this with you on IRC > before). For example, using the latest gcc 7.0.0 20160911 on this > program: >=20 > float f1(float x, int n) > { > return __builtin_scalbnf(x, n); > } >=20 > double f2(double x, int n) > { > return __builtin_scalbn(x, n); > } >=20 > long double f3(long double x, long n) > { > return __builtin_scalbnl(x, n); > } >=20 > gives this assembly: >=20 > .p2align 4,,15 > .globl f1 > .type f1, @function > f1: > .LFB0: > .cfi_startproc > jmp scalbnf > .cfi_endproc > .LFE0: > .size f1, .-f1 > .p2align 4,,15 > .globl f2 > .type f2, @function > f2: > .LFB1: > .cfi_startproc > jmp scalbn > .cfi_endproc > .LFE1: > .size f2, .-f2 > .p2align 4,,15 > .globl f3 > .type f3, @function > f3: > .LFB2: > .cfi_startproc > jmp scalbnl > .cfi_endproc > .LFE2: > .size f3, .-f3 >=20 > E.g., it looks like the __builtin_scalbn functions were always a red > herring. :-) =46rom https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html: GCC includes built-in versions of many of the functions in the standard C library. These functions come in two forms: one whose names start with the __builtin_ prefix, and the other without. Both forms have the same type (including prototype), the same address (when their address is taken), and the same meaning as the C library functions even if you specify the -fno-builtin option see C Dialect Options). Many of these functions are only optimized in certain cases; if they are not optimized in a particular case, a call to the library function is emitted.