Skip to content

Commit

Permalink
Fix #80: aarch64 mov w0, immu32 and friends should take a u32 as the …
Browse files Browse the repository at this point in the history
…immediate. This is a breaking change.
  • Loading branch information
CensoredUsername committed Sep 27, 2024
1 parent a7d1b22 commit 23cb1db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin/src/arch/aarch64/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,9 @@ fn handle_special_immediates(offset: u8, special: SpecialComm, imm: &syn::Expr,
} else {
dynamics.push((offset, quote_spanned!{ imm.span()=>
{
let value: u64 = !#imm;
let value: u32 = !#imm;
let offset = value.trailing_zeros() & 0b10000;
((0xFFFFu64 & (value >> offset)) as u32) | (offset << 12)
((0xFFFFu32 & (value >> offset)) as u32) | (offset << 12)
}
}));
return Ok(());
Expand Down Expand Up @@ -606,9 +606,9 @@ fn handle_special_immediates(offset: u8, special: SpecialComm, imm: &syn::Expr,
} else {
dynamics.push((offset, quote_spanned!{ imm.span()=>
{
let value: u64 = #imm;
let value: u32 = #imm;
let offset = value.trailing_zeros() & 0b10000;
((0xFFFFu64 & (value >> offset)) as u32) | (offset << 12)
((0xFFFFu32 & (value >> offset)) as u32) | (offset << 12)
}
}));
return Ok(());
Expand Down

0 comments on commit 23cb1db

Please sign in to comment.