Skip to content

Commit d97de7b

Browse files
committed
Don't rely on SIGILL to detect AVX2 support in Sulong test.
1 parent 46e36ff commit d97de7b

File tree

2 files changed

+5
-52
lines changed

2 files changed

+5
-52
lines changed

sulong/tests/com.oracle.truffle.llvm.tests.sulongavx.native/avx/avx2fallback.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

sulong/tests/com.oracle.truffle.llvm.tests.sulongavx.native/avx/builtin_gcc/__builtin_shufflevector.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -28,7 +28,6 @@
2828
* OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030
#include <stdio.h>
31-
#include "../avx2fallback.h"
3231

3332
int avx2_fallback() {
3433
printf("v3: -1 -1 -1 -1\n");
@@ -39,13 +38,17 @@ int avx2_fallback() {
3938
typedef int vec4 __attribute__((vector_size(16)));
4039

4140
int main() {
41+
#if defined(__AVX2__)
4242
volatile vec4 v1 = { -1, 8, 2, -5 };
4343

4444
volatile vec4 v3 = __builtin_shufflevector(v1, v1, 0, 0, 0, 0);
4545
printf("v3: %d %d %d %d\n", v3[0], v3[1], v3[2], v3[3]);
4646

4747
volatile vec4 v4 = __builtin_shufflevector(v1, v1, 3, 2, 1, 0);
4848
printf("v4: %d %d %d %d\n", v4[0], v4[1], v4[2], v4[3]);
49+
#else
50+
avx2_fallback();
51+
#endif
4952

5053
return 0;
5154
}

0 commit comments

Comments
 (0)