3
3
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature -fmv -S -emit-llvm -o - %s | FileCheck %s -check-prefix=CHECK-NOFMV
4
4
5
5
int __attribute__((target_clones ("lse+aes" , "sve2" ))) ftc (void ) { return 0 ; }
6
- int __attribute__((target_clones ("sha2" , "sha2+memtag2 " , " default " ))) ftc_def (void ) { return 1 ; }
6
+ int __attribute__((target_clones ("sha2" , "sha2+memtag " , " default " ))) ftc_def (void ) { return 1 ; }
7
7
int __attribute__((target_clones ("sha2" , "default" ))) ftc_dup1 (void ) { return 2 ; }
8
8
int __attribute__((target_clones ("fp" , "crc+dotprod" ))) ftc_dup2 (void ) { return 3 ; }
9
9
int foo () {
@@ -12,7 +12,7 @@ int foo() {
12
12
13
13
inline int __attribute__((target_clones ("rng+simd" , "rcpc+predres" , "sve2-aes+wfxt" ))) ftc_inline1 (void ) { return 1 ; }
14
14
inline int __attribute__((target_clones ("fp16" , "fcma+sve2-bitperm" , "default" ))) ftc_inline2 (void );
15
- inline int __attribute__((target_clones ("bti " , "sve+sb" ))) ftc_inline3 (void ) { return 3 ; }
15
+ inline int __attribute__((target_clones ("mops " , "sve+sb" ))) ftc_inline3 (void ) { return 3 ; }
16
16
17
17
int __attribute__((target_clones ("default" ))) ftc_direct (void ) { return 4 ; }
18
18
@@ -56,16 +56,16 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
56
56
// CHECK-NEXT: resolver_entry:
57
57
// CHECK-NEXT: call void @__init_cpu_features_resolver()
58
58
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
59
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 16512
60
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 16512
59
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 8320
60
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 8320
61
61
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
62
62
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
63
63
// CHECK: resolver_return:
64
64
// CHECK-NEXT: ret ptr @ftc._MaesMlse
65
65
// CHECK: resolver_else:
66
66
// CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
67
- // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 68719476736
68
- // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 68719476736
67
+ // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 268435456
68
+ // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 268435456
69
69
// CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
70
70
// CHECK-NEXT: br i1 [[TMP7]], label [[RESOLVER_RETURN1:%.*]], label [[RESOLVER_ELSE2:%.*]]
71
71
// CHECK: resolver_return1:
@@ -81,7 +81,7 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
81
81
//
82
82
//
83
83
// CHECK: Function Attrs: noinline nounwind optnone
84
- // CHECK-LABEL: @ftc_def._Mmemtag2Msha2 (
84
+ // CHECK-LABEL: @ftc_def._MmemtagMsha2 (
85
85
// CHECK-NEXT: entry:
86
86
// CHECK-NEXT: ret i32 1
87
87
//
@@ -90,16 +90,16 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
90
90
// CHECK-NEXT: resolver_entry:
91
91
// CHECK-NEXT: call void @__init_cpu_features_resolver()
92
92
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
93
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 17592186048512
94
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 17592186048512
93
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 17179871232
94
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 17179871232
95
95
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
96
96
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
97
97
// CHECK: resolver_return:
98
- // CHECK-NEXT: ret ptr @ftc_def._Mmemtag2Msha2
98
+ // CHECK-NEXT: ret ptr @ftc_def._MmemtagMsha2
99
99
// CHECK: resolver_else:
100
100
// CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
101
- // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 4096
102
- // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 4096
101
+ // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 2048
102
+ // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 2048
103
103
// CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
104
104
// CHECK-NEXT: br i1 [[TMP7]], label [[RESOLVER_RETURN1:%.*]], label [[RESOLVER_ELSE2:%.*]]
105
105
// CHECK: resolver_return1:
@@ -118,8 +118,8 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
118
118
// CHECK-NEXT: resolver_entry:
119
119
// CHECK-NEXT: call void @__init_cpu_features_resolver()
120
120
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
121
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 4096
122
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 4096
121
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 2048
122
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 2048
123
123
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
124
124
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
125
125
// CHECK: resolver_return:
@@ -198,16 +198,16 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
198
198
// CHECK-NEXT: resolver_entry:
199
199
// CHECK-NEXT: call void @__init_cpu_features_resolver()
200
200
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
201
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 18014535948435456
202
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 18014535948435456
201
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 550292684800
202
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 550292684800
203
203
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
204
204
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
205
205
// CHECK: resolver_return:
206
206
// CHECK-NEXT: ret ptr @ftc_inline1._Msve2-aesMwfxt
207
207
// CHECK: resolver_else:
208
208
// CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
209
- // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 140737492549632
210
- // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 140737492549632
209
+ // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 68720001024
210
+ // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 68720001024
211
211
// CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
212
212
// CHECK-NEXT: br i1 [[TMP7]], label [[RESOLVER_RETURN1:%.*]], label [[RESOLVER_ELSE2:%.*]]
213
213
// CHECK: resolver_return1:
@@ -228,16 +228,16 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
228
228
// CHECK-NEXT: resolver_entry:
229
229
// CHECK-NEXT: call void @__init_cpu_features_resolver()
230
230
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
231
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 549757911040
232
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 549757911040
231
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 1074003968
232
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 1074003968
233
233
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
234
234
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
235
235
// CHECK: resolver_return:
236
236
// CHECK-NEXT: ret ptr @ftc_inline2._MfcmaMsve2-bitperm
237
237
// CHECK: resolver_else:
238
238
// CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
239
- // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 65536
240
- // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 65536
239
+ // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 16384
240
+ // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 16384
241
241
// CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
242
242
// CHECK-NEXT: br i1 [[TMP7]], label [[RESOLVER_RETURN1:%.*]], label [[RESOLVER_ELSE2:%.*]]
243
243
// CHECK: resolver_return1:
@@ -250,20 +250,20 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
250
250
// CHECK-NEXT: resolver_entry:
251
251
// CHECK-NEXT: call void @__init_cpu_features_resolver()
252
252
// CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
253
- // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 70369817919488
254
- // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 70369817919488
253
+ // CHECK-NEXT: [[TMP1:%.*]] = and i64 [[TMP0]], 34393292800
254
+ // CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], 34393292800
255
255
// CHECK-NEXT: [[TMP3:%.*]] = and i1 true, [[TMP2]]
256
256
// CHECK-NEXT: br i1 [[TMP3]], label [[RESOLVER_RETURN:%.*]], label [[RESOLVER_ELSE:%.*]]
257
257
// CHECK: resolver_return:
258
258
// CHECK-NEXT: ret ptr @ftc_inline3._MsbMsve
259
259
// CHECK: resolver_else:
260
260
// CHECK-NEXT: [[TMP4:%.*]] = load i64, ptr @__aarch64_cpu_features, align 8
261
- // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 1125899906842624
262
- // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 1125899906842624
261
+ // CHECK-NEXT: [[TMP5:%.*]] = and i64 [[TMP4]], 17592186044416
262
+ // CHECK-NEXT: [[TMP6:%.*]] = icmp eq i64 [[TMP5]], 17592186044416
263
263
// CHECK-NEXT: [[TMP7:%.*]] = and i1 true, [[TMP6]]
264
264
// CHECK-NEXT: br i1 [[TMP7]], label [[RESOLVER_RETURN1:%.*]], label [[RESOLVER_ELSE2:%.*]]
265
265
// CHECK: resolver_return1:
266
- // CHECK-NEXT: ret ptr @ftc_inline3._Mbti
266
+ // CHECK-NEXT: ret ptr @ftc_inline3._Mmops
267
267
// CHECK: resolver_else2:
268
268
// CHECK-NEXT: ret ptr @ftc_inline3.default
269
269
//
@@ -329,7 +329,7 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
329
329
//
330
330
//
331
331
// CHECK: Function Attrs: noinline nounwind optnone
332
- // CHECK-LABEL: @ftc_inline3._Mbti (
332
+ // CHECK-LABEL: @ftc_inline3._Mmops (
333
333
// CHECK-NEXT: entry:
334
334
// CHECK-NEXT: ret i32 3
335
335
//
@@ -407,17 +407,16 @@ inline int __attribute__((target_clones("fp16", "sve2-bitperm+fcma", "default"))
407
407
// CHECK: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+lse,+neon" }
408
408
// CHECK: attributes #[[ATTR1:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon,+sve,+sve2" }
409
409
// CHECK: attributes #[[ATTR2:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon,+sha2" }
410
- // CHECK: attributes #[[ATTR3:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+mte,+neon,+sha2" }
411
- // CHECK: attributes #[[ATTR4:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon" }
412
- // CHECK: attributes #[[ATTR5:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+crc,+dotprod,+fp-armv8,+neon" }
413
- // CHECK: attributes #[[ATTR6:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
414
- // CHECK: attributes #[[ATTR7:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon" }
415
- // CHECK: attributes #[[ATTR8:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+complxnum,+fp-armv8,+fullfp16,+neon,+sve,+sve2,+sve2-bitperm" }
416
- // CHECK: attributes #[[ATTR9:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon,+rand" }
417
- // CHECK: attributes #[[ATTR10:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+predres,+rcpc" }
418
- // CHECK: attributes #[[ATTR11:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon,+sve,+sve2,+sve2-aes,+wfxt" }
419
- // CHECK: attributes #[[ATTR12:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+bti" }
420
- // CHECK: attributes #[[ATTR13:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon,+sb,+sve" }
410
+ // CHECK: attributes #[[ATTR3:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon" }
411
+ // CHECK: attributes #[[ATTR4:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+crc,+dotprod,+fp-armv8,+neon" }
412
+ // CHECK: attributes #[[ATTR5:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
413
+ // CHECK: attributes #[[ATTR6:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon" }
414
+ // CHECK: attributes #[[ATTR7:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+complxnum,+fp-armv8,+fullfp16,+neon,+sve,+sve2,+sve2-bitperm" }
415
+ // CHECK: attributes #[[ATTR8:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+neon,+rand" }
416
+ // CHECK: attributes #[[ATTR9:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+predres,+rcpc" }
417
+ // CHECK: attributes #[[ATTR10:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon,+sve,+sve2,+sve2-aes,+wfxt" }
418
+ // CHECK: attributes #[[ATTR11:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+mops" }
419
+ // CHECK: attributes #[[ATTR12:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+fp-armv8,+fullfp16,+neon,+sb,+sve" }
421
420
//.
422
421
// CHECK-NOFMV: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="-fmv" }
423
422
// CHECK-NOFMV: attributes #[[ATTR1:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="-fmv" }
0 commit comments