Skip to content

Commit 1879995

Browse files
committed
Update test runner to support big endian
1 parent 11a00dd commit 1879995

File tree

5 files changed

+150
-68
lines changed

5 files changed

+150
-68
lines changed

crates/intrinsic-test/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ version = "0.1.0"
44
authors = ["Jamie Cunliffe <[email protected]>",
55
"James McGregor <[email protected]",
66
"Adam Gemmell <[email protected]",
7-
"Jacob Bramley <[email protected]>"]
7+
"Jacob Bramley <[email protected]>",
8+
"James Barford-Evans <[email protected]>"
9+
]
810
license = "MIT OR Apache-2.0"
911
edition = "2024"
1012

crates/intrinsic-test/src/argument.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ impl ArgumentList {
209209
/// Creates a line for each argument that initializes the argument from an array `[arg]_vals` at
210210
/// an offset `i` using a load intrinsic, in C.
211211
/// e.g `uint8x8_t a = vld1_u8(&a_vals[i]);`
212-
pub fn load_values_c(&self, indentation: Indentation, p64_armv7_workaround: bool) -> String {
212+
pub fn load_values_c(&self, indentation: Indentation, target: &str) -> String {
213213
self.iter()
214214
.filter_map(|arg| {
215215
// The ACLE doesn't support 64-bit polynomial loads on Armv7
216216
// This and the cast are a workaround for this
217217
let armv7_p64 = if let TypeKind::Poly = arg.ty.kind() {
218-
p64_armv7_workaround
218+
target.contains("v7")
219219
} else {
220220
false
221221
};
@@ -226,7 +226,7 @@ impl ArgumentList {
226226
ty = arg.to_c_type(),
227227
name = arg.name,
228228
load = if arg.is_simd() {
229-
arg.ty.get_load_function(p64_armv7_workaround)
229+
arg.ty.get_load_function(target)
230230
} else {
231231
"*".to_string()
232232
},
@@ -258,7 +258,7 @@ impl ArgumentList {
258258
name = arg.name,
259259
vals_name = arg.rust_vals_array_name(),
260260
load = if arg.is_simd() {
261-
arg.ty.get_load_function(false)
261+
arg.ty.get_load_function("__")
262262
} else {
263263
"*".to_string()
264264
},

crates/intrinsic-test/src/intrinsic.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Intrinsic {
9191
indentation: Indentation,
9292
additional: &str,
9393
passes: u32,
94-
p64_armv7_workaround: bool,
94+
target: &str,
9595
) -> String {
9696
let body_indentation = indentation.nested();
9797
format!(
@@ -100,9 +100,7 @@ impl Intrinsic {
100100
{body_indentation}auto __return_value = {intrinsic_call}({args});\n\
101101
{print_result}\n\
102102
{indentation}}}",
103-
loaded_args = self
104-
.arguments
105-
.load_values_c(body_indentation, p64_armv7_workaround),
103+
loaded_args = self.arguments.load_values_c(body_indentation, target),
106104
intrinsic_call = self.name,
107105
args = self.arguments.as_call_param_c(),
108106
print_result = self.print_result_c(body_indentation, additional)

0 commit comments

Comments
 (0)