[Bug 276794] The PPC-specific header /usr/lib/clang/16/include/ppc_wrappers/mmintrin.h asks to define the x86-specific variable NO_WARN_X86_INTRINSICS (port audio/surge-synthesizer-lv2 on powerpc64le)

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 03 Feb 2024 18:23:43 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276794

--- Comment #2 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
Going in a different direction: the comments indicate the code is
designed to help with converting x86_64 code to powerpc64/powerpc64le
and it is deliberately using x86-specific defines:

#ifndef NO_WARN_X86_INTRINSICS
/* This header file is to help porting code using Intel intrinsics
   explicitly from x86_64 to powerpc64/powerpc64le.

   Since PowerPC target doesn't support native 64-bit vector type, we
   typedef __m64 to 64-bit unsigned long long in MMX intrinsics, which
   works well for _si64 and some _pi32 operations.

   For _pi16 and _pi8 operations, it's better to transfer __m64 into
   128-bit PowerPC vector first. Power8 introduced direct register
   move instructions which helps for more efficient implementation.

   It's user's responsibility to determine if the results of such port
   are acceptable or further changes are needed. Please note that much
   code using Intel intrinsics CAN BE REWRITTEN in more portable and
   efficient standard C or GNU C extensions with 64-bit scalar
   operations, or 128-bit SSE/Altivec operations, which are more
   recommended. */
#error                                                                        
\
    "Please read comment above.  Use -DNO_WARN_X86_INTRINSICS to disable this
error."
#endif

"PPC-specific headers aren't supposed to recommend to set x86-specific
defines."
looks to be just wrong about this code.

(I'm not claiming that the code works overall.)

-- 
You are receiving this mail because:
You are the assignee for the bug.