<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/yjit/src/asm/arm64/arg/condition.rs, branch v3_2_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Better b.cond usage on AArch64 (#6305)</title>
<updated>2022-08-31T19:44:26+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2022-08-31T19:44:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=be55b77cc75fe36b484a3feb6ad4178630d73242'/>
<id>be55b77cc75fe36b484a3feb6ad4178630d73242</id>
<content type='text'>
* 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 &lt;jimmyhmiller@jimmys-mbp.lan&gt;

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;
Co-authored-by: Jimmy Miller &lt;jimmyhmiller@jimmys-mbp.lan&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 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 &lt;jimmyhmiller@jimmys-mbp.lan&gt;

Co-authored-by: Maxime Chevalier-Boisvert &lt;maximechevalierb@gmail.com&gt;
Co-authored-by: Jimmy Miller &lt;jimmyhmiller@jimmys-mbp.lan&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Better label refs (https://github.com/Shopify/ruby/pull/310)</title>
<updated>2022-08-29T15:46:59+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2022-07-11T21:51:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8864691bde2560ef440c4a8dac16b2c661faa228'/>
<id>8864691bde2560ef440c4a8dac16b2c661faa228</id>
<content type='text'>
Previously we were using a `Box&lt;dyn FnOnce&gt;` 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&lt;dyn FnOnce&gt;`, 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we were using a `Box&lt;dyn FnOnce&gt;` 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&lt;dyn FnOnce&gt;`, 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>LSL, LSR, B.cond (https://github.com/Shopify/ruby/pull/303)</title>
<updated>2022-08-29T15:46:58+00:00</updated>
<author>
<name>Kevin Newton</name>
<email>kddnewton@gmail.com</email>
</author>
<published>2022-06-22T16:27:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b272c57f27628ab114206c777d5b274713d31079'/>
<id>b272c57f27628ab114206c777d5b274713d31079</id>
<content type='text'>
* LSL and LSR

* B.cond

* Move A64 files around to make more sense

* offset -&gt; byte_offset for bcond
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* LSL and LSR

* B.cond

* Move A64 files around to make more sense

* offset -&gt; byte_offset for bcond
</pre>
</div>
</content>
</entry>
</feed>
