This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Update sysdeps/x86_64/fpu_control.h
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sun, 17 Jun 2012 13:11:58 -0700 (PDT)
- Subject: Re: PATCH: Update sysdeps/x86_64/fpu_control.h
- References: <20120617192602.GA2732@intel.com>
> +/* Macros for accessing the hardware control word.
> +
> + Note that the use of these macros is no sufficient anymore with
"not sufficient"
> + recent hardware. Some floating point operations are executed in
> + the SSE/SSE2 engines which have their own control and status register. */
> +#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw))
> +#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw))
Why *&? That seems like a no-op. There should be a comment explaining the
need for volatile.