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 B770A6FC82; Fri, 12 Nov 2021 01:58:28 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B770A6FC82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1636671508; bh=7MKoXlP3twt303bEwX38B9bdv9ne9orNGNr6fY/+YX8=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=dMTVFYoc7DgAHLo1kYwC04lPbWhnHGQLcL0fJjuck9i1DhpHIxtVxyDxa1lrskHJK wFdbFUlLebGwbP+F+7nZspsyoa4ElpsWGt9wO0ybVkgYuVq4g9Q3MVn/gxFy1Phgdf 0tc2RFxkdivZMguaRnvHTUwSkSdpDWoOUYW9EojE= Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (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 99E716FC82 for ; Fri, 12 Nov 2021 01:58:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 99E716FC82 Received: by mail-lj1-f172.google.com with SMTP id e11so14810775ljo.13 for ; Thu, 11 Nov 2021 14:58:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K9Dh/JYc78jxpZ75HH5o+Q9KCyfx6uEvcN0DmIzpvZo=; b=auY++uT8p2PRN95l/fohp7HwjqOK07TueA+F22LUwHYdQAhVZs46UV7PQo5VgE91zM So3Tj75YzwYcnclNw4jepH0JRnbn4H1O9afmjbxoxGsCS5DsWDeApYgToO/EIySo9RPC YleW5Lcoog9A2P6cxZIJpcG0jEjx/rpk5b4cRxZRMZOOo5wuf7FAmU8O4bKWPb4QNrUC Iw6Grj8eozp0+oWk3XJfAFF3m+YKXpNGEbllrveaaZFEW3ckY7ijqKEATuUNuKAyQC8a 3HrjLk/s0u/D5vLbYjKcam1tryHAGb41R6KnP7IbX92iLxISvH6Hpas8u+yapIOiANE8 JGng== X-Gm-Message-State: AOAM533y9GrEZ+fMBFvRzUBjLniAuEUI1JBNUXMEZYyi6PPCspsE5b+y FSbg9bsB3gmfXzepX1yrcdMG8UAN+FTaVXdg X-Google-Smtp-Source: ABdhPJxtu5bE8fvqydGTTRN/ER293MlbFj5oaCY0evwW7XWpn9hsvtvWqpdcNqFX9J299voYAgq8Hg== X-Received: by 2002:a2e:824a:: with SMTP id j10mr10409034ljh.256.1636671506736; Thu, 11 Nov 2021 14:58:26 -0800 (PST) Received: from localhost.localdomain ([93.175.11.199]) by smtp.gmail.com with ESMTPSA id g10sm398734lfv.113.2021.11.11.14.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 14:58:26 -0800 (PST) X-Google-Original-From: Maxim Kokryashkin To: tarantool-patches@dev.tarantool.org, imun@tarantool.org, skaplun@tarantool.org Date: Fri, 12 Nov 2021 01:58:20 +0300 Message-Id: X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit v3 0/3] fix math.min/max inconsistencies 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" math.min()/math.max() could produce different results when compiled. Previously, these functions did not check for the number of arguments, which in some situations led to incorrect behavior. Changes in v2: - Squashed the commit containing the test with the commit containing the fix - Added more informative description for the most of the changes GitHub branch: https://github.com/tarantool/luajit/tree/fckxorg/gh-6163-min-max CI: https://github.com/tarantool/tarantool/tree/fckxorg/gh-6163-min-max Issue: https://github.com/tarantool/tarantool/issues/6163 Links to vanilla commits: - Fix math.min()/math.max() inconsistencies: https://github.com/LuaJIT/LuaJIT/commit/03208c8162af9cc01ca76ee1676ca79e5abe9b60 - Don't compile math.modf() anymore. https://github.com/LuaJIT/LuaJIT/commit/d75e26275bdcfe95283b761ef9405841ef2d406f - Cleanup math function compilation and fix inconsistencies. https://github.com/LuaJIT/LuaJIT/commit/5655be4546d9177890c69f0d0accac4773ff0887 Still need some comments regarding the last one, more on that in the part 3. Mike Pall (3): Fix math.min()/math.max() inconsistencies. Don't compile math.modf() anymore. Cleanup math function compilation and fix inconsistencies. src/lib_math.c | 24 +++--- src/lj_asm.c | 6 -- src/lj_asm_arm.h | 7 +- src/lj_asm_arm64.h | 7 +- src/lj_asm_x86.h | 2 - src/lj_ffrecord.c | 35 +-------- src/lj_ir.h | 4 +- src/lj_ircall.h | 14 ++-- src/lj_opt_fold.c | 78 ++++++++++--------- src/lj_opt_split.c | 3 - src/lj_target_x86.h | 6 -- src/lj_vmmath.c | 10 +-- src/vm_arm.dasc | 4 +- src/vm_arm64.dasc | 4 +- src/vm_x64.dasc | 2 +- src/vm_x86.dasc | 2 +- .../gh-6163-jit-min-max.test.lua | 17 ++++ 17 files changed, 98 insertions(+), 127 deletions(-) create mode 100644 test/tarantool-tests/gh-6163-jit-min-max.test.lua -- 2.33.0