-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Closed
Copy link
Labels
backend:loongarchclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsrelease:backport
Milestone
Description
The current Clang LSX/LASX intrinsics header files make heavy use of implicit vector conversions vector bitcasts, that is not accepted by Clang 18+ (Clang 17 does not support Loongson SIMD) with -fno-lax-vector-conversions
. Example:
// clang -c -fno-lax-vector-conversions -mlsx test-lsx-lax-conversion.c
#include <lsxintrin.h>
int main(void) { return 0; }
In file included from test-lsx-lax-conversion.c:1:
/usr/lib/llvm/19/bin/../../../../lib/clang/19/include/lsxintrin.h:42:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(16 * sizeof(char)))) char' (vector of 16 'char' values) with an rvalue of type 'v16i8' (vector of 16 'signed char' values)
42 | return (__m128i)__builtin_lsx_vsll_b((v16i8)_1, (v16i8)_2);
| ^~~~~~~~~
[lots of similar errors omitted]
It complicates distribution packaging for certain software, because
- they require or work better with Clang, and
- effectively one is forced to enable
-flax-vector-conversions
here and there, for example Skia.
So it may be best to just fix the headers to work with strict vector conversion checks, to stop the proliferation of lax coding practice.
KexyBiscuit and renothing
Metadata
Metadata
Assignees
Labels
backend:loongarchclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsrelease:backport
Type
Projects
Status
Done