|
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 | )]
|
15 | 18 | #![cfg_attr(target_arch = "arm", feature(stdarch_arm_feature_detection))]
|
16 |
| -#![cfg_attr(target_arch = "aarch64", feature(stdarch_aarch64_feature_detection))] |
17 |
| -#![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))] |
18 |
| -#![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))] |
| 19 | +#![cfg_attr( |
| 20 | + any(target_arch = "aarch64", target_arch = "arm64ec"), |
| 21 | + feature(stdarch_aarch64_feature_detection) |
| 22 | +)] |
| 23 | +#![cfg_attr( |
| 24 | + any(target_arch = "powerpc", target_arch = "powerpc64"), |
| 25 | + feature(stdarch_powerpc_feature_detection) |
| 26 | +)] |
19 | 27 | #![cfg_attr(target_arch = "s390x", feature(stdarch_s390x_feature_detection))]
|
20 |
| -#![allow(clippy::unwrap_used, clippy::use_debug, clippy::print_stdout)] |
| 28 | +#![cfg_attr( |
| 29 | + any(target_arch = "riscv32", target_arch = "riscv64"), |
| 30 | + feature(stdarch_riscv_feature_detection) |
| 31 | +)] |
| 32 | +#![cfg_attr( |
| 33 | + target_arch = "loongarch64", |
| 34 | + feature(stdarch_loongarch_feature_detection) |
| 35 | +)] |
21 | 36 |
|
22 | 37 | #[cfg(any(
|
23 | 38 | target_arch = "arm",
|
|
28 | 43 | target_arch = "powerpc",
|
29 | 44 | target_arch = "powerpc64",
|
30 | 45 | target_arch = "s390x",
|
| 46 | + target_arch = "riscv32", |
| 47 | + target_arch = "riscv64", |
| 48 | + target_arch = "loongarch64" |
31 | 49 | ))]
|
32 | 50 | #[macro_use]
|
33 | 51 | extern crate std_detect;
|
34 | 52 |
|
35 | 53 | #[test]
|
36 |
| -#[cfg(all(target_arch = "arm", any(target_os = "linux", target_os = "android")))] |
37 |
| -fn arm_linux() { |
| 54 | +#[cfg(target_arch = "arm")] |
| 55 | +fn arm() { |
38 | 56 | let _ = is_arm_feature_detected!("neon");
|
39 | 57 | let _ = is_arm_feature_detected!("neon",);
|
40 | 58 | }
|
41 | 59 |
|
42 | 60 | #[test]
|
43 |
| -#[cfg(all( |
44 |
| - target_arch = "aarch64", |
45 |
| - any(target_os = "linux", target_os = "android") |
46 |
| -))] |
47 |
| -fn aarch64_linux() { |
| 61 | +#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))] |
| 62 | +fn aarch64() { |
48 | 63 | let _ = is_aarch64_feature_detected!("fp");
|
49 | 64 | let _ = is_aarch64_feature_detected!("fp",);
|
50 | 65 | }
|
51 | 66 |
|
52 | 67 | #[test]
|
53 |
| -#[cfg(all(target_arch = "powerpc", target_os = "linux"))] |
54 |
| -fn powerpc_linux() { |
| 68 | +#[cfg(target_arch = "loongarch64")] |
| 69 | +fn loongarch64() { |
| 70 | + let _ = is_loongarch_feature_detected!("lsx"); |
| 71 | + let _ = is_loongarch_feature_detected!("lsx",); |
| 72 | +} |
| 73 | + |
| 74 | +#[test] |
| 75 | +#[cfg(target_arch = "powerpc")] |
| 76 | +fn powerpc() { |
55 | 77 | let _ = is_powerpc_feature_detected!("altivec");
|
56 | 78 | let _ = is_powerpc_feature_detected!("altivec",);
|
57 | 79 | }
|
58 | 80 |
|
59 | 81 | #[test]
|
60 |
| -#[cfg(all(target_arch = "powerpc64", target_os = "linux"))] |
61 |
| -fn powerpc64_linux() { |
| 82 | +#[cfg(target_arch = "powerpc64")] |
| 83 | +fn powerpc64() { |
62 | 84 | let _ = is_powerpc64_feature_detected!("altivec");
|
63 | 85 | let _ = is_powerpc64_feature_detected!("altivec",);
|
64 | 86 | }
|
65 | 87 |
|
66 | 88 | #[test]
|
67 |
| -#[cfg(all(target_arch = "s390x", target_os = "linux"))] |
68 |
| -fn s390x_linux() { |
| 89 | +#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))] |
| 90 | +fn riscv() { |
| 91 | + let _ = is_riscv_feature_detected!("zk"); |
| 92 | + let _ = is_riscv_feature_detected!("zk",); |
| 93 | +} |
| 94 | + |
| 95 | +#[test] |
| 96 | +#[cfg(target_arch = "s390x")] |
| 97 | +fn s390x() { |
69 | 98 | let _ = is_s390x_feature_detected!("vector");
|
70 | 99 | let _ = is_s390x_feature_detected!("vector",);
|
71 | 100 | }
|
72 | 101 |
|
73 | 102 | #[test]
|
74 | 103 | #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
|
75 |
| -fn x86_all() { |
| 104 | +fn x86() { |
76 | 105 | let _ = is_x86_feature_detected!("sse");
|
77 | 106 | let _ = is_x86_feature_detected!("sse",);
|
78 | 107 | }
|
0 commit comments