[Pixman] [PATCH] Disable MMX when Clang is being used.
Jeremy Huddleston
jeremyhu at apple.com
Thu Feb 23 15:50:12 PST 2012
I'd rather check what it chokes on rather than just erroring out if it's __clang__ ... that way when it is fixed, newer versions will "just work"
On Feb 23, 2012, at 3:45 PM, Søren Sandmann <sandmann at cs.au.dk> wrote:
> From: Søren Sandmann Pedersen <ssp at redhat.com>
>
> There are several issues with the Clang compiler and pixman-mmx.c:
>
> - When not optimizing, it doesn't seem to recognize that an argument
> to an __always_inline__ function is compile-time constant. This
> results in this error being produced:
>
> fatal error: error in backend: Invalid operand for inline asm
> constraint 'K'!
>
> - This inline assembly:
>
> asm ("pmulhuw %1, %0\n\t"
> : "+y" (__A)
> : "y" (__B)
> );
>
> results in
>
> fatal error: error in backend: Unsupported asm: input constraint
> with a matching output constraint of incompatible type!
>
> So disable MMX when the compiler is Clang.
> ---
> configure.ac | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index f39f437..cca4d16 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -294,6 +294,9 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
> #error "Need GCC >= 3.4 for MMX intrinsics"
> #endif
> +#if defined(__clang__)
> +#error "clang chokes on the inline assembly in pixman-mmx.c"
> +#endif
> #include <mmintrin.h>
> int main () {
> __m64 v = _mm_cvtsi32_si64 (1);
> --
> 1.7.4
>
More information about the Pixman
mailing list