<!DOCTYPE html>
<html data-lt-installed="true">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body style="padding-bottom: 1px;">
    <p>Hi, Sergey!<br>
    </p>
    <div class="moz-cite-prefix">On 8/27/25 12:08, Sergey Kaplun wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:aK7LC0B61ECR2zdp@root">
      <pre wrap="" class="moz-quote-pre">Hi, Sergey!
Thanks for the review!
Please consider my answers below.

On 25.08.25, Sergey Bronnikov wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">Hi, Sergey!

thanks for the patch!

In general LGTM, I would suggest fixing the description in commit message.

See below.

Sergey

On 7/24/25 12:03, Sergey Kaplun wrote:
</pre>
        <blockquote type="cite">
          <pre wrap="" class="moz-quote-pre">From: Mike Pall <mike>

(cherry picked from commit 69138082a3166105faa8cbb25fadb1e4298686c0)

This patch refactors the emitting of immediates for the arm64
architecture. The main changes are the following:
* Use `emit_getgl()`, `emit_setgl()` instead of `emit_lso()`, where it
   is possible, since it makes the code cleaner.
* The `RID_GL` is allocated for `g` at the start of the trace emitting.
   Also, this register is considered as a candidate to be used as a base
   for the N-step offset in `emit_kdelta()`.
* The address of `tmptv` is not rematerialized to the register from the
   constant not. It is calculated via the adding the corresponding
</pre>
        </blockquote>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
This "not" looks excessive. Rewritten as the following:
| * The address of `tmptv` is not rematerialized to the register from the
|   constant. It is calculated via the adding the corresponding offset to
|   `RID_GL`.


</pre>
      <blockquote type="cite">
        <blockquote type="cite">
          <pre wrap="" class="moz-quote-pre">   offset to `RID_GL`.
</pre>
        </blockquote>
        <pre wrap="" class="moz-quote-pre">it is not clear for me what for hunks with `emit_dm` are needed.
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
| emit_dm(as, ins, d, m);
Means emit the ins with values to the D and M instruction fields as
registers `d`, `m` respectively.

In the case of this patch, it emits simply:
| mov rd, rm
Where `rd` is the register associated with `ASM_REF_TMP1` (`REF_TRUE`)
and `rm` is `RID_GL`. So this is simply moving the value of `g` from the
`RID_GL` register to the register, which will be an argument for the C
function call like `lj_gc_step_jit()`. Move is used instead of the
constant value loading.
</pre>
    </blockquote>
    Thanks for explanation! I thought you will add it to the commit
    message.<br>
    <blockquote type="cite" cite="mid:aK7LC0B61ECR2zdp@root">
      <pre wrap="" class="moz-quote-pre">
</pre>
      <blockquote type="cite">
        <pre wrap="" class="moz-quote-pre">
<snipped>
</pre>
      </blockquote>
      <pre wrap="" class="moz-quote-pre">
</pre>
    </blockquote>
  </body>
  <lt-container></lt-container>
</html>