From owner-freebsd-amd64@FreeBSD.ORG Fri Feb 17 21:04:15 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 5DB69106564A for ; Fri, 17 Feb 2012 21:04:15 +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 9529E8FC0A for ; Fri, 17 Feb 2012 21:04:14 +0000 (UTC) Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.53]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 6E854A71D6A for ; Fri, 17 Feb 2012 16:04:11 -0500 (EST) Received: (qmail 23399 invoked from network); 17 Feb 2012 21:03:24 -0000 Received: by simscan 1.4.0 ppid: 9420, pid: 9860, t: 0.1983s scanners: clamav: 0.88.2/m:52/d:13495 spam: 3.0.4 Received: from unknown (HELO P9X79.tddhome) (tomdean@[24.113.112.30]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 17 Feb 2012 21:03:23 -0000 Message-ID: <4F3EC0B4.6050107@speakeasy.org> Date: Fri, 17 Feb 2012 13:03:48 -0800 From: "Thomas D. Dean" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120126 Thunderbird/9.0 MIME-Version: 1.0 To: freebsd-amd64@freebsd.org References: <4F3EA37F.9010207@speakeasy.org> In-Reply-To: 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 mail8.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: Fri, 17 Feb 2012 21:04:15 -0000 On 02/17/12 11:31, Peter Wemm wrote: > On Fri, Feb 17, 2012 at 10:59 AM, Thomas D. Dean wrote: > [..] >> gcc46 is generating 80-bit floating point instructions. >> >> The gcc docs state gcc46 will generate 128-bit instructions. >> >> I can get gfortran46 to generate 128-bit instructions. >> >> How do I get gcc46 to generate 128-bit floating point instructions? > > "As of gcc 4.3, a quadruple precision is also supported on x86, but as > the nonstandard type __float128 rather than long double." > AS it turns out, gcc46 does not support long double. Or, is it just because the port lang/gcc46 uses the system libc, which is gcc 4.2.1? #include #include int main() { __float128 f128; long double ld; char s[512]; f128 = (__float128)1.0; f128 += ((__float128)2.0) * FLT128_EPSILON; ld = (long double)f128; quadmath_snprintf(s, sizeof s, "%.70Qe", f128); printf("%s\n%.70Le\n",s,ld); if (ld != f128) printf("not equal\n"); return 0; } > env | grep LD LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/gcc46:/lib > which gcc46 /usr/local/bin/gcc46 > locate libquadmath.so /usr/local/lib/gcc46/libquadmath.so /usr/local/lib/gcc46/libquadmath.so.0 > gcc46 -march=corei7 -msse2 -Wall quadtest.c -o quadtest -lquadmath > ./quadtest 1.0000000000000000000000000000000003851859888774471706111955885169854637e+00 1.0000000000000000000000000000000000000000000000000000000000000000000000e+00 not equal Oops! Tom Dean