aboutsummaryrefslogtreecommitdiff
blob: 2539ab7c275b7242df275bf225bf8abeae09c660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// REQUIRES: aarch64-registered-target
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -o - %s >/dev/null
#include <arm_sve.h>

uint64_t test_svcnth()
{
  // CHECK-LABEL: test_svcnth
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 31)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth();
}

uint64_t test_svcnth_pat()
{
  // CHECK-LABEL: test_svcnth_pat
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 0)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_POW2);
}

uint64_t test_svcnth_pat_1()
{
  // CHECK-LABEL: test_svcnth_pat_1
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 1)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL1);
}

uint64_t test_svcnth_pat_2()
{
  // CHECK-LABEL: test_svcnth_pat_2
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 2)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL2);
}

uint64_t test_svcnth_pat_3()
{
  // CHECK-LABEL: test_svcnth_pat_3
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 3)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL3);
}

uint64_t test_svcnth_pat_4()
{
  // CHECK-LABEL: test_svcnth_pat_4
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 4)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL4);
}

uint64_t test_svcnth_pat_5()
{
  // CHECK-LABEL: test_svcnth_pat_5
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 5)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL5);
}

uint64_t test_svcnth_pat_6()
{
  // CHECK-LABEL: test_svcnth_pat_6
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 6)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL6);
}

uint64_t test_svcnth_pat_7()
{
  // CHECK-LABEL: test_svcnth_pat_7
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 7)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL7);
}

uint64_t test_svcnth_pat_8()
{
  // CHECK-LABEL: test_svcnth_pat_8
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 8)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL8);
}

uint64_t test_svcnth_pat_9()
{
  // CHECK-LABEL: test_svcnth_pat_9
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 9)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL16);
}

uint64_t test_svcnth_pat_10()
{
  // CHECK-LABEL: test_svcnth_pat_10
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 10)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL32);
}

uint64_t test_svcnth_pat_11()
{
  // CHECK-LABEL: test_svcnth_pat_11
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 11)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL64);
}

uint64_t test_svcnth_pat_12()
{
  // CHECK-LABEL: test_svcnth_pat_12
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 12)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL128);
}

uint64_t test_svcnth_pat_13()
{
  // CHECK-LABEL: test_svcnth_pat_13
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 13)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_VL256);
}

uint64_t test_svcnth_pat_14()
{
  // CHECK-LABEL: test_svcnth_pat_14
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 29)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_MUL4);
}

uint64_t test_svcnth_pat_15()
{
  // CHECK-LABEL: test_svcnth_pat_15
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 30)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_MUL3);
}

uint64_t test_svcnth_pat_16()
{
  // CHECK-LABEL: test_svcnth_pat_16
  // CHECK: %[[INTRINSIC:.*]] = call i64 @llvm.aarch64.sve.cnth(i32 31)
  // CHECK: ret i64 %[[INTRINSIC]]
  return svcnth_pat(SV_ALL);
}