|
9 | 9 | target_arch = "powerpc", |
10 | 10 | target_arch = "powerpc64", |
11 | 11 | target_arch = "s390x", |
| 12 | + target_arch = "riscv32", |
| 13 | + target_arch = "riscv64", |
| 14 | + target_arch = "loongarch64" |
12 | 15 | ), |
13 | 16 | feature(stdarch_internal) |
14 | 17 | )] |
|
28 | 31 | target_arch = "powerpc", |
29 | 32 | target_arch = "powerpc64", |
30 | 33 | target_arch = "s390x", |
| 34 | + target_arch = "riscv32", |
| 35 | + target_arch = "riscv64", |
| 36 | + target_arch = "loongarch64" |
31 | 37 | ))] |
32 | 38 | #[macro_use] |
33 | 39 | extern crate std_detect; |
34 | 40 |
|
35 | 41 | #[test] |
36 | | -#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))] |
37 | | -fn arm_linux() { |
| 42 | +#[cfg(target_arch = "arm")] |
| 43 | +fn arm() { |
38 | 44 | let _ = is_arm_feature_detected!("neon"); |
39 | 45 | let _ = is_arm_feature_detected!("neon",); |
40 | 46 | } |
41 | 47 |
|
42 | 48 | #[test] |
43 | | -#[cfg(all( |
44 | | - target_arch = "aarch64", |
45 | | - any(target_os = "linux", target_os = "android") |
46 | | -))] |
47 | | -fn aarch64_linux() { |
| 49 | +#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))] |
| 50 | +fn aarch64() { |
48 | 51 | let _ = is_aarch64_feature_detected!("fp"); |
49 | 52 | let _ = is_aarch64_feature_detected!("fp",); |
50 | 53 | } |
51 | 54 |
|
52 | 55 | #[test] |
53 | | -#[cfg(all(target_arch = "powerpc", target_os = "linux"))] |
54 | | -fn powerpc_linux() { |
| 56 | +#[cfg(target_arch = "loongarch64")] |
| 57 | +fn loongarch64() { |
| 58 | + let _ = is_loongarch_feature_detected!("lsx"); |
| 59 | + let _ = is_loongarch_feature_detected!("lsx",); |
| 60 | +} |
| 61 | + |
| 62 | +#[test] |
| 63 | +#[cfg(target_arch = "powerpc")] |
| 64 | +fn powerpc() { |
55 | 65 | let _ = is_powerpc_feature_detected!("altivec"); |
56 | 66 | let _ = is_powerpc_feature_detected!("altivec",); |
57 | 67 | } |
58 | 68 |
|
59 | 69 | #[test] |
60 | | -#[cfg(all(target_arch = "powerpc64", target_os = "linux"))] |
61 | | -fn powerpc64_linux() { |
| 70 | +#[cfg(target_arch = "powerpc64")] |
| 71 | +fn powerpc64() { |
62 | 72 | let _ = is_powerpc64_feature_detected!("altivec"); |
63 | 73 | let _ = is_powerpc64_feature_detected!("altivec",); |
64 | 74 | } |
65 | 75 |
|
66 | 76 | #[test] |
67 | | -#[cfg(all(target_arch = "s390x", target_os = "linux"))] |
68 | | -fn s390x_linux() { |
| 77 | +#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] |
| 78 | +fn riscv() { |
| 79 | + let _ = is_riscv_feature_detected!("zk"); |
| 80 | + let _ = is_riscv_feature_detected!("zk",); |
| 81 | +} |
| 82 | + |
| 83 | +#[test] |
| 84 | +#[cfg(target_arch = "s390x")] |
| 85 | +fn s390x() { |
69 | 86 | let _ = is_s390x_feature_detected!("vector"); |
70 | 87 | let _ = is_s390x_feature_detected!("vector",); |
71 | 88 | } |
72 | 89 |
|
73 | 90 | #[test] |
74 | 91 | #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] |
75 | | -fn x86_all() { |
| 92 | +fn x86() { |
76 | 93 | let _ = is_x86_feature_detected!("sse"); |
77 | 94 | let _ = is_x86_feature_detected!("sse",); |
78 | 95 | } |
0 commit comments