Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergos via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org,
	Igor Munkin <imun@tarantool.org>,
	Sergey Kaplun <skaplun@tarantool.org>
Subject: [Tarantool-patches] Fwd: [PATCH luajit v2] Don't compile math.modf() anymore.
Date: Wed, 30 Nov 2022 16:24:06 +0300	[thread overview]
Message-ID: <1D95B177-6239-4771-9ED9-E784C3166EF5@tarantool.org> (raw)
In-Reply-To: <9DD05C29-8449-4975-8F76-672EEBC3D80B@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 3104 bytes --]



> Begin forwarded message:
> 
> From: sergos <sergos@tarantool.org>
> Subject: Re: [Tarantool-patches] [PATCH luajit v2] Don't compile math.modf() anymore.
> Date: 30 November 2022, 16:23:31 GMT+3
> To: Maxim Kokryashkin <m.kokryashkin@tarantool.org>
> 
> Hi!
> 
> The change looks like “I don’t know why it might not work, lets drop it”.
> But since it just leads to a FUNCC and trace can be stiched thereafter
> it LGTM.
> 
> Sergos
> 
>> От кого: Maxim Kokryashkin via Tarantool-patches <tarantool-patches@dev.tarantool.org>
>> Кому: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org
>> Дата: Пятница, 19 августа 2022, 0:21 +03:00
>> Тема: [Tarantool-patches] [PATCH luajit v2] Don't compile math.modf() anymore.
>>  
>> From: Mike Pall <mike>
>> 
>> This commit disables compilation for the `math.modf` function since it's
>> rarely used and compiling it in a performant enough way would be
>> difficult.
>> 
>> Part of tarantool/tarantool#7230
>> ---
>> 
>> There are no issues with correctenss of compilation
>> of math.modf whatsoever. There are no known issues with it, and all of
>> the possible edge cases are handled well both with active
>> and inactivve JIT. It's safe to assume that the `properly compiling`
>> in the original commit message refers to performance rather than
>> correctness.
>> 
>> PR: https://github.com/tarantool/tarantool/pull/7586
>> Branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-7230-math-modf
>> 
>>  src/lib_math.c | 2 +-
>>  src/lj_ffrecord.c | 16 ----------------
>>  2 files changed, 1 insertion(+), 17 deletions(-)
>> 
>> diff --git a/src/lib_math.c b/src/lib_math.c
>> index ef9dda2d..4e6d2458 100644
>> --- a/src/lib_math.c
>> +++ b/src/lib_math.c
>> @@ -45,7 +45,7 @@ LJLIB_ASM_(math_sinh) LJLIB_REC(math_htrig IRCALL_sinh)
>>  LJLIB_ASM_(math_cosh) LJLIB_REC(math_htrig IRCALL_cosh)
>>  LJLIB_ASM_(math_tanh) LJLIB_REC(math_htrig IRCALL_tanh)
>>  LJLIB_ASM_(math_frexp)
>> -LJLIB_ASM_(math_modf) LJLIB_REC(.)
>> +LJLIB_ASM_(math_modf)
>> 
>>  LJLIB_ASM(math_log) LJLIB_REC(math_log)
>>  {
>> diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c
>> index be890a93..ac9c9ba1 100644
>> --- a/src/lj_ffrecord.c
>> +++ b/src/lj_ffrecord.c
>> @@ -601,22 +601,6 @@ static void LJ_FASTCALL recff_math_htrig(jit_State *J, RecordFFData *rd)
>>    J->base[0] = emitir(IRTN(IR_CALLN), tr, rd->data);
>>  }
>> 
>> -static void LJ_FASTCALL recff_math_modf(jit_State *J, RecordFFData *rd)
>> -{
>> - TRef tr = J->base[0];
>> - if (tref_isinteger(tr)) {
>> - J->base[0] = tr;
>> - J->base[1] = lj_ir_kint(J, 0);
>> - } else {
>> - TRef trt;
>> - tr = lj_ir_tonum(J, tr);
>> - trt = emitir(IRTN(IR_FPMATH), tr, IRFPM_TRUNC);
>> - J->base[0] = trt;
>> - J->base[1] = emitir(IRTN(IR_SUB), tr, trt);
>> - }
>> - rd->nres = 2;
>> -}
>> -
>>  static void LJ_FASTCALL recff_math_pow(jit_State *J, RecordFFData *rd)
>>  {
>>    J->base[0] = lj_opt_narrow_pow(J, J->base[0], J->base[1],
>> --
>> 2.36.1
>>  
> 


[-- Attachment #2: Type: text/html, Size: 5458 bytes --]

           reply	other threads:[~2022-11-30 13:24 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9DD05C29-8449-4975-8F76-672EEBC3D80B@tarantool.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1D95B177-6239-4771-9ED9-E784C3166EF5@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imun@tarantool.org \
    --cc=sergos@tarantool.org \
    --cc=skaplun@tarantool.org \
    --subject='Re: [Tarantool-patches] Fwd: [PATCH luajit v2] Don'\''t compile math.modf() anymore.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox