From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id E97061502A1C; Tue, 9 Sep 2025 11:30:41 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E97061502A1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1757406642; bh=yfAxps6UKFLq+Bd/GmIgSVrWUtkJupmNhN8SPyMfuQs=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=WnQiCk69RNsMsfsTC5ojLO5eEqf2GVoYF5mnuEUyqXQYSypM2SiQCKXkfWdEjVuW+ v6R+5zizxALYkR/ae+xVjyXyqs4V3VXdVV+WJ7BrlWDT83I9AuEKrh1GiZ10WK46fE fMnW93qbZ5mhP7Jm5CdNYQuiOJX64OYrRvfhRMnE= Received: from send35.i.mail.ru (send35.i.mail.ru [89.221.237.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 955081502A15 for ; Tue, 9 Sep 2025 11:30:40 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 955081502A15 Received: by exim-smtp-c584fb9f-9krpf with esmtpa (envelope-from ) id 1uvtkN-00000000B4U-3D62; Tue, 09 Sep 2025 11:30:40 +0300 Content-Type: multipart/alternative; boundary="------------dSExJeEjuFxfWWEq40GqnHbJ" Message-ID: <509b1323-b0b4-4858-9f93-ca913cdd1055@tarantool.org> Date: Tue, 9 Sep 2025 11:30:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org References: <0183aa1f346bf87d8e626274323c87e2291e75bf.1753344905.git.skaplun@tarantool.org> <73234419-5e68-45cb-ac13-da2b103ee26e@tarantool.org> In-Reply-To: X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91D98D60FB68F24CC32C28E7390EFD40A1719870076EE6FB6182A05F538085040524634E998138B263DE06ABAFEAF6705112D69CDF2A3EB8FAE920CBC47FB86284D4D0ABEC86BDBF1 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7D77100FFB2844417EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AC83A81C8FD4AD23D82A6BABE6F325AC2E85FA5F3EDFCBAA7353EFBB553375661343631359B0F9D95DE99332E9A6A09650FCB7767940E37C06AD44E0A244603E389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A29E2F051442AF778941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D52CD31C43BF465FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C224958C1606C78F2434E76E601842F6C81A12EF20D2F80756B5FB606B96278B59C4276E601842F6C81A127C277FBC8AE2E8B6A4E49BB0F3BA1413AA81AA40904B5D99C9F4D5AE37F343AD1F44FA8B9022EA23BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735D028CC0B556B22BCC4224003CC83647689D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5A6FAC6FC562E1FBB5002B1117B3ED696894FE5D2DC44D8AEE99897350C7C491E823CB91A9FED034534781492E4B8EEADEEA082C9A12FE455BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADBF74143AD284FC7177DD89D51EBB7742424CF958EAFF5D571004E42C50DC4CA955A7F0CF078B5EC49A30900B95165D3494FB0335DF05DC3A25647EAD28515A5B39F2819D7FE27FA665939C7E3F2EDCF7CC2D83C8DB0038AE1D7E09C32AA3244C9851C03DFBFFF73A77DD89D51EBB77422929CD1B8E7ECB1FEA455F16B58544A2E30DDF7C44BCB90DA5AE236DF995FB59978A700BF655EAEEED6A17656DB59BCAD427812AF56FC65B X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu53w8ahmwBjZKM/YPHZyZHvz5uv+WouB9+ObcCpyrx6l7KImUglyhkEat/+ysWwi0gdhEs0JGjl6ggRWTy1haxBpVdbIX1nthFXMZebaIdHP2ghjoIc/363UZI6Kf1ptIMVdVMtzNxwZu5O0uJ6FbJJjA= X-Mailru-Sender: 811C44EDE0507D1FE3AB2BB2D6096E357A548F6578231754965EDF11CFD47EC7A07A93074A1B440593AC9912533B2342645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 2/3] ARM64: More improvements to the generation of immediates. X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------dSExJeEjuFxfWWEq40GqnHbJ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Sergey! On 8/27/25 12:08, Sergey Kaplun wrote: > Hi, Sergey! > Thanks for the review! > Please consider my answers below. > > On 25.08.25, Sergey Bronnikov wrote: >> 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: >>> From: Mike Pall >>> >>> (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 > 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`. > > >>> offset to `RID_GL`. >> it is not clear for me what for hunks with `emit_dm` are needed. > | 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. Thanks for explanation! I thought you will add it to the commit message. >> --------------dSExJeEjuFxfWWEq40GqnHbJ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi, Sergey!

On 8/27/25 12:08, Sergey Kaplun wrote:
Hi, Sergey!
Thanks for the review!
Please consider my answers below.

On 25.08.25, Sergey Bronnikov wrote:
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:
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
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`.


   offset to `RID_GL`.
it is not clear for me what for hunks with `emit_dm` are needed.
| 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.
Thanks for explanation! I thought you will add it to the commit message.

      
<snipped>

    
--------------dSExJeEjuFxfWWEq40GqnHbJ--