Skip to content

Commit 3efdc37

Browse files
committed
More fixes
1 parent 1ba1b0d commit 3efdc37

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

crates/intrinsic-test/missing_arm.txt

+3
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,6 @@ vrshrn_n_s64
245245
vrshrn_n_u16
246246
vrshrn_n_u32
247247
vrshrn_n_u64
248+
249+
vshrq_n_u64
250+
vshr_n_u64

crates/intrinsic-test/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ path = "{intrinsic}/main.rs""#,
267267
"aarch64-unknown-linux-gnu"
268268
},
269269
))
270+
.env("RUSTFLAGS", "-Cdebuginfo=0")
270271
.output();
271272
if let Ok(output) = output {
272273
if output.status.success() {
@@ -406,7 +407,7 @@ fn compare_outputs(intrinsics: &Vec<Intrinsic>, toolchain: &str, runner: &str, a
406407
.current_dir("rust_programs")
407408
.arg("-c")
408409
.arg(format!(
409-
"cargo {toolchain} run --release --target {target} --bin {intrinsic}",
410+
"cargo {toolchain} run --target {target} --bin {intrinsic}",
410411
intrinsic = intrinsic.name,
411412
toolchain = toolchain,
412413
target = if a32 {
@@ -415,6 +416,7 @@ fn compare_outputs(intrinsics: &Vec<Intrinsic>, toolchain: &str, runner: &str, a
415416
"aarch64-unknown-linux-gnu"
416417
},
417418
))
419+
.env("RUSTFLAGS", "-Cdebuginfo=0")
418420
.output();
419421

420422
let (c, rust) = match (c, rust) {

crates/intrinsic-test/src/types.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ impl IntrinsicType {
258258
/// This is required for 8 bit types due to printing as the 8 bit types use
259259
/// a char and when using that in `std::cout` it will print as a character,
260260
/// which means value of 0 will be printed as a null byte.
261+
///
262+
/// This is also needed for polynomial types because we want them to be
263+
/// printed as unsigned integers to match Rust's `Debug` impl.
261264
pub fn c_promotion(&self) -> &str {
262265
match *self {
263266
IntrinsicType::Type {
@@ -267,9 +270,21 @@ impl IntrinsicType {
267270
} if bit_len == 8 => match kind {
268271
TypeKind::Int => "(int)",
269272
TypeKind::UInt => "(unsigned int)",
270-
TypeKind::Poly => "(unsigned int)",
273+
TypeKind::Poly => "(unsigned int)(uint8_t)",
271274
_ => "",
272275
},
276+
IntrinsicType::Type {
277+
kind: TypeKind::Poly,
278+
bit_len: Some(bit_len),
279+
..
280+
} => match bit_len {
281+
8 => unreachable!("handled above"),
282+
16 => "(uint16_t)",
283+
32 => "(uint32_t)",
284+
64 => "(uint64_t)",
285+
128 => "(__uint128_t)",
286+
_ => panic!("invalid bit_len"),
287+
},
273288
_ => "",
274289
}
275290
}

0 commit comments

Comments
 (0)