From owner-freebsd-amd64@FreeBSD.ORG Wed Feb 29 04:03:38 2012 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6133B106568D for ; Wed, 29 Feb 2012 04:03:38 +0000 (UTC) (envelope-from tomdean@speakeasy.org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD718FC1E for ; Wed, 29 Feb 2012 04:03:37 +0000 (UTC) Received: from mail2.sea5.speakeasy.net (mail2.sea5.speakeasy.net [69.17.117.41]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 346E7A70668 for ; Tue, 28 Feb 2012 23:03:37 -0500 (EST) Received: (qmail 23964 invoked from network); 29 Feb 2012 04:03:36 -0000 Received: by simscan 1.4.0 ppid: 14533, pid: 30821, t: 0.2307s scanners: clamav: 0.88.2/m:52/d:10739 spam: 3.0.4 Received: from unknown (HELO P9X79.tddhome) (tomdean@[24.113.107.31]) (envelope-sender ) by mail2.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 29 Feb 2012 04:03:36 -0000 Message-ID: <4F4DA398.6070703@speakeasy.org> Date: Tue, 28 Feb 2012 20:03:36 -0800 From: "Thomas D. Dean" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120228 Thunderbird/10.0.2 MIME-Version: 1.0 To: freebsd-amd64@freebsd.org References: <4F3EA37F.9010207@speakeasy.org> <4F3EC0B4.6050107@speakeasy.org> In-Reply-To: <4F3EC0B4.6050107@speakeasy.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail2.sea5 X-Spam-Level: X-Spam-Status: No, score=0.9 required=8.0 tests=FORGED_RCVD_HELO, RATWARE_GECKO_BUILD autolearn=disabled version=3.0.4 Subject: Re: Gcc46 and 128 Bit Floating Point X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 04:03:38 -0000 On 02/17/12 13:03, Thomas D. Dean wrote: I have been reading the Core-i7 developers manual and looking at libm. I have been trying to shoe horn some calculations between the sizes of fpu instructions and libgmp. I think there is little support for 128-bit floating point in the Core-i7 3930K CPU. The code which uses __float128 implements functions in software and use the 80-bit fpu instructions to assist. I believe there is some speed improvement with the 128-bit registers. But, I can find no floating point instructions that operate on 128-bit floating point, like there is for 80-bit. The bottom line seems to be little gain in floating point operations with the core-i7 CPU. Or, am I missing something? #include #include int main() { char buf[128]; __float128 x = sqrtq(2.0Q); quadmath_snprintf(buf, sizeof buf, "%.45Qf",x); printf("sin(%s) = ",buf); quadmath_snprintf(buf, sizeof buf, "%.45Qf",sinq(x)); printf("%s\n",buf); return 0; } gcc46 math.c -o math /usr/local/lib/gcc46/libquadmath.a /usr/lib/libm.a Looking at the output of objdump -d math shows software implementation of sqrtq() and sinq(). gcc46 does use the fsqrt instruction but not fsin. Tom Dean