aboutsummaryrefslogtreecommitdiff
path: root/src/armv8
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-12-28 20:11:30 -0800
committeriximeow <me@iximeow.net>2021-12-28 20:11:30 -0800
commit2243b62a83170121c8270f0242ec64bb01b73c64 (patch)
treeb8ba71237f50122c1bd346019bdffb5d80d71280 /src/armv8
parent9f08e998ed1f0180883e589279ed3081c565f79d (diff)
simd modified immediate expansion
Diffstat (limited to 'src/armv8')
-rw-r--r--src/armv8/a64.rs15
1 files 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<ARMv8> 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;