From 2243b62a83170121c8270f0242ec64bb01b73c64 Mon Sep 17 00:00:00 2001 From: iximeow Date: Tue, 28 Dec 2021 20:11:30 -0800 Subject: simd modified immediate expansion --- src/armv8/a64.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs index 6810cb2..d1672c4 100644 --- a/src/armv8/a64.rs +++ b/src/armv8/a64.rs @@ -3388,8 +3388,19 @@ impl Decoder for InstDecoder { let imm = if opc == Opcode::FMOV { // simd expand - // TODO - todo!(); + let a = (abc >> 2) as u64; + let b = ((abc >> 1) & 1) as u64; + let c = (abc & 1) as u64; + let defgh = defgh as u64; + + // the expansion is the same (with more exponent bits) for the + // various widths + let value = (a << 63) | + (((b * 0b111_111_111) ^ 0b100_000_000) << 54) | + (defgh << 48); + let value = f64::from_bits(value); + + Operand::ImmediateDouble(value) } else if opc == Opcode::ORR || opc == Opcode::BIC { // abcdefgh let abcdefgh = (abc << 5) | defgh; -- cgit v1.1