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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-amd64
To unsubscribe, send any mail to "[email protected]"

Reply via email to