aboutsummaryrefslogtreecommitdiffstats
path: root/yjit/src/asm/arm64/arg
Commit message (Collapse)AuthorAgeFilesLines
* YJIT: Fix `cargo doc --document-private-items` warnings [ci skip]Alan Wu2024-06-282-3/+3
| | | | Mostly putting angle brackets around links to follow markdown syntax.
* YJIT: Fix `clippy::useless_vec` in a testAlan Wu2023-11-101-1/+1
|
* Add a newline at EOF [ci skip]Nobuyoshi Nakada2023-05-241-1/+1
|
* Strip trailing spaces [ci skip]Nobuyoshi Nakada2023-01-122-3/+3
|
* More clippy fixes (#6547)Jimmy Miller2022-10-141-6/+12
|
* YJIT: fix ARM64 bitmask encoding for 32 bit registers (#6503)Alan Wu2022-10-061-6/+51
| | | | | | | | | | | | | | For logical instructions such as AND, there is a constraint that the N part of the bitmask immediate must be 0. We weren't respecting this condition previously and were silently emitting undefined instructions. Check for this condition in the assembler and tweak the backend to correctly detect whether a number could be encoded as an immediate in a 32 bit logical instruction. Due to the nature of the immediate encoding, the same numeric value encodes differently depending on the size of the register the instruction works on. We currently don't have cases where we use 32 bit immediates but we ran into this encoding issue during development.
* A bunch of clippy auto fixes for yjit (#6476)Jimmy Miller2022-09-302-5/+5
|
* Better offsets (#6315)Kevin Newton2022-09-092-0/+49
| | | | | | | | | | | | | | | | | | * 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
* Better b.cond usage on AArch64 (#6305)Kevin Newton2022-08-311-1/+31
| | | | | | | | | | | | | | | | | | | | | | * Better b.cond usage on AArch64 When we're lowering a conditional jump, we previously had a bit of a complicated setup where we could emit a conditional jump to skip over a jump that was the next instruction, and then write out the destination and use a branch register. Now instead we use the b.cond instruction if our offset fits (not common, but not unused either) and if it doesn't we write out an inverse condition to jump past loading the destination and branching directly. * Added an inverse fn for Condition (#443) Prevents the need to pass two params and potentially reduces errors. Co-authored-by: Jimmy Miller <jimmyhmiller@jimmys-mbp.lan> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Jimmy Miller <jimmyhmiller@jimmys-mbp.lan>
* Fixed width immediates (https://github.com/Shopify/ruby/pull/437)Kevin Newton2022-08-292-0/+68
| | | | | | | | | | | 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.
* Optimize bitmask immediates (https://github.com/Shopify/ruby/pull/403)Kevin Newton2022-08-291-77/+18
|
* Fixes (https://github.com/Shopify/ruby/pull/340)Kevin Newton2022-08-291-2/+8
| | | | | | * Fix conditional jumps to label * Bitmask immediates cannot be u64::MAX
* Fixes for AArch64 (https://github.com/Shopify/ruby/pull/338)Kevin Newton2022-08-292-0/+77
| | | | | | | | | | | | * 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
* Fixes (https://github.com/Shopify/ruby/pull/336)Kevin Newton2022-08-291-1/+8
| | | | | | * Fix bitmask encoding to u32 * Fix splitting for Op::And to account for bitmask immediate
* Better splitting for Op::Test on AArch64 ↵Kevin Newton2022-08-291-2/+8
| | | | (https://github.com/Shopify/ruby/pull/335)
* Encode MRS and MSR for AArch64 (https://github.com/Shopify/ruby/pull/315)Kevin Newton2022-08-292-0/+8
|
* Better label refs (https://github.com/Shopify/ruby/pull/310)Kevin Newton2022-08-291-16/+18
| | | | | | | | | | | | | | | | Previously we were using a `Box<dyn FnOnce>` to support patching the code when jumping to labels. We needed to do this because some of the closures that were being used to patch needed to capture local variables (on both X86 and ARM it was the type of condition for the conditional jumps). To get around that, we can instead use const generics since the condition codes are always known at compile-time. This means that the closures go from polymorphic to monomorphic, which means they can be represented as an `fn` instead of a `Box<dyn FnOnce>`, which means they can fall back to a plain function pointer. This simplifies the storage of the `LabelRef` structs and should hopefully be a better default going forward.
* LSL, LSR, B.cond (https://github.com/Shopify/ruby/pull/303)Kevin Newton2022-08-294-0/+299
* LSL and LSR * B.cond * Move A64 files around to make more sense * offset -> byte_offset for bcond