Adds loongarch simd extension(LSX LASX) configure test and -feature-lsx and -feature-lasx configure options. Add detection of LSX and LASX at run-time in qsimd.cpp. Change-Id: I63eab2f4f45c306b672a89b376e0cbc01da0df83 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
30 lines
508 B
C++
30 lines
508 B
C++
// Copyright (C) 2017 Intel Corporation.
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
#define T(x) (QT_COMPILER_SUPPORTS_ ## x)
|
|
|
|
#if T(LSX)
|
|
#include <lsxintrin.h>
|
|
void test_lsx()
|
|
{
|
|
__m128i a = __lsx_vldi(0);
|
|
(void) __lsx_vshuf_h(__lsx_vldi(0), a, a);
|
|
}
|
|
#endif
|
|
|
|
#if T(LASX)
|
|
#include <lsxintrin.h>
|
|
#include <lasxintrin.h>
|
|
void test_lasx()
|
|
{
|
|
__m256i a = __lasx_xvldi(0);
|
|
__m256i b = __lasx_xvadd_b(a, a);
|
|
(void) __lasx_xvadd_b(a, b);
|
|
}
|
|
#endif
|
|
|
|
int main()
|
|
{
|
|
return 0;
|
|
}
|