@@ -47,6 +47,7 @@ pub const Feature = enum {
47
47
bmi2 ,
48
48
branch_hint ,
49
49
branchfusion ,
50
+ bsf_bsr_0_clobbers_result ,
50
51
ccmp ,
51
52
cf ,
52
53
cldemote ,
@@ -167,6 +168,8 @@ pub const Feature = enum {
167
168
slow_unaligned_mem_32 ,
168
169
sm3 ,
169
170
sm4 ,
171
+ smap ,
172
+ smep ,
170
173
soft_float ,
171
174
sse ,
172
175
sse2 ,
@@ -497,6 +500,11 @@ pub const all_features = blk: {
497
500
.description = "CMP/TEST can be fused with conditional branches" ,
498
501
.dependencies = featureSet (&[_ ]Feature {}),
499
502
};
503
+ result [@intFromEnum (Feature .bsf_bsr_0_clobbers_result )] = .{
504
+ .llvm_name = null ,
505
+ .description = "BSF/BSR may clobber the lower 32-bits of the result register when the source is zero" ,
506
+ .dependencies = featureSet (&[_ ]Feature {}),
507
+ };
500
508
result [@intFromEnum (Feature .ccmp )] = .{
501
509
.llvm_name = "ccmp" ,
502
510
.description = "Support conditional cmp & test instructions" ,
@@ -1127,6 +1135,16 @@ pub const all_features = blk: {
1127
1135
.avx2 ,
1128
1136
}),
1129
1137
};
1138
+ result [@intFromEnum (Feature .smap )] = .{
1139
+ .llvm_name = null ,
1140
+ .description = "Enable Supervisor Mode Access Prevention" ,
1141
+ .dependencies = featureSet (&[_ ]Feature {}),
1142
+ };
1143
+ result [@intFromEnum (Feature .smep )] = .{
1144
+ .llvm_name = null ,
1145
+ .description = "Enable Supervisor Mode Execution Prevention" ,
1146
+ .dependencies = featureSet (&[_ ]Feature {}),
1147
+ };
1130
1148
result [@intFromEnum (Feature .soft_float )] = .{
1131
1149
.llvm_name = "soft-float" ,
1132
1150
.description = "Use software floating point features" ,
@@ -1371,6 +1389,8 @@ pub const cpu = struct {
1371
1389
.sha ,
1372
1390
.shstk ,
1373
1391
.slow_3ops_lea ,
1392
+ .smap ,
1393
+ .smep ,
1374
1394
.tuning_fast_imm_vector_shift ,
1375
1395
.vaes ,
1376
1396
.vpclmulqdq ,
@@ -1467,6 +1487,8 @@ pub const cpu = struct {
1467
1487
.sha ,
1468
1488
.shstk ,
1469
1489
.slow_3ops_lea ,
1490
+ .smap ,
1491
+ .smep ,
1470
1492
.tuning_fast_imm_vector_shift ,
1471
1493
.uintr ,
1472
1494
.vaes ,
@@ -1545,6 +1567,8 @@ pub const cpu = struct {
1545
1567
.slow_3ops_lea ,
1546
1568
.sm3 ,
1547
1569
.sm4 ,
1570
+ .smap ,
1571
+ .smep ,
1548
1572
.tuning_fast_imm_vector_shift ,
1549
1573
.uintr ,
1550
1574
.vaes ,
@@ -1783,6 +1807,8 @@ pub const cpu = struct {
1783
1807
.sahf ,
1784
1808
.sbb_dep_breaking ,
1785
1809
.slow_shld ,
1810
+ .smap ,
1811
+ .smep ,
1786
1812
.sse4a ,
1787
1813
.vzeroupper ,
1788
1814
.x87 ,
@@ -1995,6 +2021,8 @@ pub const cpu = struct {
1995
2021
.rdseed ,
1996
2022
.sahf ,
1997
2023
.slow_3ops_lea ,
2024
+ .smap ,
2025
+ .smep ,
1998
2026
.vzeroupper ,
1999
2027
.x87 ,
2000
2028
.xsaveopt ,
@@ -2136,6 +2164,8 @@ pub const cpu = struct {
2136
2164
.sahf ,
2137
2165
.sha ,
2138
2166
.slow_3ops_lea ,
2167
+ .smap ,
2168
+ .smep ,
2139
2169
.tuning_fast_imm_vector_shift ,
2140
2170
.vzeroupper ,
2141
2171
.x87 ,
@@ -2195,6 +2225,8 @@ pub const cpu = struct {
2195
2225
.rdseed ,
2196
2226
.sahf ,
2197
2227
.slow_3ops_lea ,
2228
+ .smap ,
2229
+ .smep ,
2198
2230
.tuning_fast_imm_vector_shift ,
2199
2231
.vzeroupper ,
2200
2232
.x87 ,
@@ -2450,6 +2482,8 @@ pub const cpu = struct {
2450
2482
.serialize ,
2451
2483
.sha ,
2452
2484
.shstk ,
2485
+ .smap ,
2486
+ .smep ,
2453
2487
.tsxldtrk ,
2454
2488
.tuning_fast_imm_vector_shift ,
2455
2489
.uintr ,
@@ -2519,6 +2553,8 @@ pub const cpu = struct {
2519
2553
.slow_incdec ,
2520
2554
.slow_lea ,
2521
2555
.slow_two_mem_ops ,
2556
+ .smap ,
2557
+ .smep ,
2522
2558
.sse4_2 ,
2523
2559
.use_glm_div_sqrt_costs ,
2524
2560
.vzeroupper ,
@@ -2898,6 +2934,7 @@ pub const cpu = struct {
2898
2934
.rdrnd ,
2899
2935
.sahf ,
2900
2936
.slow_3ops_lea ,
2937
+ .smep ,
2901
2938
.vzeroupper ,
2902
2939
.x87 ,
2903
2940
.xsaveopt ,
@@ -2907,6 +2944,7 @@ pub const cpu = struct {
2907
2944
.name = "i386" ,
2908
2945
.llvm_name = "i386" ,
2909
2946
.features = featureSet (&[_ ]Feature {
2947
+ .bsf_bsr_0_clobbers_result ,
2910
2948
.slow_unaligned_mem_16 ,
2911
2949
.vzeroupper ,
2912
2950
.x87 ,
@@ -2916,6 +2954,7 @@ pub const cpu = struct {
2916
2954
.name = "i486" ,
2917
2955
.llvm_name = "i486" ,
2918
2956
.features = featureSet (&[_ ]Feature {
2957
+ .bsf_bsr_0_clobbers_result ,
2919
2958
.slow_unaligned_mem_16 ,
2920
2959
.vzeroupper ,
2921
2960
.x87 ,
@@ -3096,6 +3135,7 @@ pub const cpu = struct {
3096
3135
.sahf ,
3097
3136
.slow_3ops_lea ,
3098
3137
.slow_unaligned_mem_32 ,
3138
+ .smep ,
3099
3139
.vzeroupper ,
3100
3140
.x87 ,
3101
3141
.xsaveopt ,
@@ -3403,6 +3443,8 @@ pub const cpu = struct {
3403
3443
.sha ,
3404
3444
.shstk ,
3405
3445
.slow_3ops_lea ,
3446
+ .smap ,
3447
+ .smep ,
3406
3448
.tuning_fast_imm_vector_shift ,
3407
3449
.vaes ,
3408
3450
.vpclmulqdq ,
@@ -3766,6 +3808,8 @@ pub const cpu = struct {
3766
3808
.sha ,
3767
3809
.shstk ,
3768
3810
.slow_3ops_lea ,
3811
+ .smap ,
3812
+ .smep ,
3769
3813
.tuning_fast_imm_vector_shift ,
3770
3814
.vaes ,
3771
3815
.vpclmulqdq ,
@@ -3831,6 +3875,8 @@ pub const cpu = struct {
3831
3875
.rdseed ,
3832
3876
.sahf ,
3833
3877
.sha ,
3878
+ .smap ,
3879
+ .smep ,
3834
3880
.tuning_fast_imm_vector_shift ,
3835
3881
.vaes ,
3836
3882
.vpclmulqdq ,
@@ -3939,6 +3985,8 @@ pub const cpu = struct {
3939
3985
.serialize ,
3940
3986
.sha ,
3941
3987
.shstk ,
3988
+ .smap ,
3989
+ .smep ,
3942
3990
.tsxldtrk ,
3943
3991
.tuning_fast_imm_vector_shift ,
3944
3992
.uintr ,
@@ -4042,6 +4090,7 @@ pub const cpu = struct {
4042
4090
.slow_lea ,
4043
4091
.slow_pmulld ,
4044
4092
.slow_two_mem_ops ,
4093
+ .smep ,
4045
4094
.sse4_2 ,
4046
4095
.use_slm_arith_costs ,
4047
4096
.vzeroupper ,
@@ -4098,6 +4147,8 @@ pub const cpu = struct {
4098
4147
.rdseed ,
4099
4148
.sahf ,
4100
4149
.slow_3ops_lea ,
4150
+ .smap ,
4151
+ .smep ,
4101
4152
.tuning_fast_imm_vector_shift ,
4102
4153
.vzeroupper ,
4103
4154
.x87 ,
@@ -4150,6 +4201,8 @@ pub const cpu = struct {
4150
4201
.rdseed ,
4151
4202
.sahf ,
4152
4203
.slow_3ops_lea ,
4204
+ .smap ,
4205
+ .smep ,
4153
4206
.vzeroupper ,
4154
4207
.x87 ,
4155
4208
.xsavec ,
@@ -4305,6 +4358,8 @@ pub const cpu = struct {
4305
4358
.sahf ,
4306
4359
.sha ,
4307
4360
.shstk ,
4361
+ .smap ,
4362
+ .smep ,
4308
4363
.tuning_fast_imm_vector_shift ,
4309
4364
.vaes ,
4310
4365
.vpclmulqdq ,
@@ -4574,6 +4629,8 @@ pub const cpu = struct {
4574
4629
.sbb_dep_breaking ,
4575
4630
.sha ,
4576
4631
.slow_shld ,
4632
+ .smap ,
4633
+ .smep ,
4577
4634
.sse4a ,
4578
4635
.vzeroupper ,
4579
4636
.x87 ,
@@ -4629,6 +4686,8 @@ pub const cpu = struct {
4629
4686
.sbb_dep_breaking ,
4630
4687
.sha ,
4631
4688
.slow_shld ,
4689
+ .smap ,
4690
+ .smep ,
4632
4691
.sse4a ,
4633
4692
.vzeroupper ,
4634
4693
.wbnoinvd ,
@@ -4686,6 +4745,8 @@ pub const cpu = struct {
4686
4745
.sbb_dep_breaking ,
4687
4746
.sha ,
4688
4747
.slow_shld ,
4748
+ .smap ,
4749
+ .smep ,
4689
4750
.sse4a ,
4690
4751
.vaes ,
4691
4752
.vpclmulqdq ,
@@ -4757,6 +4818,8 @@ pub const cpu = struct {
4757
4818
.sha ,
4758
4819
.shstk ,
4759
4820
.slow_shld ,
4821
+ .smap ,
4822
+ .smep ,
4760
4823
.sse4a ,
4761
4824
.vaes ,
4762
4825
.vpclmulqdq ,
@@ -4833,6 +4896,8 @@ pub const cpu = struct {
4833
4896
.sha ,
4834
4897
.shstk ,
4835
4898
.slow_shld ,
4899
+ .smap ,
4900
+ .smep ,
4836
4901
.sse4a ,
4837
4902
.vaes ,
4838
4903
.vpclmulqdq ,
0 commit comments