Skip to content

Commit 571eab0

Browse files
chore: adding comments about memory alignment of variables and bash scripts that will be used in CI
1 parent 6fbdf07 commit 571eab0

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

ci/run.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,11 @@ case "${TARGET}" in
186186
;;
187187

188188
x86_64-unknown-linux-gnu*)
189+
# `CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER` is not necessary for `intrinsic-test`
190+
# because the binary needs to run directly on the host.
191+
# Since the same cannot be assigned an empty string, `"eval"` is used instead.
189192
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \
190-
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="true" \
193+
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="eval" \
191194
cargo run "${INTRINSIC_TEST}" "${PROFILE}" \
192195
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \
193196
--runner "${TEST_RUNNER}" \

crates/intrinsic-test/src/arm/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
3636
"cstring",
3737
"iomanip",
3838
"sstream",
39-
"cstddef",
40-
"cstdint",
4139
"arm_neon.h",
4240
"arm_acle.h",
4341
"arm_fp16.h",

crates/intrinsic-test/src/common/argument.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ where
106106
loads: u32,
107107
) -> std::io::Result<()> {
108108
for arg in self.iter().filter(|&arg| !arg.has_constraint()) {
109+
// Setting the variables on an aligned boundary to make it easier to pick
110+
// functions (of a specific architecture) that would help load the values.
109111
writeln!(
110112
w,
111113
"{indentation}alignas(64) const {ty} {name}_vals[] = {values};",

crates/intrinsic-test/src/common/gen_rust.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn generate_rust_test_loop<T: IntrinsicTypeDefinition>(
190190
w: &mut impl std::io::Write,
191191
intrinsic: &Intrinsic<T>,
192192
indentation: Indentation,
193-
specializations: &[Vec<i64>],
193+
specializations: &[Vec<i32>],
194194
passes: u32,
195195
) -> std::io::Result<()> {
196196
let intrinsic_name = &intrinsic.name;
@@ -255,15 +255,15 @@ pub fn generate_rust_test_loop<T: IntrinsicTypeDefinition>(
255255
/// Generate the specializations (unique sequences of const-generic arguments) for this intrinsic.
256256
fn generate_rust_specializations<'a>(
257257
constraints: &mut impl Iterator<Item = impl Iterator<Item = i64>>,
258-
) -> Vec<Vec<i64>> {
258+
) -> Vec<Vec<i32>> {
259259
let mut specializations = vec![vec![]];
260260

261261
for constraint in constraints {
262262
specializations = constraint
263263
.flat_map(|right| {
264264
specializations.iter().map(move |left| {
265265
let mut left = left.clone();
266-
left.push(i64::try_from(right).unwrap());
266+
left.push(i32::try_from(right).unwrap());
267267
left
268268
})
269269
})

crates/intrinsic-test/src/common/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::fs::File;
2-
use std::io::{self, Write};
32

43
use rayon::prelude::*;
54

@@ -77,14 +76,6 @@ pub trait SupportedArchitectureTest {
7776
if let Some(cpp_compiler) = cpp_compiler_wrapped.as_ref() {
7877
let output = cpp_compiler
7978
.compile_object_file(&format!("mod_{i}.cpp"), &format!("mod_{i}.o"))?;
80-
if !output.status.success() {
81-
io::stdout()
82-
.write_all(&output.stdout)
83-
.expect("Failed to write to stdout!");
84-
io::stderr()
85-
.write_all(&output.stderr)
86-
.expect("Failed to write to stderr!");
87-
}
8879
assert!(output.status.success(), "{output:?}");
8980
}
9081

0 commit comments

Comments
 (0)