4
4
// RUN: -target-feature -relax -target-feature -zfa \
5
5
// RUN: -emit-llvm %s -o - | FileCheck %s
6
6
7
+ #include <riscv_vector.h>
8
+
7
9
// CHECK-LABEL: define dso_local void @testDefault
8
10
// CHECK-SAME: () #0 {
9
11
void testDefault () {}
@@ -35,6 +37,34 @@ testAttrFullArchAndAttrCpu() {}
35
37
// CHECK-SAME: () #8 {
36
38
__attribute__((target ("cpu=sifive-u54" ))) void testAttrCpuOnly () {}
37
39
40
+ __attribute__((target ("arch=+zve32x" )))
41
+ void test_builtin_w_zve32x () {
42
+ // CHECK-LABEL: test_builtin_w_zve32x
43
+ // CHECK-SAME: #9
44
+ __riscv_vsetvl_e8m8 (1 );
45
+ }
46
+
47
+ __attribute__((target ("arch=+zve32x" )))
48
+ void test_rvv_i32_type_w_zve32x () {
49
+ // CHECK-LABEL: test_rvv_i32_type_w_zve32x
50
+ // CHECK-SAME: #9
51
+ vint32m1_t v ;
52
+ }
53
+
54
+ __attribute__((target ("arch=+zve32f" )))
55
+ void test_rvv_f32_type_w_zve32f () {
56
+ // CHECK-LABEL: test_rvv_f32_type_w_zve32f
57
+ // CHECK-SAME: #11
58
+ vfloat32m1_t v ;
59
+ }
60
+
61
+ __attribute__((target ("arch=+zve64d" )))
62
+ void test_rvv_f64_type_w_zve64d () {
63
+ // CHECK-LABEL: test_rvv_f64_type_w_zve64d
64
+ // CHECK-SAME: #12
65
+ vfloat64m1_t v ;
66
+ }
67
+
38
68
//.
39
69
// CHECK: attributes #0 = { {{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zifencei,-relax,-zbb,-zfa" }
40
70
// CHECK: attributes #1 = { {{.*}}"target-cpu"="rocket-rv64" "target-features"="+64bit,+a,+d,+f,+m,+save-restore,+v,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-relax,-zbb,-zfa" "tune-cpu"="generic-rv64" }
@@ -46,3 +76,6 @@ __attribute__((target("cpu=sifive-u54"))) void testAttrCpuOnly() {}
46
76
// CHECK: attributes #6 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+a,+m,+save-restore,+zbb,+zifencei,-relax,-zfa" }
47
77
// CHECK: attributes #7 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+m,+save-restore,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}" }
48
78
// CHECK: attributes #8 = { {{.*}}"target-cpu"="sifive-u54" "target-features"="+64bit,+a,+c,+d,+f,+m,+save-restore,+zicsr,+zifencei,{{(-[[:alnum:]-]+)(,-[[:alnum:]-]+)*}}" }
79
+ // CHECK: attributes #9 = { {{.*}}"target-features"="+64bit,+a,+m,+save-restore,+zicsr,+zifencei,+zve32x,+zvl32b,-relax,-zbb,-zfa" }
80
+ // CHECK: attributes #11 = { {{.*}}"target-features"="+64bit,+a,+f,+m,+save-restore,+zicsr,+zifencei,+zve32f,+zve32x,+zvl32b,-relax,-zbb,-zfa" }
81
+ // CHECK: attributes #12 = { {{.*}}"target-features"="+64bit,+a,+d,+f,+m,+save-restore,+zicsr,+zifencei,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl32b,+zvl64b,-relax,-zbb,-zfa" }
0 commit comments