summaryrefslogtreecommitdiff
path: root/yjit/src/asm/arm64/inst/load_store.rs
diff options
context:
space:
mode:
Diffstat (limited to 'yjit/src/asm/arm64/inst/load_store.rs')
-rw-r--r--yjit/src/asm/arm64/inst/load_store.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/yjit/src/asm/arm64/inst/load_store.rs b/yjit/src/asm/arm64/inst/load_store.rs
index ea42f2d17f..e877c6de77 100644
--- a/yjit/src/asm/arm64/inst/load_store.rs
+++ b/yjit/src/asm/arm64/inst/load_store.rs
@@ -2,6 +2,7 @@ use super::super::arg::truncate_imm;
/// The size of the operands being operated on.
enum Size {
+ Size8 = 0b00,
Size32 = 0b10,
Size64 = 0b11,
}
@@ -81,6 +82,12 @@ impl LoadStore {
Self { rt, rn, idx: Index::None, imm9, opc: Opc::LDR, size: num_bits.into() }
}
+ /// LDURB (load register, byte, unscaled)
+ /// https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LDURB--Load-Register-Byte--unscaled--?lang=en
+ pub fn ldurb(rt: u8, rn: u8, imm9: i16) -> Self {
+ Self { rt, rn, idx: Index::None, imm9, opc: Opc::LDR, size: Size::Size8 }
+ }
+
/// LDURSW (load register, unscaled, signed)
/// https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LDURSW--Load-Register-Signed-Word--unscaled--?lang=en
pub fn ldursw(rt: u8, rn: u8, imm9: i16) -> Self {
@@ -158,6 +165,13 @@ mod tests {
}
#[test]
+ fn test_ldurb() {
+ let inst = LoadStore::ldurb(0, 1, 0);
+ let result: u32 = inst.into();
+ assert_eq!(0x38400020, result);
+ }
+
+ #[test]
fn test_ldur_with_imm() {
let inst = LoadStore::ldur(0, 1, 123, 64);
let result: u32 = inst.into();