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 CA17757648C; Wed, 9 Aug 2023 18:40:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CA17757648C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1691595657; bh=ramVlWbtd2SCO6xevTv3fchdNT/nEXD+ccCkf3CqypU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=aIMaaZ5gAqPOlHcBn6LOKuRi3WVfGafFO6l3MWx27qSuS/iCVGw+veS4+Vmgrqcjc EPhDn49tIITGNI3VmuCJP7NBYvEjNNmmhxsGKwhQLQydi9zPztScUM3ZFBXeV/Nngr ZmOptBdcUs2/8pqvRffpE49CTGLHm9YRz7R1pDg0= Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [95.163.41.73]) (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 642B3576066 for ; Wed, 9 Aug 2023 18:40:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 642B3576066 Received: by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1qTlIt-003Nbf-1r; Wed, 09 Aug 2023 18:40:56 +0300 To: Igor Munkin , Sergey Bronnikov Date: Wed, 9 Aug 2023 18:35:49 +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: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD969E04B5EED670DC86EE92E42F0C271DDC310B0E58918727B182A05F5380850407D6696B9F2DB57B739BC923D1AD8FECECDF7939667A5AC6A8D4E79E850EFD82A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE792C68BF9CD4C0E9EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063764FE777F378F21448638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D832A34404A4CC9F07B2AEECD023BC9B85117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC20302DFC78685446A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735201E561CDFBCA1751F2CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE26055571C92BF10FE0F2381F647739FAD8FC6C240DEA76429C9F4D5AE37F343AA9539A8B242431040A6AB1C7CE11FEE32D01283D1ACF37BA6136E347CC761E07C4224003CC836476E2F48590F00D11D6E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637B8F435DEDE9E76EBEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: 0D63561A33F958A5872EE025B36F00192F6BEBBAB7CE8134704932623D02D7DDF87CCE6106E1FC07E67D4AC08A07B9B0A816C540FC8EEC309C5DF10A05D560A950611B66E3DA6D700B0A020F03D25A0997E3FB2386030E77 X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF77DD89D51EBB7742D3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CFF1D4F18033F02D6AD851FB909F0881A272007E677053236C7549CA12D35F1EF280A302719471681B1529AA6C8ABD04CA522C0AFAE5B5154528A57C5CCEB8BB11A74DFFEFA5DC0E7F02C26D483E81D6BE5EF9655DD6DEA7D65774BB76CC95456EEC5B5AD62611EEC62B5AFB4261A09AF0 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXjH2SRqYbL6xhuvWH503Z6/ X-Mailru-Sender: 11C2EC085EDE56FAC07928AF2646A769A577089CC5B4EBD639BC923D1AD8FECEFA95C477BC5130F8DEDBA653FF35249392D99EB8CC7091A70E183A470755BFD208F19895AA18418972D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: [Tarantool-patches] [PATCH luajit 00/19] Prerequisites for improve assertions 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 patch-set contains all commits are necessary to avoid conflicts during the backporting of 8ae5170c "Improve assertions" [1], that are caused by outdating from the upstream. This patch-set: - includes several new ports (see patches 4-6, 8, 19) -- only description is added for such patches. - fixes some MIPS misbehaviour (1, 3, 17) -- include tests (*), except the first one, since it depends on memory mapping. - fixes non-Linux/macOS build (7) - backportes patches, that was excluded or partially stripped before (10, 14, 15) - includes refactoring (2, 9, 18) - fixes general bugs (16) - fixes gcc 7.1 -Wimplicit-fallthrough warnings (11 - 13) Note: that only patches 3, 16, 17 adds some new tests. Other patches just provided description, and the patch 13 adds -Wimplicit-fallthrough for GCC (>= 7.1) builds. Patches are backported in the free order as far as they are unrelated to each other. (*) To run tests for mips64 in qemu: Compile with the following command: | make -j -f Makefile.original HOST_CC="gcc " \ | CROSS=mips64el-unknown-linux-gnu- \ | CCDEBUG=" -g -ggdb3" CFLAGS=" -O0" \ | XCFLAGS=" -DLUA_USE_APICHECK -DLUA_USE_ASSERT " Be avare, that mips64el-unknown-linux-gnu-gcc should provide n64 abi by default. Side note: installed on Gentoo with the following command | crossdev -t mips64el --abis n64 --ex-gdb And run the corresponding test (-g 7776 to use GDB server on 7776 port): | LUA_PATH="src/?.lua;test/tarantool-tests/?.lua;test/tarantool-tests/?/init.lua;;" \ | LD_LIBRARY_PATH="/usr/lib/gcc/mips64el-unknown-linux-gnu/13/" \ | qemu-mips64el -g 7776 -L /usr/mips64el-unknown-linux-gnu/ \ | src/luajit -jdump=ta test/tarantool-tests/fix-mips64-spare-side-exit-patching.test.lua If you want to connect to the running test from multiarch-gdb: | mips64el-unknown-linux-gnu-gdb src/luajit | (gdb) target remote 0.0.0.0:7776 | ... | 0x000000400297fd00 in __start () from /usr/mips64el-unknown-linux-gnu/lib64/ld.so.1 | (gdb) c [1]: https://github.com/LuaJIT/LuaJIT/commit/8ae5170c Branch: https://github.com/tarantool/luajit/tree/skaplun/gh-8825-mips-ppc-refactoring PR: https://github.com/tarantool/tarantool/pull/8969 Related Issues: * https://github.com/tarantool/tarantool/issues/8825 * https://github.com/LuaJIT/LuaJIT/pull/362 * https://github.com/LuaJIT/LuaJIT/issues/812 Mike Pall (17): MIPS: Use precise search for exit jump patching. MIPS: Fix handling of spare long-range jump slots. MIPS64: Add soft-float support to JIT compiler backend. PPC: Add soft-float support to interpreter. PPC: Add soft-float support to JIT compiler backend. Windows: Add UWP support, part 1. FFI: Eliminate hardcoded string hashes. Cleanup math function compilation and fix inconsistencies. Fix GCC 7 -Wimplicit-fallthrough warnings. DynASM: Fix warning. ARM: Fix GCC 7 -Wimplicit-fallthrough warnings. Fix debug.getinfo() argument check. Fix LJ_MAX_JSLOTS assertion in rec_check_slots(). Prevent integer overflow while parsing long strings. MIPS64: Fix register allocation in assembly of HREF. DynASM/MIPS: Fix shadowed variable. MIPS: Add MIPS64 R6 port. Sergey Kaplun (2): test: introduce mcode generator for tests build: fix non-Linux/macOS builds cmake/SetDynASMFlags.cmake | 5 + cmake/SetTargetFlags.cmake | 6 + doc/ext_ffi_api.html | 2 + dynasm/dasm_arm.h | 2 + dynasm/dasm_arm64.h | 1 + dynasm/dasm_mips.h | 14 +- dynasm/dasm_mips.lua | 629 ++++++--- dynasm/dasm_ppc.h | 1 + dynasm/dasm_x86.h | 18 +- dynasm/dynasm.lua | 1 + src/Makefile.original | 3 + src/host/buildvm_asm.c | 2 +- src/jit/bcsave.lua | 84 +- src/jit/dis_mips.lua | 293 +++- src/jit/dis_mips64r6.lua | 17 + src/jit/dis_mips64r6el.lua | 17 + src/lib_ffi.c | 36 +- src/lib_io.c | 4 +- src/lib_misc.c | 16 +- src/lib_package.c | 24 +- src/lj_alloc.c | 6 +- src/lj_arch.h | 80 +- src/lj_asm.c | 19 +- src/lj_asm_arm.h | 4 +- src/lj_asm_mips.h | 379 ++++- src/lj_asm_ppc.h | 322 ++++- src/lj_ccall.c | 38 +- src/lj_ccall.h | 4 +- src/lj_ccallback.c | 34 +- src/lj_clib.c | 20 +- src/lj_cparse.c | 87 +- src/lj_cparse.h | 2 + src/lj_crecord.c | 4 +- src/lj_debug.c | 16 +- src/lj_emit_mips.h | 17 +- src/lj_err.c | 1 + src/lj_ffrecord.c | 2 +- src/lj_frame.h | 2 +- src/lj_ircall.h | 45 +- src/lj_iropt.h | 2 +- src/lj_jit.h | 18 +- src/lj_lex.c | 2 +- src/lj_mcode.c | 14 +- src/lj_obj.h | 3 + src/lj_opt_sink.c | 2 +- src/lj_opt_split.c | 2 +- src/lj_parse.c | 3 +- src/lj_profile_timer.c | 8 +- src/lj_profile_timer.h | 8 +- src/lj_record.c | 4 +- src/lj_snap.c | 21 +- src/lj_target_mips.h | 52 +- src/luajit.c | 1 + src/vm_mips64.dasc | 413 +++++- src/vm_ppc.dasc | 1249 ++++++++++++++--- ...x-mips64-spare-side-exit-patching.test.lua | 65 + ...8-fix-side-exit-patching-on-arm64.test.lua | 78 +- ...-mips64-href-delay-slot-side-exit.test.lua | 101 ++ .../lj-812-too-long-string-separator.test.lua | 31 + test/tarantool-tests/utils/frontend.lua | 24 + test/tarantool-tests/utils/jit/generators.lua | 115 ++ 61 files changed, 3565 insertions(+), 908 deletions(-) create mode 100644 src/jit/dis_mips64r6.lua create mode 100644 src/jit/dis_mips64r6el.lua create mode 100644 test/tarantool-tests/fix-mips64-spare-side-exit-patching.test.lua create mode 100644 test/tarantool-tests/lj-362-mips64-href-delay-slot-side-exit.test.lua create mode 100644 test/tarantool-tests/lj-812-too-long-string-separator.test.lua create mode 100644 test/tarantool-tests/utils/jit/generators.lua -- 2.41.0