ZJIT: Re-enable some A64 assembler tests

Tweak for Condition to build when `cfg!(target = "x86_64")`.
This commit is contained in:
Alan Wu 2025-07-24 15:48:40 -04:00
parent 7e2b6291b8
commit 271e52d553
2 changed files with 2 additions and 4 deletions

View file

@ -10,7 +10,6 @@ mod sys_reg;
mod truncate; mod truncate;
pub use bitmask_imm::BitmaskImmediate; pub use bitmask_imm::BitmaskImmediate;
#[cfg(target_arch = "aarch64")]
pub use condition::Condition; pub use condition::Condition;
pub use inst_offset::InstructionOffset; pub use inst_offset::InstructionOffset;
pub use sf::Sf; pub use sf::Sf;

View file

@ -217,6 +217,7 @@ pub const fn bcond_offset_fits_bits(offset: i64) -> bool {
/// B.cond - branch to target if condition is true /// B.cond - branch to target if condition is true
pub fn bcond(cb: &mut CodeBlock, cond: u8, offset: InstructionOffset) { pub fn bcond(cb: &mut CodeBlock, cond: u8, offset: InstructionOffset) {
_ = Condition;
assert!(bcond_offset_fits_bits(offset.into()), "The offset must be 19 bits or less."); assert!(bcond_offset_fits_bits(offset.into()), "The offset must be 19 bits or less.");
let bytes: [u8; 4] = BranchCond::bcond(cond, offset).into(); let bytes: [u8; 4] = BranchCond::bcond(cond, offset).into();
@ -1138,14 +1139,13 @@ fn cbz_cbnz(num_bits: u8, op: bool, offset: InstructionOffset, rt: u8) -> [u8; 4
rt as u32).to_le_bytes() rt as u32).to_le_bytes()
} }
/*
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
/// Check that the bytes for an instruction sequence match a hex string /// Check that the bytes for an instruction sequence match a hex string
fn check_bytes<R>(bytes: &str, run: R) where R: FnOnce(&mut super::CodeBlock) { fn check_bytes<R>(bytes: &str, run: R) where R: FnOnce(&mut super::CodeBlock) {
let mut cb = super::CodeBlock::new_dummy(128); let mut cb = super::CodeBlock::new_dummy();
run(&mut cb); run(&mut cb);
assert_eq!(format!("{:x}", cb), bytes); assert_eq!(format!("{:x}", cb), bytes);
} }
@ -1676,4 +1676,3 @@ mod tests {
check_bytes("1f3c0072", |cb| tst(cb, W0, A64Opnd::new_uimm(0xffff))); check_bytes("1f3c0072", |cb| tst(cb, W0, A64Opnd::new_uimm(0xffff)));
} }
} }
*/