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 9442C5C3F09; Tue, 15 Aug 2023 12:41:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 9442C5C3F09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1692092483; bh=pd+byuWEUpulh2uZ89LP3kD93lhXNhxp4ndKUQAZ28E=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=MH1KrvOT3DQ090PVm4f/jfjUUkb4TZzoYj1ckaXE0WM3Htn0lsjE9yXa5LTIyTqKg puTZijCPxstiDx06+gwBmgJQzw2C4t9kGbUzBMpEfsQSMejQEp1c3Lwisil+0Pr1Y9 0AwiqNXYWQ48APurKdWt9znDHALwdUE7IUysmJS8= Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [95.163.41.71]) (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 1BDF05AA586 for ; Tue, 15 Aug 2023 12:41:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1BDF05AA586 Received: by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1qVqYC-009Mi1-0l; Tue, 15 Aug 2023 12:41:20 +0300 To: Maxim Kokryashkin , Sergey Bronnikov Date: Tue, 15 Aug 2023 12:36:26 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailru-Src: smtp X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC8E1D56388F8ECDB9EA9DEC181E9DCB203182A05F5380850402FBB0E71E0A5BF9D4166EEAF0FD3205EF1343EA025670D81FAA6E0101E48C176 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75037DDE13FB75316EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AD4B8DECD34330378638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8D10DD48375FFBB97E3A541BF6167AAA7117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCD6672DD12D5A8206A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751FF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947CD166953D3EA3826B03F1AB874ED890284AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C399CBCF38BF184368BA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CF3D321E7403792E342EB15956EA79C166176DF2183F8FC7C0D2D576BCF940C736725E5C173C3A84C3DB8B71E42BA00C4F35872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A52E84302B5BE82BFECEFB152585E389CC8351C2138419A1DFF87CCE6106E1FC07E67D4AC08A07B9B05E3BF8C76DC23F749C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF5E212FE845FA435CADD6AC6F02154049D63694E36DA5424264ED44E883379729A53151558601347D90ABE3E74E35EA6FEC7274C35E67A03BD3E7AA3D878B3A46A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXgeWgVDS4uf/MN5a9yHKbmI X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A76926EBACEC1EE391244166EEAF0FD3205EFE5F7FEA15315F16DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 0/5] Fix pow inconsistencies and improve asserts 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 Kaplun via Tarantool-patches Reply-To: Sergey Kaplun Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This patchset fix `^` operator insconsistencies. Since the last 2 commits are based on the patch "Improve assertions." (*) it is backported as well (it's about time). (*) Be aware that assertions in aren't replaced in the upstream too. The following functions/modules contains our own code with assertions, so we can discuss some better namings for them: * `lj_fullhash()` in * `lua_hashstring()` in * * * * * * P.S. Unfortunately, I can't find any reproducer for dropping optimization of 2 ^ i => ldexp(1.0, i). Please, guide me, if you may found any. Branch: https://github.com/tarantool/luajit/tree/skaplun/lj-9-pow-inconsistencies PR: https://github.com/tarantool/tarantool/pull/8985 Related issues: * https://github.com/tarantool/tarantool/issues/8825 * https://github.com/LuaJIT/LuaJIT/issues/9 * https://github.com/LuaJIT/LuaJIT/issues/684 * https://github.com/LuaJIT/LuaJIT/issues/817 Mike Pall (4): Remove pow() splitting and cleanup backends. Improve assertions. Fix pow() optimization inconsistencies. Revert to trival pow() optimizations to prevent inaccuracies. Sergey Kaplun (1): test: introduce `samevalues()` TAP checker src/CMakeLists.txt | 1 + src/Makefile.dep.original | 13 +- src/Makefile.original | 4 +- src/lib_io.c | 6 +- src/lib_jit.c | 4 +- src/lib_misc.c | 12 +- src/lib_string.c | 6 +- src/lj_api.c | 140 ++++++----- src/lj_arch.h | 3 - src/lj_asm.c | 230 +++++++++++------- src/lj_asm_arm.h | 129 +++++----- src/lj_asm_arm64.h | 134 +++++----- src/lj_asm_mips.h | 189 +++++++------- src/lj_asm_ppc.h | 122 ++++++---- src/lj_asm_x86.h | 211 +++++++--------- src/lj_assert.c | 28 +++ src/lj_bcread.c | 20 +- src/lj_bcwrite.c | 24 +- src/lj_buf.c | 4 +- src/lj_carith.c | 10 +- src/lj_ccall.c | 19 +- src/lj_ccallback.c | 42 ++-- src/lj_cconv.c | 57 +++-- src/lj_cconv.h | 5 +- src/lj_cdata.c | 27 +- src/lj_cdata.h | 7 +- src/lj_clib.c | 6 +- src/lj_cparse.c | 25 +- src/lj_crecord.c | 19 +- src/lj_ctype.c | 13 +- src/lj_ctype.h | 14 +- src/lj_debug.c | 18 +- src/lj_def.h | 26 +- src/lj_dispatch.c | 11 +- src/lj_emit_arm.h | 50 ++-- src/lj_emit_arm64.h | 21 +- src/lj_emit_mips.h | 22 +- src/lj_emit_ppc.h | 12 +- src/lj_emit_x86.h | 22 +- src/lj_err.c | 40 +-- src/lj_ffrecord.c | 4 +- src/lj_func.c | 18 +- src/lj_gc.c | 78 +++--- src/lj_gc.h | 6 +- src/lj_gdbjit.c | 5 +- src/lj_ir.c | 31 +-- src/lj_ir.h | 7 +- src/lj_ircall.h | 2 - src/lj_iropt.h | 1 - src/lj_jit.h | 6 + src/lj_lex.c | 14 +- src/lj_lex.h | 6 + src/lj_load.c | 2 +- src/lj_mapi.c | 2 +- src/lj_mcode.c | 2 +- src/lj_memprof.c | 35 +-- src/lj_meta.c | 6 +- src/lj_obj.h | 35 ++- src/lj_opt_fold.c | 144 +++++------ src/lj_opt_loop.c | 5 +- src/lj_opt_mem.c | 15 +- src/lj_opt_narrow.c | 55 +---- src/lj_opt_split.c | 45 +--- src/lj_parse.c | 114 +++++---- src/lj_record.c | 164 ++++++++----- src/lj_snap.c | 100 +++++--- src/lj_snap.h | 3 +- src/lj_state.c | 18 +- src/lj_str.c | 7 +- src/lj_strfmt.c | 4 +- src/lj_strfmt.h | 3 +- src/lj_strfmt_num.c | 6 +- src/lj_strscan.c | 9 +- src/lj_symtab.c | 11 +- src/lj_sysprof.c | 31 +-- src/lj_tab.c | 20 +- src/lj_target.h | 3 +- src/lj_trace.c | 57 +++-- src/lj_utils_leb128.c | 5 +- src/lj_vm.h | 9 - src/lj_vmmath.c | 51 +--- src/lj_wbuf.c | 3 +- src/ljamalg.c | 1 + src/luaconf.h | 2 +- src/vm_x64.dasc | 35 --- src/vm_x86.dasc | 35 --- test/tarantool-tests/gh-6163-min-max.test.lua | 52 ++-- .../lj-684-pow-inconsistencies.test.lua | 106 ++++++++ .../lj-9-pow-inconsistencies.test.lua | 65 +++++ test/tarantool-tests/tap.lua | 14 ++ 90 files changed, 1729 insertions(+), 1469 deletions(-) create mode 100644 src/lj_assert.c create mode 100644 test/tarantool-tests/lj-684-pow-inconsistencies.test.lua create mode 100644 test/tarantool-tests/lj-9-pow-inconsistencies.test.lua -- 2.41.0