Date: Tue, 28 Feb 2012 20:03:36 -0800 From: "Thomas D. Dean" <tomdean@speakeasy.org> To: freebsd-amd64@freebsd.org Subject: Re: Gcc46 and 128 Bit Floating Point Message-ID: <4F4DA398.6070703@speakeasy.org> In-Reply-To: <4F3EC0B4.6050107@speakeasy.org> References: <4F3EA37F.9010207@speakeasy.org> <CAGE5yCpvF0-b1iKAVGbya=fUNaYbGyrpj1PHSQxw4BvycNMLDg@mail.gmail.com> <4F3EC0B4.6050107@speakeasy.org>
index | next in thread | previous in thread | raw e-mail
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 <quadmath.h>
#include <stdio.h>
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
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F4DA398.6070703>
