1
1
// File generated by `rustc_codegen_gcc/tools/generate_intrinsics.py`
2
2
// DO NOT EDIT IT!
3
3
/// Translate a given LLVM intrinsic name to an equivalent GCC one.
4
- fn map_arch_intrinsic(name : &str) -> &str {
5
- let Some(name) = name .strip_prefix("llvm.") else {
6
- unimplemented!("***** unsupported LLVM intrinsic {}", name )
4
+ fn map_arch_intrinsic(full_name : &str) -> &'static str {
5
+ let Some(name) = full_name .strip_prefix("llvm.") else {
6
+ unimplemented!("***** unsupported LLVM intrinsic {}", full_name )
7
7
};
8
8
let Some((arch, name)) = name.split_once('.') else {
9
9
unimplemented!("***** unsupported LLVM intrinsic {}", name)
10
10
};
11
11
match arch {
12
12
"AMDGPU" => {
13
13
#[allow(non_snake_case)]
14
- fn AMDGPU(name: &str) -> &str {
14
+ fn AMDGPU(name: &str, full_name: &str ) -> &'static str {
15
15
match name {
16
16
// AMDGPU
17
17
"div.fixup.f32" => "__builtin_amdgpu_div_fixup",
@@ -42,14 +42,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
42
42
"trig.preop.f64" => "__builtin_amdgpu_trig_preop",
43
43
"trig.preop.v2f64" => "__builtin_amdgpu_trig_preop",
44
44
"trig.preop.v4f32" => "__builtin_amdgpu_trig_preop",
45
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
45
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
46
46
}
47
47
}
48
- AMDGPU(name)
48
+ AMDGPU(name, full_name )
49
49
}
50
50
"aarch64" => {
51
51
#[allow(non_snake_case)]
52
- fn aarch64(name: &str) -> &str {
52
+ fn aarch64(name: &str, full_name: &str ) -> &'static str {
53
53
match name {
54
54
// aarch64
55
55
"chkfeat" => "__builtin_arm_chkfeat",
@@ -75,14 +75,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
75
75
"tcommit" => "__builtin_arm_tcommit",
76
76
"tstart" => "__builtin_arm_tstart",
77
77
"ttest" => "__builtin_arm_ttest",
78
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
78
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
79
79
}
80
80
}
81
- aarch64(name)
81
+ aarch64(name, full_name )
82
82
}
83
83
"amdgcn" => {
84
84
#[allow(non_snake_case)]
85
- fn amdgcn(name: &str) -> &str {
85
+ fn amdgcn(name: &str, full_name: &str ) -> &'static str {
86
86
match name {
87
87
// amdgcn
88
88
"alignbyte" => "__builtin_amdgcn_alignbyte",
@@ -99,6 +99,8 @@ fn map_arch_intrinsic(name: &str) -> &str {
99
99
"cvt.f32.fp8" => "__builtin_amdgcn_cvt_f32_fp8",
100
100
"cvt.off.f32.i4" => "__builtin_amdgcn_cvt_off_f32_i4",
101
101
"cvt.pk.bf8.f32" => "__builtin_amdgcn_cvt_pk_bf8_f32",
102
+ "cvt.pk.f16.bf8" => "__builtin_amdgcn_cvt_pk_f16_bf8",
103
+ "cvt.pk.f16.fp8" => "__builtin_amdgcn_cvt_pk_f16_fp8",
102
104
"cvt.pk.f32.bf8" => "__builtin_amdgcn_cvt_pk_f32_bf8",
103
105
"cvt.pk.f32.fp8" => "__builtin_amdgcn_cvt_pk_f32_fp8",
104
106
"cvt.pk.fp8.f32" => "__builtin_amdgcn_cvt_pk_fp8_f32",
@@ -292,6 +294,7 @@ fn map_arch_intrinsic(name: &str) -> &str {
292
294
"s.sendmsg" => "__builtin_amdgcn_s_sendmsg",
293
295
"s.sendmsghalt" => "__builtin_amdgcn_s_sendmsghalt",
294
296
"s.setprio" => "__builtin_amdgcn_s_setprio",
297
+ "s.setprio.inc.wg" => "__builtin_amdgcn_s_setprio_inc_wg",
295
298
"s.setreg" => "__builtin_amdgcn_s_setreg",
296
299
"s.sleep" => "__builtin_amdgcn_s_sleep",
297
300
"s.sleep.var" => "__builtin_amdgcn_s_sleep_var",
@@ -356,14 +359,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
356
359
"workitem.id.x" => "__builtin_amdgcn_workitem_id_x",
357
360
"workitem.id.y" => "__builtin_amdgcn_workitem_id_y",
358
361
"workitem.id.z" => "__builtin_amdgcn_workitem_id_z",
359
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
362
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
360
363
}
361
364
}
362
- amdgcn(name)
365
+ amdgcn(name, full_name )
363
366
}
364
367
"arm" => {
365
368
#[allow(non_snake_case)]
366
- fn arm(name: &str) -> &str {
369
+ fn arm(name: &str, full_name: &str ) -> &'static str {
367
370
match name {
368
371
// arm
369
372
"cdp" => "__builtin_arm_cdp",
@@ -465,14 +468,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
465
468
"usub8" => "__builtin_arm_usub8",
466
469
"uxtab16" => "__builtin_arm_uxtab16",
467
470
"uxtb16" => "__builtin_arm_uxtb16",
468
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
471
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
469
472
}
470
473
}
471
- arm(name)
474
+ arm(name, full_name )
472
475
}
473
476
"bpf" => {
474
477
#[allow(non_snake_case)]
475
- fn bpf(name: &str) -> &str {
478
+ fn bpf(name: &str, full_name: &str ) -> &'static str {
476
479
match name {
477
480
// bpf
478
481
"btf.type.id" => "__builtin_bpf_btf_type_id",
@@ -487,25 +490,25 @@ fn map_arch_intrinsic(name: &str) -> &str {
487
490
"preserve.field.info" => "__builtin_bpf_preserve_field_info",
488
491
"preserve.type.info" => "__builtin_bpf_preserve_type_info",
489
492
"pseudo" => "__builtin_bpf_pseudo",
490
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
493
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
491
494
}
492
495
}
493
- bpf(name)
496
+ bpf(name, full_name )
494
497
}
495
498
"cuda" => {
496
499
#[allow(non_snake_case)]
497
- fn cuda(name: &str) -> &str {
500
+ fn cuda(name: &str, full_name: &str ) -> &'static str {
498
501
match name {
499
502
// cuda
500
503
"syncthreads" => "__syncthreads",
501
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
504
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
502
505
}
503
506
}
504
- cuda(name)
507
+ cuda(name, full_name )
505
508
}
506
509
"hexagon" => {
507
510
#[allow(non_snake_case)]
508
- fn hexagon(name: &str) -> &str {
511
+ fn hexagon(name: &str, full_name: &str ) -> &'static str {
509
512
match name {
510
513
// hexagon
511
514
"A2.abs" => "__builtin_HEXAGON_A2_abs",
@@ -2479,14 +2482,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
2479
2482
"prefetch" => "__builtin_HEXAGON_prefetch",
2480
2483
"vmemcpy" => "__builtin_hexagon_vmemcpy",
2481
2484
"vmemset" => "__builtin_hexagon_vmemset",
2482
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
2485
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
2483
2486
}
2484
2487
}
2485
- hexagon(name)
2488
+ hexagon(name, full_name )
2486
2489
}
2487
2490
"loongarch" => {
2488
2491
#[allow(non_snake_case)]
2489
- fn loongarch(name: &str) -> &str {
2492
+ fn loongarch(name: &str, full_name: &str ) -> &'static str {
2490
2493
match name {
2491
2494
// loongarch
2492
2495
"asrtgt.d" => "__builtin_loongarch_asrtgt_d",
@@ -3988,14 +3991,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
3988
3991
"movfcsr2gr" => "__builtin_loongarch_movfcsr2gr",
3989
3992
"movgr2fcsr" => "__builtin_loongarch_movgr2fcsr",
3990
3993
"syscall" => "__builtin_loongarch_syscall",
3991
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
3994
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
3992
3995
}
3993
3996
}
3994
- loongarch(name)
3997
+ loongarch(name, full_name )
3995
3998
}
3996
3999
"mips" => {
3997
4000
#[allow(non_snake_case)]
3998
- fn mips(name: &str) -> &str {
4001
+ fn mips(name: &str, full_name: &str ) -> &'static str {
3999
4002
match name {
4000
4003
// mips
4001
4004
"absq.s.ph" => "__builtin_mips_absq_s_ph",
@@ -4669,14 +4672,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
4669
4672
"wrdsp" => "__builtin_mips_wrdsp",
4670
4673
"xor.v" => "__builtin_msa_xor_v",
4671
4674
"xori.b" => "__builtin_msa_xori_b",
4672
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
4675
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
4673
4676
}
4674
4677
}
4675
- mips(name)
4678
+ mips(name, full_name )
4676
4679
}
4677
4680
"nvvm" => {
4678
4681
#[allow(non_snake_case)]
4679
- fn nvvm(name: &str) -> &str {
4682
+ fn nvvm(name: &str, full_name: &str ) -> &'static str {
4680
4683
match name {
4681
4684
// nvvm
4682
4685
"abs.i" => "__nvvm_abs_i",
@@ -5024,6 +5027,7 @@ fn map_arch_intrinsic(name: &str) -> &str {
5024
5027
"nanosleep" => "__nvvm_nanosleep",
5025
5028
"neg.bf16" => "__nvvm_neg_bf16",
5026
5029
"neg.bf16x2" => "__nvvm_neg_bf16x2",
5030
+ "pm.event.mask" => "__nvvm_pm_event_mask",
5027
5031
"popc.i" => "__nvvm_popc_i",
5028
5032
"popc.ll" => "__nvvm_popc_ll",
5029
5033
"prmt" => "__nvvm_prmt",
@@ -5448,14 +5452,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
5448
5452
"vote.ballot.sync" => "__nvvm_vote_ballot_sync",
5449
5453
"vote.uni" => "__nvvm_vote_uni",
5450
5454
"vote.uni.sync" => "__nvvm_vote_uni_sync",
5451
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
5455
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
5452
5456
}
5453
5457
}
5454
- nvvm(name)
5458
+ nvvm(name, full_name )
5455
5459
}
5456
5460
"ppc" => {
5457
5461
#[allow(non_snake_case)]
5458
- fn ppc(name: &str) -> &str {
5462
+ fn ppc(name: &str, full_name: &str ) -> &'static str {
5459
5463
match name {
5460
5464
// ppc
5461
5465
"addex" => "__builtin_ppc_addex",
@@ -5842,7 +5846,10 @@ fn map_arch_intrinsic(name: &str) -> &str {
5842
5846
"mulhdu" => "__builtin_ppc_mulhdu",
5843
5847
"mulhw" => "__builtin_ppc_mulhw",
5844
5848
"mulhwu" => "__builtin_ppc_mulhwu",
5849
+ "national2packed" => "__builtin_ppc_national2packed",
5845
5850
"pack.longdouble" => "__builtin_pack_longdouble",
5851
+ "packed2national" => "__builtin_ppc_packed2national",
5852
+ "packed2zoned" => "__builtin_ppc_packed2zoned",
5846
5853
"pdepd" => "__builtin_pdepd",
5847
5854
"pextd" => "__builtin_pextd",
5848
5855
"qpx.qvfabs" => "__builtin_qpx_qvfabs",
@@ -6035,14 +6042,15 @@ fn map_arch_intrinsic(name: &str) -> &str {
6035
6042
"vsx.xxinsertw" => "__builtin_vsx_xxinsertw",
6036
6043
"vsx.xxleqv" => "__builtin_vsx_xxleqv",
6037
6044
"vsx.xxpermx" => "__builtin_vsx_xxpermx",
6038
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name),
6045
+ "zoned2packed" => "__builtin_ppc_zoned2packed",
6046
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}"),
6039
6047
}
6040
6048
}
6041
- ppc(name)
6049
+ ppc(name, full_name )
6042
6050
}
6043
6051
"ptx" => {
6044
6052
#[allow(non_snake_case)]
6045
- fn ptx(name: &str) -> &str {
6053
+ fn ptx(name: &str, full_name: &str ) -> &'static str {
6046
6054
match name {
6047
6055
// ptx
6048
6056
"bar.sync" => "__builtin_ptx_bar_sync",
@@ -6063,14 +6071,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
6063
6071
"read.pm3" => "__builtin_ptx_read_pm3",
6064
6072
"read.smid" => "__builtin_ptx_read_smid",
6065
6073
"read.warpid" => "__builtin_ptx_read_warpid",
6066
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
6074
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
6067
6075
}
6068
6076
}
6069
- ptx(name)
6077
+ ptx(name, full_name )
6070
6078
}
6071
6079
"r600" => {
6072
6080
#[allow(non_snake_case)]
6073
- fn r600(name: &str) -> &str {
6081
+ fn r600(name: &str, full_name: &str ) -> &'static str {
6074
6082
match name {
6075
6083
// r600
6076
6084
"group.barrier" => "__builtin_r600_group_barrier",
@@ -6088,14 +6096,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
6088
6096
"read.tidig.x" => "__builtin_r600_read_tidig_x",
6089
6097
"read.tidig.y" => "__builtin_r600_read_tidig_y",
6090
6098
"read.tidig.z" => "__builtin_r600_read_tidig_z",
6091
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
6099
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
6092
6100
}
6093
6101
}
6094
- r600(name)
6102
+ r600(name, full_name )
6095
6103
}
6096
6104
"riscv" => {
6097
6105
#[allow(non_snake_case)]
6098
- fn riscv(name: &str) -> &str {
6106
+ fn riscv(name: &str, full_name: &str ) -> &'static str {
6099
6107
match name {
6100
6108
// riscv
6101
6109
"aes32dsi" => "__builtin_riscv_aes32dsi",
@@ -6119,14 +6127,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
6119
6127
"sha512sum0r" => "__builtin_riscv_sha512sum0r",
6120
6128
"sha512sum1" => "__builtin_riscv_sha512sum1",
6121
6129
"sha512sum1r" => "__builtin_riscv_sha512sum1r",
6122
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
6130
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
6123
6131
}
6124
6132
}
6125
- riscv(name)
6133
+ riscv(name, full_name )
6126
6134
}
6127
6135
"s390" => {
6128
6136
#[allow(non_snake_case)]
6129
- fn s390(name: &str) -> &str {
6137
+ fn s390(name: &str, full_name: &str ) -> &'static str {
6130
6138
match name {
6131
6139
// s390
6132
6140
"bdepg" => "__builtin_s390_bdepg",
@@ -6313,14 +6321,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
6313
6321
"vupllf" => "__builtin_s390_vupllf",
6314
6322
"vupllg" => "__builtin_s390_vupllg",
6315
6323
"vupllh" => "__builtin_s390_vupllh",
6316
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
6324
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
6317
6325
}
6318
6326
}
6319
- s390(name)
6327
+ s390(name, full_name )
6320
6328
}
6321
6329
"ve" => {
6322
6330
#[allow(non_snake_case)]
6323
- fn ve(name: &str) -> &str {
6331
+ fn ve(name: &str, full_name: &str ) -> &'static str {
6324
6332
match name {
6325
6333
// ve
6326
6334
"vl.andm.MMM" => "__builtin_ve_vl_andm_MMM",
@@ -7586,14 +7594,14 @@ fn map_arch_intrinsic(name: &str) -> &str {
7586
7594
"vl.vxor.vvvvl" => "__builtin_ve_vl_vxor_vvvvl",
7587
7595
"vl.xorm.MMM" => "__builtin_ve_vl_xorm_MMM",
7588
7596
"vl.xorm.mmm" => "__builtin_ve_vl_xorm_mmm",
7589
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
7597
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
7590
7598
}
7591
7599
}
7592
- ve(name)
7600
+ ve(name, full_name )
7593
7601
}
7594
7602
"x86" => {
7595
7603
#[allow(non_snake_case)]
7596
- fn x86(name: &str) -> &str {
7604
+ fn x86(name: &str, full_name: &str ) -> &'static str {
7597
7605
match name {
7598
7606
// x86
7599
7607
"aadd32" => "__builtin_ia32_aadd32",
@@ -10154,25 +10162,25 @@ fn map_arch_intrinsic(name: &str) -> &str {
10154
10162
"xresldtrk" => "__builtin_ia32_xresldtrk",
10155
10163
"xsusldtrk" => "__builtin_ia32_xsusldtrk",
10156
10164
"xtest" => "__builtin_ia32_xtest",
10157
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
10165
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
10158
10166
}
10159
10167
}
10160
- x86(name)
10168
+ x86(name, full_name )
10161
10169
}
10162
10170
"xcore" => {
10163
10171
#[allow(non_snake_case)]
10164
- fn xcore(name: &str) -> &str {
10172
+ fn xcore(name: &str, full_name: &str ) -> &'static str {
10165
10173
match name {
10166
10174
// xcore
10167
10175
"bitrev" => "__builtin_bitrev",
10168
10176
"getid" => "__builtin_getid",
10169
10177
"getps" => "__builtin_getps",
10170
10178
"setps" => "__builtin_setps",
10171
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
10179
+ _ => unimplemented!("***** unsupported LLVM intrinsic {full_name}" ),
10172
10180
}
10173
10181
}
10174
- xcore(name)
10182
+ xcore(name, full_name )
10175
10183
}
10176
- _ => unimplemented!("***** unsupported LLVM intrinsic {}", name ),
10184
+ _ => unimplemented!("***** unsupported LLVM architecture {arch}, intrinsic:{full_name}" ),
10177
10185
}
10178
10186
}
0 commit comments