Skip to content

Commit 65101a0

Browse files
[fixup] Add neon feature requirement
1 parent 634302b commit 65101a0

File tree

4 files changed

+70
-8
lines changed

4 files changed

+70
-8
lines changed

clang/include/clang/Basic/arm_neon.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ let ArchGuard = "defined(__aarch64__)", TargetGuard = "lut" in {
21222122
}
21232123
}
21242124

2125-
let ArchGuard = "defined(__aarch64__)", TargetGuard = "faminmax" in {
2125+
let ArchGuard = "defined(__aarch64__)", TargetGuard = "neon,faminmax" in {
21262126
def FAMIN : WInst<"vamin", "...", "fhQdQfQh">;
21272127
def FAMAX : WInst<"vamax", "...", "fhQdQfQh">;
21282128
}

clang/test/CodeGen/aarch64-neon-faminmax-intrinsics.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ float16x4_t test_vamin_f16(float16x4_t vn, float16x4_t vm) {
2424
//
2525
float16x8_t test_vaminq_f16(float16x8_t vn, float16x8_t vm) {
2626
return vaminq_f16(vn, vm);
27-
2827
}
2928

3029
// CHECK-LABEL: define dso_local <2 x float> @test_vamin_f32(
@@ -35,7 +34,6 @@ float16x8_t test_vaminq_f16(float16x8_t vn, float16x8_t vm) {
3534
//
3635
float32x2_t test_vamin_f32(float32x2_t vn, float32x2_t vm) {
3736
return vamin_f32(vn, vm);
38-
3937
}
4038

4139
// CHECK-LABEL: define dso_local <4 x float> @test_vaminq_f32(
@@ -46,7 +44,6 @@ float32x2_t test_vamin_f32(float32x2_t vn, float32x2_t vm) {
4644
//
4745
float32x4_t test_vaminq_f32(float32x4_t vn, float32x4_t vm) {
4846
return vaminq_f32(vn, vm);
49-
5047
}
5148

5249
// CHECK-LABEL: define dso_local <2 x double> @test_vaminq_f64(
@@ -59,7 +56,6 @@ float64x2_t test_vaminq_f64(float64x2_t vn, float64x2_t vm) {
5956
return vaminq_f64(vn, vm);
6057
}
6158

62-
6359
// CHECK-LABEL: define dso_local <4 x half> @test_vamax_f16(
6460
// CHECK-SAME: <4 x half> noundef [[VN:%.*]], <4 x half> noundef [[VM:%.*]]) local_unnamed_addr #[[ATTR0]] {
6561
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -78,7 +74,6 @@ float16x4_t test_vamax_f16(float16x4_t vn, float16x4_t vm) {
7874
//
7975
float16x8_t test_vamaxq_f16(float16x8_t vn, float16x8_t vm) {
8076
return vamaxq_f16(vn, vm);
81-
8277
}
8378

8479
// CHECK-LABEL: define dso_local <2 x float> @test_vamax_f32(
@@ -89,7 +84,6 @@ float16x8_t test_vamaxq_f16(float16x8_t vn, float16x8_t vm) {
8984
//
9085
float32x2_t test_vamax_f32(float32x2_t vn, float32x2_t vm) {
9186
return vamax_f32(vn, vm);
92-
9387
}
9488

9589
// CHECK-LABEL: define dso_local <4 x float> @test_vamaxq_f32(
@@ -100,7 +94,6 @@ float32x2_t test_vamax_f32(float32x2_t vn, float32x2_t vm) {
10094
//
10195
float32x4_t test_vamaxq_f32(float32x4_t vn, float32x4_t vm) {
10296
return vamaxq_f32(vn, vm);
103-
10497
}
10598

10699
// CHECK-LABEL: define dso_local <2 x double> @test_vamaxq_f64(
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -emit-llvm -verify %s -o /dev/null
2+
3+
// REQUIRES: aarch64-registered-target
4+
5+
#include <arm_neon.h>
6+
7+
float16x4_t a16x4, b16x4;
8+
float16x8_t a16x8, b16x8;
9+
float32x2_t a32x2, b32x2;
10+
float32x4_t a32x4, b32x4;
11+
float64x2_t a64x2, b64x2;
12+
13+
14+
void test() {
15+
(void) vamin_f16 (a16x4, b16x4);
16+
// expected-error@-1 {{always_inline function 'vamin_f16' requires target feature 'faminmax'}}
17+
(void) vaminq_f16(a16x8, b16x8);
18+
// expected-error@-1 {{always_inline function 'vaminq_f16' requires target feature 'faminmax'}}
19+
(void) vamin_f32 (a32x2, b32x2);
20+
// expected-error@-1 {{always_inline function 'vamin_f32' requires target feature 'faminmax'}}
21+
(void) vaminq_f32(a32x4, b32x4);
22+
// expected-error@-1 {{always_inline function 'vaminq_f32' requires target feature 'faminmax'}}
23+
(void) vaminq_f64(a64x2, b64x2);
24+
// expected-error@-1 {{always_inline function 'vaminq_f64' requires target feature 'faminmax'}}
25+
(void) vamax_f16 (a16x4, b16x4);
26+
// expected-error@-1 {{always_inline function 'vamax_f16' requires target feature 'faminmax'}}
27+
(void) vamaxq_f16(a16x8, b16x8);
28+
// expected-error@-1 {{always_inline function 'vamaxq_f16' requires target feature 'faminmax'}}
29+
(void) vamax_f32 (a32x2, b32x2);
30+
// expected-error@-1 {{always_inline function 'vamax_f32' requires target feature 'faminmax'}}
31+
(void) vamaxq_f32(a32x4, b32x4);
32+
// expected-error@-1 {{always_inline function 'vamaxq_f32' requires target feature 'faminmax'}}
33+
(void) vamaxq_f64(a64x2, b64x2);
34+
// expected-error@-1 {{always_inline function 'vamaxq_f64' requires target feature 'faminmax'}}
35+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +faminmax -emit-llvm -verify %s -o /dev/null
2+
3+
// REQUIRES: aarch64-registered-target
4+
5+
#include <arm_neon.h>
6+
7+
float16x4_t a16x4, b16x4;
8+
float16x8_t a16x8, b16x8;
9+
float32x2_t a32x2, b32x2;
10+
float32x4_t a32x4, b32x4;
11+
float64x2_t a64x2, b64x2;
12+
13+
void test () {
14+
(void) vamin_f16 (a16x4, b16x4);
15+
// expected-error@-1 {{always_inline function 'vamin_f16' requires target feature 'neon'}}
16+
(void) vaminq_f16(a16x8, b16x8);
17+
// expected-error@-1 {{always_inline function 'vaminq_f16' requires target feature 'neon'}}
18+
(void) vamin_f32 (a32x2, b32x2);
19+
// expected-error@-1 {{always_inline function 'vamin_f32' requires target feature 'neon'}}
20+
(void) vaminq_f32(a32x4, b32x4);
21+
// expected-error@-1 {{always_inline function 'vaminq_f32' requires target feature 'neon'}}
22+
(void) vaminq_f64(a64x2, b64x2);
23+
// expected-error@-1 {{always_inline function 'vaminq_f64' requires target feature 'neon'}}
24+
(void) vamax_f16 (a16x4, b16x4);
25+
// expected-error@-1 {{always_inline function 'vamax_f16' requires target feature 'neon'}}
26+
(void) vamaxq_f16(a16x8, b16x8);
27+
// expected-error@-1 {{always_inline function 'vamaxq_f16' requires target feature 'neon'}}
28+
(void) vamax_f32 (a32x2, b32x2);
29+
// expected-error@-1 {{always_inline function 'vamax_f32' requires target feature 'neon'}}
30+
(void) vamaxq_f32(a32x4, b32x4);
31+
// expected-error@-1 {{always_inline function 'vamaxq_f32' requires target feature 'neon'}}
32+
(void) vamaxq_f64(a64x2, b64x2);
33+
// expected-error@-1 {{always_inline function 'vamaxq_f64' requires target feature 'neon'}}
34+
}

0 commit comments

Comments
 (0)