|
5 | 5 | any(target_arch = "aarch64", target_arch = "arm64ec"),
|
6 | 6 | feature(stdarch_aarch64_feature_detection)
|
7 | 7 | )]
|
| 8 | +#![cfg_attr( |
| 9 | + any(target_arch = "riscv32", target_arch = "riscv64"), |
| 10 | + feature(stdarch_riscv_feature_detection) |
| 11 | +)] |
8 | 12 | #![cfg_attr(target_arch = "powerpc", feature(stdarch_powerpc_feature_detection))]
|
9 | 13 | #![cfg_attr(target_arch = "powerpc64", feature(stdarch_powerpc_feature_detection))]
|
10 | 14 | #![cfg_attr(target_arch = "s390x", feature(stdarch_s390x_feature_detection))]
|
|
15 | 19 | target_arch = "arm",
|
16 | 20 | target_arch = "aarch64",
|
17 | 21 | target_arch = "arm64ec",
|
| 22 | + target_arch = "riscv32", |
| 23 | + target_arch = "riscv64", |
18 | 24 | target_arch = "powerpc",
|
19 | 25 | target_arch = "powerpc64",
|
20 | 26 | target_arch = "s390x",
|
@@ -220,6 +226,65 @@ fn aarch64_darwin() {
|
220 | 226 | println!("sha3: {:?}", is_aarch64_feature_detected!("sha3"));
|
221 | 227 | }
|
222 | 228 |
|
| 229 | +#[test] |
| 230 | +#[cfg(all( |
| 231 | + any(target_arch = "riscv32", target_arch = "riscv64"), |
| 232 | + any(target_os = "linux", target_os = "android") |
| 233 | +))] |
| 234 | +fn riscv_linux() { |
| 235 | + println!("rv32i: {}", is_riscv_feature_detected!("rv32i")); |
| 236 | + println!("rv32e: {}", is_riscv_feature_detected!("rv32e")); |
| 237 | + println!("rv64i: {}", is_riscv_feature_detected!("rv64i")); |
| 238 | + println!("rv128i: {}", is_riscv_feature_detected!("rv128i")); |
| 239 | + println!("zicsr: {}", is_riscv_feature_detected!("zicsr")); |
| 240 | + println!("zicntr: {}", is_riscv_feature_detected!("zicntr")); |
| 241 | + println!("zihpm: {}", is_riscv_feature_detected!("zihpm")); |
| 242 | + println!("zifencei: {}", is_riscv_feature_detected!("zifencei")); |
| 243 | + println!("zihintpause: {}", is_riscv_feature_detected!("zihintpause")); |
| 244 | + println!("m: {}", is_riscv_feature_detected!("m")); |
| 245 | + println!("a: {}", is_riscv_feature_detected!("a")); |
| 246 | + println!("zalrsc: {}", is_riscv_feature_detected!("zalrsc")); |
| 247 | + println!("zaamo: {}", is_riscv_feature_detected!("zaamo")); |
| 248 | + println!("zam: {}", is_riscv_feature_detected!("zam")); |
| 249 | + println!("ztso: {}", is_riscv_feature_detected!("ztso")); |
| 250 | + println!("f: {}", is_riscv_feature_detected!("f")); |
| 251 | + println!("d: {}", is_riscv_feature_detected!("d")); |
| 252 | + println!("q: {}", is_riscv_feature_detected!("q")); |
| 253 | + println!("zfh: {}", is_riscv_feature_detected!("zfh")); |
| 254 | + println!("zfhmin: {}", is_riscv_feature_detected!("zfhmin")); |
| 255 | + println!("zfinx: {}", is_riscv_feature_detected!("zfinx")); |
| 256 | + println!("zdinx: {}", is_riscv_feature_detected!("zdinx")); |
| 257 | + println!("zhinx: {}", is_riscv_feature_detected!("zhinx")); |
| 258 | + println!("zhinxmin: {}", is_riscv_feature_detected!("zhinxmin")); |
| 259 | + println!("c: {}", is_riscv_feature_detected!("c")); |
| 260 | + println!("b: {}", is_riscv_feature_detected!("b")); |
| 261 | + println!("zba: {}", is_riscv_feature_detected!("zba")); |
| 262 | + println!("zbb: {}", is_riscv_feature_detected!("zbb")); |
| 263 | + println!("zbc: {}", is_riscv_feature_detected!("zbc")); |
| 264 | + println!("zbs: {}", is_riscv_feature_detected!("zbs")); |
| 265 | + println!("zbkb: {}", is_riscv_feature_detected!("zbkb")); |
| 266 | + println!("zbkc: {}", is_riscv_feature_detected!("zbkc")); |
| 267 | + println!("zbkx: {}", is_riscv_feature_detected!("zbkx")); |
| 268 | + println!("zknd: {}", is_riscv_feature_detected!("zknd")); |
| 269 | + println!("zkne: {}", is_riscv_feature_detected!("zkne")); |
| 270 | + println!("zknh: {}", is_riscv_feature_detected!("zknh")); |
| 271 | + println!("zksed: {}", is_riscv_feature_detected!("zksed")); |
| 272 | + println!("zksh: {}", is_riscv_feature_detected!("zksh")); |
| 273 | + println!("zkr: {}", is_riscv_feature_detected!("zkr")); |
| 274 | + println!("zkn: {}", is_riscv_feature_detected!("zkn")); |
| 275 | + println!("zks: {}", is_riscv_feature_detected!("zks")); |
| 276 | + println!("zk: {}", is_riscv_feature_detected!("zk")); |
| 277 | + println!("zkt: {}", is_riscv_feature_detected!("zkt")); |
| 278 | + println!("v: {}", is_riscv_feature_detected!("v")); |
| 279 | + println!("svnapot: {}", is_riscv_feature_detected!("svnapot")); |
| 280 | + println!("svpbmt: {}", is_riscv_feature_detected!("svpbmt")); |
| 281 | + println!("svinval: {}", is_riscv_feature_detected!("svinval")); |
| 282 | + println!("h: {}", is_riscv_feature_detected!("h")); |
| 283 | + println!("s: {}", is_riscv_feature_detected!("s")); |
| 284 | + println!("j: {}", is_riscv_feature_detected!("j")); |
| 285 | + println!("p: {}", is_riscv_feature_detected!("p")); |
| 286 | +} |
| 287 | + |
223 | 288 | #[test]
|
224 | 289 | #[cfg(all(target_arch = "powerpc", target_os = "linux"))]
|
225 | 290 | fn powerpc_linux() {
|
|
0 commit comments