xref: /llvm-project/clang/test/CodeGen/AArch64/fmv-dependencies.c (revision 474f5d2aefb44430b89ed72774a3c1d26a0adfb1)
1207e5cccSFangrui Song // Test/document all of the dependencies between possible AArch64 FMV extensions.
2207e5cccSFangrui Song // Also test the name mangling.
3207e5cccSFangrui Song 
4207e5cccSFangrui Song // RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -emit-llvm -S -o - %s | FileCheck %s
5207e5cccSFangrui Song 
6207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Maes() #[[aes:[0-9]+]] {
7207e5cccSFangrui Song __attribute__((target_version("aes"))) int fmv(void) { return 0; }
8207e5cccSFangrui Song 
9207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mbf16() #[[bf16:[0-9]+]] {
10207e5cccSFangrui Song __attribute__((target_version("bf16"))) int fmv(void) { return 0; }
11207e5cccSFangrui Song 
12207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mbti() #[[bti:[0-9]+]] {
13207e5cccSFangrui Song __attribute__((target_version("bti"))) int fmv(void) { return 0; }
14207e5cccSFangrui Song 
15207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mcrc() #[[crc:[0-9]+]] {
16207e5cccSFangrui Song __attribute__((target_version("crc"))) int fmv(void) { return 0; }
17207e5cccSFangrui Song 
18207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mdit() #[[dit:[0-9]+]] {
19207e5cccSFangrui Song __attribute__((target_version("dit"))) int fmv(void) { return 0; }
20207e5cccSFangrui Song 
21207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mdotprod() #[[dotprod:[0-9]+]] {
22207e5cccSFangrui Song __attribute__((target_version("dotprod"))) int fmv(void) { return 0; }
23207e5cccSFangrui Song 
24207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mdpb() #[[dpb:[0-9]+]] {
25207e5cccSFangrui Song __attribute__((target_version("dpb"))) int fmv(void) { return 0; }
26207e5cccSFangrui Song 
27207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mdpb2() #[[dpb2:[0-9]+]] {
28207e5cccSFangrui Song __attribute__((target_version("dpb2"))) int fmv(void) { return 0; }
29207e5cccSFangrui Song 
30207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mf32mm() #[[f32mm:[0-9]+]] {
31207e5cccSFangrui Song __attribute__((target_version("f32mm"))) int fmv(void) { return 0; }
32207e5cccSFangrui Song 
33207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mf64mm() #[[f64mm:[0-9]+]] {
34207e5cccSFangrui Song __attribute__((target_version("f64mm"))) int fmv(void) { return 0; }
35207e5cccSFangrui Song 
36207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mfcma() #[[fcma:[0-9]+]] {
37207e5cccSFangrui Song __attribute__((target_version("fcma"))) int fmv(void) { return 0; }
38207e5cccSFangrui Song 
39207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mflagm() #[[flagm:[0-9]+]] {
40207e5cccSFangrui Song __attribute__((target_version("flagm"))) int fmv(void) { return 0; }
41207e5cccSFangrui Song 
42207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mflagm2() #[[flagm2:[0-9]+]] {
43207e5cccSFangrui Song __attribute__((target_version("flagm2"))) int fmv(void) { return 0; }
44207e5cccSFangrui Song 
4593011fe2SAlexandros Lamprineas // CHECK: define dso_local i32 @fmv._Mfp() #[[fp:[0-9]+]] {
46207e5cccSFangrui Song __attribute__((target_version("fp"))) int fmv(void) { return 0; }
47207e5cccSFangrui Song 
48207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mfp16() #[[fp16:[0-9]+]] {
49207e5cccSFangrui Song __attribute__((target_version("fp16"))) int fmv(void) { return 0; }
50207e5cccSFangrui Song 
51207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mfp16fml() #[[fp16fml:[0-9]+]] {
52207e5cccSFangrui Song __attribute__((target_version("fp16fml"))) int fmv(void) { return 0; }
53207e5cccSFangrui Song 
54207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mfrintts() #[[frintts:[0-9]+]] {
55207e5cccSFangrui Song __attribute__((target_version("frintts"))) int fmv(void) { return 0; }
56207e5cccSFangrui Song 
57207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mi8mm() #[[i8mm:[0-9]+]] {
58207e5cccSFangrui Song __attribute__((target_version("i8mm"))) int fmv(void) { return 0; }
59207e5cccSFangrui Song 
60207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mjscvt() #[[jscvt:[0-9]+]] {
61207e5cccSFangrui Song __attribute__((target_version("jscvt"))) int fmv(void) { return 0; }
62207e5cccSFangrui Song 
63207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mlse() #[[lse:[0-9]+]] {
64207e5cccSFangrui Song __attribute__((target_version("lse"))) int fmv(void) { return 0; }
65207e5cccSFangrui Song 
66207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mmemtag() #[[memtag:[0-9]+]] {
67207e5cccSFangrui Song __attribute__((target_version("memtag"))) int fmv(void) { return 0; }
68207e5cccSFangrui Song 
69207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mmops() #[[mops:[0-9]+]] {
70207e5cccSFangrui Song __attribute__((target_version("mops"))) int fmv(void) { return 0; }
71207e5cccSFangrui Song 
72207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mrcpc() #[[rcpc:[0-9]+]] {
73207e5cccSFangrui Song __attribute__((target_version("rcpc"))) int fmv(void) { return 0; }
74207e5cccSFangrui Song 
75207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mrcpc2() #[[rcpc2:[0-9]+]] {
76207e5cccSFangrui Song __attribute__((target_version("rcpc2"))) int fmv(void) { return 0; }
77207e5cccSFangrui Song 
78207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mrcpc3() #[[rcpc3:[0-9]+]] {
79207e5cccSFangrui Song __attribute__((target_version("rcpc3"))) int fmv(void) { return 0; }
80207e5cccSFangrui Song 
81207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mrdm() #[[rdm:[0-9]+]] {
82207e5cccSFangrui Song __attribute__((target_version("rdm"))) int fmv(void) { return 0; }
83207e5cccSFangrui Song 
84207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mrng() #[[rng:[0-9]+]] {
85207e5cccSFangrui Song __attribute__((target_version("rng"))) int fmv(void) { return 0; }
86207e5cccSFangrui Song 
87207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msb() #[[sb:[0-9]+]] {
88207e5cccSFangrui Song __attribute__((target_version("sb"))) int fmv(void) { return 0; }
89207e5cccSFangrui Song 
90207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msha2() #[[sha2:[0-9]+]] {
91207e5cccSFangrui Song __attribute__((target_version("sha2"))) int fmv(void) { return 0; }
92207e5cccSFangrui Song 
93207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msha3() #[[sha3:[0-9]+]] {
94207e5cccSFangrui Song __attribute__((target_version("sha3"))) int fmv(void) { return 0; }
95207e5cccSFangrui Song 
9693011fe2SAlexandros Lamprineas // CHECK: define dso_local i32 @fmv._Msimd() #[[simd:[0-9]+]] {
97207e5cccSFangrui Song __attribute__((target_version("simd"))) int fmv(void) { return 0; }
98207e5cccSFangrui Song 
99207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msm4() #[[sm4:[0-9]+]] {
100207e5cccSFangrui Song __attribute__((target_version("sm4"))) int fmv(void) { return 0; }
101207e5cccSFangrui Song 
102207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msme() #[[sme:[0-9]+]] {
103207e5cccSFangrui Song __attribute__((target_version("sme"))) int fmv(void) { return 0; }
104207e5cccSFangrui Song 
105207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msme-f64f64() #[[sme_f64f64:[0-9]+]] {
106207e5cccSFangrui Song __attribute__((target_version("sme-f64f64"))) int fmv(void) { return 0; }
107207e5cccSFangrui Song 
108207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msme-i16i64() #[[sme_i16i64:[0-9]+]] {
109207e5cccSFangrui Song __attribute__((target_version("sme-i16i64"))) int fmv(void) { return 0; }
110207e5cccSFangrui Song 
111207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msme2() #[[sme2:[0-9]+]] {
112207e5cccSFangrui Song __attribute__((target_version("sme2"))) int fmv(void) { return 0; }
113207e5cccSFangrui Song 
114207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mssbs() #[[ssbs:[0-9]+]] {
115207e5cccSFangrui Song __attribute__((target_version("ssbs"))) int fmv(void) { return 0; }
116207e5cccSFangrui Song 
117207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve() #[[sve:[0-9]+]] {
118207e5cccSFangrui Song __attribute__((target_version("sve"))) int fmv(void) { return 0; }
119207e5cccSFangrui Song 
120207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve2() #[[sve2:[0-9]+]] {
121207e5cccSFangrui Song __attribute__((target_version("sve2"))) int fmv(void) { return 0; }
122207e5cccSFangrui Song 
123207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve2-aes() #[[sve2_aes:[0-9]+]] {
124207e5cccSFangrui Song __attribute__((target_version("sve2-aes"))) int fmv(void) { return 0; }
125207e5cccSFangrui Song 
126207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve2-bitperm() #[[sve2_bitperm:[0-9]+]] {
127207e5cccSFangrui Song __attribute__((target_version("sve2-bitperm"))) int fmv(void) { return 0; }
128207e5cccSFangrui Song 
129207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve2-sha3() #[[sve2_sha3:[0-9]+]] {
130207e5cccSFangrui Song __attribute__((target_version("sve2-sha3"))) int fmv(void) { return 0; }
131207e5cccSFangrui Song 
132207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Msve2-sm4() #[[sve2_sm4:[0-9]+]] {
133207e5cccSFangrui Song __attribute__((target_version("sve2-sm4"))) int fmv(void) { return 0; }
134207e5cccSFangrui Song 
135207e5cccSFangrui Song // CHECK: define dso_local i32 @fmv._Mwfxt() #[[wfxt:[0-9]+]] {
136207e5cccSFangrui Song __attribute__((target_version("wfxt"))) int fmv(void) { return 0; }
137207e5cccSFangrui Song 
138207e5cccSFangrui Song // CHECK-NOT: define dso_local i32 @fmv._M{{.*}}
139207e5cccSFangrui Song __attribute__((target_version("non_existent_extension"))) int fmv(void);
140207e5cccSFangrui Song 
141207e5cccSFangrui Song __attribute__((target_version("default"))) int fmv(void);
142207e5cccSFangrui Song 
143207e5cccSFangrui Song int caller() {
144207e5cccSFangrui Song   return fmv();
145207e5cccSFangrui Song }
146207e5cccSFangrui Song 
14793011fe2SAlexandros Lamprineas // CHECK: attributes #[[aes]] = { {{.*}} "target-features"="+aes,+fp-armv8,+neon,+outline-atomics,+v8a"
14893011fe2SAlexandros Lamprineas // CHECK: attributes #[[bf16]] = { {{.*}} "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+v8a"
14993011fe2SAlexandros Lamprineas // CHECK: attributes #[[bti]] = { {{.*}} "target-features"="+bti,+fp-armv8,+neon,+outline-atomics,+v8a"
15093011fe2SAlexandros Lamprineas // CHECK: attributes #[[crc]] = { {{.*}} "target-features"="+crc,+fp-armv8,+neon,+outline-atomics,+v8a"
15193011fe2SAlexandros Lamprineas // CHECK: attributes #[[dit]] = { {{.*}} "target-features"="+dit,+fp-armv8,+neon,+outline-atomics,+v8a"
15293011fe2SAlexandros Lamprineas // CHECK: attributes #[[dotprod]] = { {{.*}} "target-features"="+dotprod,+fp-armv8,+neon,+outline-atomics,+v8a"
15393011fe2SAlexandros Lamprineas // CHECK: attributes #[[dpb]] = { {{.*}} "target-features"="+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a"
15493011fe2SAlexandros Lamprineas // CHECK: attributes #[[dpb2]] = { {{.*}} "target-features"="+ccdp,+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a"
15593011fe2SAlexandros Lamprineas // CHECK: attributes #[[f32mm]] = { {{.*}} "target-features"="+f32mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a"
15693011fe2SAlexandros Lamprineas // CHECK: attributes #[[f64mm]] = { {{.*}} "target-features"="+f64mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a"
15793011fe2SAlexandros Lamprineas // CHECK: attributes #[[fcma]] = { {{.*}} "target-features"="+complxnum,+fp-armv8,+neon,+outline-atomics,+v8a"
15893011fe2SAlexandros Lamprineas // CHECK: attributes #[[flagm]] = { {{.*}} "target-features"="+flagm,+fp-armv8,+neon,+outline-atomics,+v8a"
15993011fe2SAlexandros Lamprineas // CHECK: attributes #[[flagm2]] = { {{.*}} "target-features"="+altnzcv,+flagm,+fp-armv8,+neon,+outline-atomics,+v8a"
16093011fe2SAlexandros Lamprineas // CHECK: attributes #[[fp]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a"
16193011fe2SAlexandros Lamprineas // CHECK: attributes #[[fp16]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+v8a"
16293011fe2SAlexandros Lamprineas // CHECK: attributes #[[fp16fml]] = { {{.*}} "target-features"="+fp-armv8,+fp16fml,+fullfp16,+neon,+outline-atomics,+v8a"
16393011fe2SAlexandros Lamprineas // CHECK: attributes #[[frintts]] = { {{.*}} "target-features"="+fp-armv8,+fptoint,+neon,+outline-atomics,+v8a"
16493011fe2SAlexandros Lamprineas // CHECK: attributes #[[i8mm]] = { {{.*}} "target-features"="+fp-armv8,+i8mm,+neon,+outline-atomics,+v8a"
16593011fe2SAlexandros Lamprineas // CHECK: attributes #[[jscvt]] = { {{.*}} "target-features"="+fp-armv8,+jsconv,+neon,+outline-atomics,+v8a"
16693011fe2SAlexandros Lamprineas // CHECK: attributes #[[lse]] = { {{.*}} "target-features"="+fp-armv8,+lse,+neon,+outline-atomics,+v8a"
16793011fe2SAlexandros Lamprineas // CHECK: attributes #[[memtag]] = { {{.*}} "target-features"="+fp-armv8,+mte,+neon,+outline-atomics,+v8a"
16893011fe2SAlexandros Lamprineas // CHECK: attributes #[[mops]] = { {{.*}} "target-features"="+fp-armv8,+mops,+neon,+outline-atomics,+v8a"
16993011fe2SAlexandros Lamprineas // CHECK: attributes #[[rcpc]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+rcpc,+v8a"
17093011fe2SAlexandros Lamprineas // CHECK: attributes #[[rcpc2]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+rcpc,+rcpc-immo,+v8a"
17193011fe2SAlexandros Lamprineas // CHECK: attributes #[[rcpc3]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+rcpc,+rcpc-immo,+rcpc3,+v8a"
17293011fe2SAlexandros Lamprineas // CHECK: attributes #[[rdm]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+rdm,+v8a"
17393011fe2SAlexandros Lamprineas // CHECK: attributes #[[rng]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+rand,+v8a"
17493011fe2SAlexandros Lamprineas // CHECK: attributes #[[sb]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+sb,+v8a"
17593011fe2SAlexandros Lamprineas // CHECK: attributes #[[sha2]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+sha2,+v8a"
17693011fe2SAlexandros Lamprineas // CHECK: attributes #[[sha3]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+sha2,+sha3,+v8a"
17793011fe2SAlexandros Lamprineas // CHECK: attributes #[[simd]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a"
17893011fe2SAlexandros Lamprineas // CHECK: attributes #[[sm4]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+sm4,+v8a"
17993011fe2SAlexandros Lamprineas // CHECK: attributes #[[sme]] = { {{.*}} "target-features"="+bf16,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sme,+v8a"
18093011fe2SAlexandros Lamprineas // CHECK: attributes #[[sme_f64f64]] = { {{.*}} "target-features"="+bf16,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sme,+sme-f64f64,+v8a"
18193011fe2SAlexandros Lamprineas // CHECK: attributes #[[sme_i16i64]] = { {{.*}} "target-features"="+bf16,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sme,+sme-i16i64,+v8a"
18293011fe2SAlexandros Lamprineas // CHECK: attributes #[[sme2]] = { {{.*}} "target-features"="+bf16,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sme,+sme2,+v8a"
18393011fe2SAlexandros Lamprineas // CHECK: attributes #[[ssbs]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+ssbs,+v8a"
18493011fe2SAlexandros Lamprineas // CHECK: attributes #[[sve]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a"
18593011fe2SAlexandros Lamprineas // CHECK: attributes #[[sve2]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve2,+v8a"
18693011fe2SAlexandros Lamprineas // CHECK: attributes #[[sve2_aes]] = { {{.*}} "target-features"="+aes,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve-aes,+sve2,+sve2-aes,+v8a"
187*92564850SCarolineConcatto // CHECK: attributes #[[sve2_bitperm]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+sve-bitperm,+sve2,+sve2-bitperm,+v8a"
18893011fe2SAlexandros Lamprineas // CHECK: attributes #[[sve2_sha3]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sha2,+sha3,+sve,+sve2,+sve2-sha3,+v8a"
18993011fe2SAlexandros Lamprineas // CHECK: attributes #[[sve2_sm4]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sm4,+sve,+sve2,+sve2-sm4,+v8a"
19093011fe2SAlexandros Lamprineas // CHECK: attributes #[[wfxt]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a,+wfxt"
191