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 842B77034F; Fri, 19 Aug 2022 00:20:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 842B77034F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1660857658; bh=gPDE6eGPwo4Fh09LIlWSXnCA4YCW3kyjgZQOYWQMeuU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iv53cTqDxLqWgaDjMBe2zRhlkphYomMCv1MgsmbTg5LTLNqTRa9RD+Whcv18icDj3 rZB4JWaNNw3GkqyNEC3azvmTKzcqteRRnVWKqxNVyxNg9ByE0BXpzqA9gVF2Hl6kBQ NOZI4kHhDEoNC85EA9OcGeawoixhHyUs6/9/X7o4= Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 688157034F for ; Fri, 19 Aug 2022 00:20:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 688157034F Received: by mail-lf1-f49.google.com with SMTP id z25so3743271lfr.2 for ; Thu, 18 Aug 2022 14:20:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=bdP3HTBeNPfLLNfj820N6Ms3lh76Dv04taoSvU5F5dQ=; b=do23arG9Xq5fdp4/FaeOojpWDclJkagbrBx4sQ4WyAZ3kd77hcuQM8bSyNnLPZey0g aqJMFD5+SIIWxGqKS+nsPFGCh/1gT67aXFGNoGADw2c8dzW/FoDvftnt7sPuIgIxY56z 9VfGW/6hv+KPXsl9WIctBcO3MNoEP0Hg7EMza+G78f93pkwHpA1nsZkbJvRTF9VNgUVu l1Rsllhifp5AXG8W3J/Rh/eJGkufh56p4qUU5hzePwr4yGJ1DSzO4H8n4qLXyhXHUuK0 s4we3opGO0LboJe5gsPWahuI2IvB8OZQ11HvagHCi9UthZkqFJy8QTs9HeBw3rC+G+Ur SEKQ== X-Gm-Message-State: ACgBeo2cFSToEVQMbks47jKwQc0dUGFbQEZNP/okvt1Ivtek4wPjIZOI BAefmPwuJsTFUsX4gqa3Njp9WriPXaoKLQ== X-Google-Smtp-Source: AA6agR6NaTx4hQiypBe21mmhD9wJajQy+rtO+m6llUHXVE9H7LUB6Ez87cLDReY6fk/vR34w22K42A== X-Received: by 2002:ac2:4db6:0:b0:48a:f9b6:bac1 with SMTP id h22-20020ac24db6000000b0048af9b6bac1mr1402299lfe.669.1660857653305; Thu, 18 Aug 2022 14:20:53 -0700 (PDT) Received: from localhost.localdomain ([2a00:1370:8176:ec5:ddb1:9c2f:1828:96ec]) by smtp.gmail.com with ESMTPSA id i6-20020a2ea366000000b0025e57b40009sm360860ljn.89.2022.08.18.14.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 14:20:52 -0700 (PDT) X-Google-Original-From: Maxim Kokryashkin To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Date: Fri, 19 Aug 2022 00:20:45 +0300 Message-Id: <20220818212049.70677-1-m.kokryashkin@tarantool.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v2] Don't compile math.modf() anymore. 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: Maxim Kokryashkin via Tarantool-patches Reply-To: Maxim Kokryashkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Mike Pall 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