From owner-svn-src-all@freebsd.org Fri Oct 14 18:55:46 2016 Return-Path: Delivered-To: svn-src-all@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 7EA5BC12A22; Fri, 14 Oct 2016 18:55:46 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F5238A1; Fri, 14 Oct 2016 18:55:45 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7::11ea:67ab:fdec:9446] (unknown [IPv6:2001:7b8:3a7:0:11ea:67ab:fdec:9446]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3229E314C5; Fri, 14 Oct 2016 20:55:36 +0200 (CEST) Subject: Re: svn commit: r307231 - head/lib/libgcc_s Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.6.1 From: Dimitry Andric In-Reply-To: Date: Fri, 14 Oct 2016 20:55:30 +0200 Cc: Bruce Evans , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201610131918.u9DJI0bX085695@repo.freebsd.org> <20161014113603.F1039@besplex.bde.org> To: Ed Maste X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Oct 2016 18:55:46 -0000 --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 14 Oct 2016, at 04:06, Ed Maste wrote: > > Hi Bruce, thank you for the detailed response. > > On 14 October 2016 at 01:53, Bruce Evans wrote: >>> 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`. >> >> gcc-4.2 has the same bug. > > Oh, interesting. Do you know off hand if it's resolved in later GCC? 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: float f1(float x, int n) { return __builtin_scalbnf(x, n); } double f2(double x, int n) { return __builtin_scalbn(x, n); } long double f3(long double x, long n) { return __builtin_scalbnl(x, n); } gives this assembly: .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 E.g., it looks like the __builtin_scalbn functions were always a red herring. :-) > It seems particularly unfortunate for the compiler to report (by > whatever mechanism) that a builtin exists, and then just turn that > builtin into a library call. Yes, at best this is misleading. -Dimitry --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlgBKicACgkQsF6jCi4glqO+cwCaAwubamEu/RR+gK0kEkc0QOvV FfAAoNDhm2dpPWMOsbf3PlgPo6OIb48c =L87B -----END PGP SIGNATURE----- --Apple-Mail=_39A3A199-5ACE-4C30-A9A6-089782D8B7E8--