summaryrefslogtreecommitdiff
path: root/yjit/src/asm/arm64/arg/mod.rs
AgeCommit message (Collapse)Author
2022-09-09Better offsets (#6315)Kevin Newton
* Introduce InstructionOffset for AArch64 There are a lot of instructions on AArch64 where we take an offset from PC in terms of the number of instructions. This is for loading a value relative to the PC or for jumping. We were usually accepting an A64Opnd or an i32. It can get confusing and inconsistent though because sometimes you would divide by 4 to get the number of instructions or multiply by 4 to get the number of bytes. This commit adds a struct that wraps an i32 in order to keep all of that logic in one place. It makes it much easier to read and reason about how these offsets are getting used. * Use b instruction when the offset fits on AArch64 Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-08-29Fixed width immediates (https://github.com/Shopify/ruby/pull/437)Kevin Newton
There are a lot of times when encoding AArch64 instructions that we need to represent an integer value with a custom fixed width. For example, the offset for a B instruction is 26 bits, so we store an i32 on the instruction struct and then mask it when we encode. We've been doing this masking everywhere, which has worked, but it's getting a bit copy-pasty all over the place. This commit centralizes that logic to make sure we stay consistent. Notes: Merged: https://github.com/ruby/ruby/pull/6289
2022-08-29Fixes for AArch64 (https://github.com/Shopify/ruby/pull/338)Kevin Newton
* Better splitting for Op::Add, Op::Sub, and Op::Cmp * Split stores if the displacement is too large * Use a shifted immediate argument * Split all places where shifted immediates are used * Add more tests to the cirrus workflow
2022-08-29Encode MRS and MSR for AArch64 (https://github.com/Shopify/ruby/pull/315)Kevin Newton
2022-08-29LSL, LSR, B.cond (https://github.com/Shopify/ruby/pull/303)Kevin Newton
* LSL and LSR * B.cond * Move A64 files around to make more sense * offset -> byte_offset for bcond