File tree 2 files changed +28
-0
lines changed
crates/std_detect/src/detect
2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,13 @@ features! {
11
11
/// * `"f"`
12
12
/// * `"d"`
13
13
/// * `"frecipe"`
14
+ /// * `"div32"`
14
15
/// * `"lsx"`
15
16
/// * `"lasx"`
17
+ /// * `"lam-bh"`
18
+ /// * `"lamcas"`
19
+ /// * `"ld-seq-sa"`
20
+ /// * `"scq"`
16
21
/// * `"lbt"`
17
22
/// * `"lvz"`
18
23
/// * `"ual"`
@@ -23,10 +28,20 @@ features! {
23
28
/// D
24
29
@FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] frecipe: "frecipe" ;
25
30
/// Frecipe
31
+ @FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] div32: "div32" ;
32
+ /// Div32
26
33
@FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lsx: "lsx" ;
27
34
/// LSX
28
35
@FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lasx: "lasx" ;
29
36
/// LASX
37
+ @FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lam_bh: "lam-bh" ;
38
+ /// LAM-BH
39
+ @FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lamcas: "lamcas" ;
40
+ /// LAM-CAS
41
+ @FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] ld_seq_sa: "ld-seq-sa" ;
42
+ /// LD-SEQ-SA
43
+ @FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] scq: "scq" ;
44
+ /// SCQ
30
45
@FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lbt: "lbt" ;
31
46
/// LBT
32
47
@FEATURE : #[ unstable( feature = "stdarch_loongarch_feature_detection" , issue = "117425" ) ] lvz: "lvz" ;
Original file line number Diff line number Diff line change @@ -24,7 +24,20 @@ pub(crate) fn detect_features() -> cache::Initializer {
24
24
options( pure, nomem, preserves_flags, nostack)
25
25
) ;
26
26
}
27
+ let cpucfg3: usize ;
28
+ unsafe {
29
+ asm ! (
30
+ "cpucfg {}, {}" ,
31
+ out( reg) cpucfg3, in( reg) 3 ,
32
+ options( pure, nomem, preserves_flags, nostack)
33
+ ) ;
34
+ }
27
35
enable_feature ( & mut value, Feature :: frecipe, bit:: test ( cpucfg2, 25 ) ) ;
36
+ enable_feature ( & mut value, Feature :: div32, bit:: test ( cpucfg2, 26 ) ) ;
37
+ enable_feature ( & mut value, Feature :: lam_bh, bit:: test ( cpucfg2, 27 ) ) ;
38
+ enable_feature ( & mut value, Feature :: lamcas, bit:: test ( cpucfg2, 28 ) ) ;
39
+ enable_feature ( & mut value, Feature :: scq, bit:: test ( cpucfg2, 30 ) ) ;
40
+ enable_feature ( & mut value, Feature :: ld_seq_sa, bit:: test ( cpucfg3, 23 ) ) ;
28
41
29
42
// The values are part of the platform-specific [asm/hwcap.h][hwcap]
30
43
//
You can’t perform that action at this time.
0 commit comments