Skip to content

Commit 09be05e

Browse files
feat: updated exclusion list with more intrinsics, that can be fixed
immediately
1 parent 06ab6d7 commit 09be05e

File tree

7 files changed

+121
-10
lines changed

7 files changed

+121
-10
lines changed

library/stdarch/Cargo.lock

Lines changed: 70 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,18 @@ dependencies = [
282282
"wasi",
283283
]
284284

285+
[[package]]
286+
name = "getrandom"
287+
version = "0.3.4"
288+
source = "registry+https://github.com/rust-lang/crates.io-index"
289+
checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"
290+
dependencies = [
291+
"cfg-if",
292+
"libc",
293+
"r-efi",
294+
"wasip2",
295+
]
296+
285297
[[package]]
286298
name = "hashbrown"
287299
version = "0.12.3"
@@ -348,6 +360,7 @@ dependencies = [
348360
"log",
349361
"pretty_env_logger",
350362
"quick-xml 0.37.5",
363+
"rand 0.9.2",
351364
"rayon",
352365
"regex",
353366
"serde",
@@ -473,7 +486,7 @@ checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
473486
dependencies = [
474487
"env_logger 0.8.4",
475488
"log",
476-
"rand",
489+
"rand 0.8.5",
477490
]
478491

479492
[[package]]
@@ -485,15 +498,31 @@ dependencies = [
485498
"proc-macro2",
486499
]
487500

501+
[[package]]
502+
name = "r-efi"
503+
version = "5.3.0"
504+
source = "registry+https://github.com/rust-lang/crates.io-index"
505+
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
506+
488507
[[package]]
489508
name = "rand"
490509
version = "0.8.5"
491510
source = "registry+https://github.com/rust-lang/crates.io-index"
492511
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
493512
dependencies = [
494513
"libc",
495-
"rand_chacha",
496-
"rand_core",
514+
"rand_chacha 0.3.1",
515+
"rand_core 0.6.4",
516+
]
517+
518+
[[package]]
519+
name = "rand"
520+
version = "0.9.2"
521+
source = "registry+https://github.com/rust-lang/crates.io-index"
522+
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
523+
dependencies = [
524+
"rand_chacha 0.9.0",
525+
"rand_core 0.9.3",
497526
]
498527

499528
[[package]]
@@ -503,7 +532,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
503532
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
504533
dependencies = [
505534
"ppv-lite86",
506-
"rand_core",
535+
"rand_core 0.6.4",
536+
]
537+
538+
[[package]]
539+
name = "rand_chacha"
540+
version = "0.9.0"
541+
source = "registry+https://github.com/rust-lang/crates.io-index"
542+
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
543+
dependencies = [
544+
"ppv-lite86",
545+
"rand_core 0.9.3",
507546
]
508547

509548
[[package]]
@@ -512,7 +551,16 @@ version = "0.6.4"
512551
source = "registry+https://github.com/rust-lang/crates.io-index"
513552
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
514553
dependencies = [
515-
"getrandom",
554+
"getrandom 0.2.16",
555+
]
556+
557+
[[package]]
558+
name = "rand_core"
559+
version = "0.9.3"
560+
source = "registry+https://github.com/rust-lang/crates.io-index"
561+
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
562+
dependencies = [
563+
"getrandom 0.3.4",
516564
]
517565

518566
[[package]]
@@ -703,7 +751,7 @@ dependencies = [
703751
name = "stdarch-gen-loongarch"
704752
version = "0.1.0"
705753
dependencies = [
706-
"rand",
754+
"rand 0.8.5",
707755
]
708756

709757
[[package]]
@@ -736,7 +784,7 @@ version = "0.0.0"
736784
dependencies = [
737785
"core_arch",
738786
"quickcheck",
739-
"rand",
787+
"rand 0.8.5",
740788
]
741789

742790
[[package]]
@@ -819,6 +867,15 @@ version = "0.11.1+wasi-snapshot-preview1"
819867
source = "registry+https://github.com/rust-lang/crates.io-index"
820868
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
821869

870+
[[package]]
871+
name = "wasip2"
872+
version = "1.0.1+wasi-0.2.4"
873+
source = "registry+https://github.com/rust-lang/crates.io-index"
874+
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
875+
dependencies = [
876+
"wit-bindgen",
877+
]
878+
822879
[[package]]
823880
name = "wasmparser"
824881
version = "0.235.0"
@@ -1003,6 +1060,12 @@ version = "0.53.0"
10031060
source = "registry+https://github.com/rust-lang/crates.io-index"
10041061
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
10051062

1063+
[[package]]
1064+
name = "wit-bindgen"
1065+
version = "0.46.0"
1066+
source = "registry+https://github.com/rust-lang/crates.io-index"
1067+
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
1068+
10061069
[[package]]
10071070
name = "xml-rs"
10081071
version = "0.8.27"

library/stdarch/ci/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ case ${TARGET} in
9494
TEST_CXX_COMPILER="clang++"
9595
TEST_RUNNER="${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}"
9696
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_x86.txt
97+
TEST_SAMPLE_INTRINSICS_PERCENTAGE=5
9798
export STDARCH_DISABLE_ASSERT_INSTR=1
9899
PATH="$PATH":"$(pwd)"/c_programs
99100
export PATH

library/stdarch/crates/intrinsic-test/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ itertools = "0.14.0"
2222
quick-xml = { version = "0.37.5", features = ["serialize", "overlapped-lists"] }
2323
serde-xml-rs = "0.8.0"
2424
regex = "1.11.1"
25+
rand = "0.9.2"

library/stdarch/crates/intrinsic-test/missing_x86.txt

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,4 +871,34 @@ _m_pxor
871871
_m_to_int
872872
_m_to_int64
873873
_mm512_mask_floor_pd
874-
_mm512_mask_floor_ps
874+
_mm512_mask_floor_ps
875+
876+
# SDE ERROR: Cannot execute XGETBV with ECX != 0
877+
_xgetbv
878+
879+
# Miscellaneous issues that can be fixed first
880+
_kshiftli_mask16
881+
_kshiftli_mask32
882+
_kshiftli_mask64
883+
_kshiftli_mask8
884+
_kshiftri_mask16
885+
_kshiftri_mask32
886+
_kshiftri_mask64
887+
_kshiftri_mask8
888+
_mm256_castsi128_si256
889+
_mm256_extract_epi16
890+
_mm256_extract_epi8
891+
_mm512_castsi128_si512
892+
_mm512_castsi256_si512
893+
_mm512_conj_pch
894+
_mm512_mask_reduce_max_pd
895+
_mm512_mask_reduce_max_ps
896+
_mm512_mask_reduce_min_pd
897+
_mm512_mask_reduce_min_ps
898+
_mm_comineq_sh
899+
_mm_extract_epi16
900+
_mm_extract_epi8
901+
_mm_mask_cvtepi16_epi8
902+
_mm_mask_cvtpd_epi32
903+
_mm_mask_cvtpd_ps
904+
_mm_ucomineq_sh

library/stdarch/crates/intrinsic-test/src/common/cli.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ pub struct Cli {
5454
/// Set the sysroot for the C++ compiler
5555
#[arg(long)]
5656
pub cxx_toolchain_dir: Option<String>,
57+
58+
#[arg(long, default_value_t = 100u8)]
59+
pub sample_percentage: u8,
5760
}
5861

5962
pub struct ProcessedCli {
@@ -65,6 +68,7 @@ pub struct ProcessedCli {
6568
pub linker: Option<String>,
6669
pub cxx_toolchain_dir: Option<String>,
6770
pub skip: Vec<String>,
71+
pub sample_percentage: u8,
6872
}
6973

7074
impl ProcessedCli {
@@ -74,6 +78,7 @@ impl ProcessedCli {
7478
let target = cli_options.target;
7579
let linker = cli_options.linker;
7680
let cxx_toolchain_dir = cli_options.cxx_toolchain_dir;
81+
let sample_percentage = cli_options.sample_percentage;
7782

7883
let skip = if let Some(filename) = cli_options.skip {
7984
let data = std::fs::read_to_string(&filename).expect("Failed to open file");
@@ -108,6 +113,7 @@ impl ProcessedCli {
108113
cxx_toolchain_dir,
109114
skip,
110115
filename,
116+
sample_percentage,
111117
}
112118
}
113119
}

library/stdarch/crates/intrinsic-test/src/common/compare.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ pub fn compare_outputs(intrinsic_name_list: &Vec<String>, runner: &str, target:
1414
let intrinsics = intrinsic_name_list
1515
.par_iter()
1616
.filter_map(|intrinsic_name| {
17-
1817
let c = runner_command(runner)
1918
.arg("intrinsic-test-programs")
2019
.arg(intrinsic_name)

library/stdarch/crates/intrinsic-test/src/x86/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use crate::common::intrinsic::Intrinsic;
1212
use crate::common::intrinsic_helpers::TypeKind;
1313
use intrinsic::X86IntrinsicType;
1414
use itertools::Itertools;
15+
use rand::rng;
16+
use rand::seq::IndexedRandom;
1517
use xml_parser::get_xml_intrinsics;
1618

1719
pub struct X86ArchitectureTest {
@@ -47,7 +49,10 @@ impl SupportedArchitectureTest for X86ArchitectureTest {
4749
let intrinsics =
4850
get_xml_intrinsics(&cli_options.filename).expect("Error parsing input file");
4951

50-
let mut intrinsics = intrinsics
52+
let mut rng = rng();
53+
let sample_percentage: usize = cli_options.sample_percentage as usize;
54+
55+
let intrinsics = intrinsics
5156
.into_iter()
5257
// Not sure how we would compare intrinsic that returns void.
5358
.filter(|i| i.results.kind() != TypeKind::Void)
@@ -62,6 +67,12 @@ impl SupportedArchitectureTest for X86ArchitectureTest {
6267
.unique_by(|i| i.name.clone())
6368
.collect::<Vec<_>>();
6469

70+
let sample_size = (intrinsics.len() * sample_percentage) / 100;
71+
let mut intrinsics = intrinsics
72+
.choose_multiple(&mut rng, sample_size)
73+
.cloned()
74+
.collect::<Vec<_>>();
75+
6576
intrinsics.sort_by(|a, b| a.name.cmp(&b.name));
6677
Self {
6778
intrinsics: intrinsics,

0 commit comments

Comments
 (0)