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 6299FA6A7D1; Thu, 1 Feb 2024 19:15:05 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6299FA6A7D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1706804105; bh=B+qH/sj/iRrw1nVFEiDvnqQ9BZFUtJRFYdfojdJYNz8=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Pufeg+o3ktwgiuw/IHNnMkpKy+E1F62Teq0Pqquh0jpNet81cU4k3LXXW7QxRIojO xW+cUtYeosRUcHYFuXSCN13MoWbmm//PlqY3vxVbXTXgTIByr1BGx9bP0Tlw1WY8AZ Do00QJhgfvDGAaPZLZ0YqCnG+Pfgb2veRYwJ+e2o= Received: from smtp55.i.mail.ru (smtp55.i.mail.ru [95.163.41.93]) (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 AEF0DA6A7D1 for ; Thu, 1 Feb 2024 19:15:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AEF0DA6A7D1 Received: by smtp55.i.mail.ru with esmtpa (envelope-from ) id 1rVZiQ-00000009gem-0lFk; Thu, 01 Feb 2024 19:15:02 +0300 Message-ID: <0d661691-6b54-437f-b712-7fa5a316b150@tarantool.org> Date: Thu, 1 Feb 2024 19:15:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: Sergey Kaplun , Maxim Kokryashkin Cc: tarantool-patches@dev.tarantool.org References: <47242e634e89e7d1973aabfd32ced7585bcf086b.1706520765.git.skaplun@tarantool.org> In-Reply-To: <47242e634e89e7d1973aabfd32ced7585bcf086b.1706520765.git.skaplun@tarantool.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailru-Src: smtp X-4EC0790: 10 X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9010253A383FA2A7511C3B6E63805A2F483852EA9065B162E182A05F538085040133095F30FB8897A5D1BE6A8D71B10A5BF7250B13D7F6E923A16A0CF631EA9B94787F701E01DBF3D X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7C42AF033AFE07300EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006372E000E903B06FBD58638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8FA7378906A044DA8EDD8893C75EBCC69E22CFA04F769996DCC7F00164DA146DAFE8445B8C89999728AA50765F7900637D0FEED2715E18529389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC82FFDA4F57982C5F4F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA73AA81AA40904B5D9A18204E546F3947C4D3DDB508812D90003F1AB874ED890284AD6D5ED66289B523666184CF4C3C14F6136E347CC761E07725E5C173C3A84C3D50D4057CCB9F19BBA3038C0950A5D36B5C8C57E37DE458B330BD67F2E7D9AF16D1867E19FE14079C09775C1D3CA48CFE478A468B35FE7671DD303D21008E298D5E8D9A59859A8B6B372FE9A2E580EFC725E5C173C3A84C3EB9EA62DB0D2896935872C767BF85DA2F004C90652538430E4A6367B16DE6309 X-C1DE0DAB: 0D63561A33F958A51C0399B65BA38EF25002B1117B3ED6961BA2EF21D3E8D0DA92B673A2F5DDD7E7823CB91A9FED034534781492E4B8EEADC72A182EC22DCD89BDAD6C7F3747799A X-C8649E89: 1C3962B70DF3F0ADE00A9FD3E00BEEDF3FED46C3ACD6F73ED3581295AF09D3DF87807E0823442EA2ED31085941D9CD0AF7F820E7B07EA4CF9C87DD9C8D5222CFB08685D1D87EB1ADF062D59B7BD113A48C4BF3BCFFB0F087B94BA8791A304480BAF4CF3B87E910B12DEC27177E1EF7366D5646BA1EA28A4FF0ED39FDEB3A3D015F4332CA8FE04980913E6812662D5F2AB9AF64DB4688768036DF5FE9C0001AF333F2C28C22F508233FCF178C6DD14203 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKdLLj0Q7SP9l/xWr1b32ng== X-Mailru-Sender: C4F68CFF4024C8867DFDF7C7F25884585D795CD14C1F0171A4C2FF93DD6D44FA135E34CB79D0CD75D42F93969D0DF7B7645D15D82EE4B272BD6E4642A116CA93524AA66B5ACBE6721EF430B9A63E2A504198E0F3ECE9B5443453F38A29522196 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 luajit 13/26] test: enable in LuaJIT-tests 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 Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" HI, Sergey thanks for the patch! LGTM On 1/29/24 13:45, Sergey Kaplun wrote: > This patch uses the basename of the ctest library to be loaded via FFI. > It adds groups with the names of subtests and enables the test in > . The corresponding conditions are changed to the tags checked by > analogy with other tests. Tests with calls with 10 arguments with sizes > less than 8 bits are dummy for M1. with, with, with... feel free to ignore > This suite lacks a mechanism to skip > subtests satisfying complicated conditions, so it is done manually by > the corresponding `if` check. > > Part of tarantool/tarantool#9398 > --- > test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua | 70 ++++++++++++---------- > test/LuaJIT-tests/lib/ffi/index | 1 + > 2 files changed, 39 insertions(+), 32 deletions(-) > > diff --git a/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua b/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua > index b79d60b1..ee9dd5f0 100644 > --- a/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua > +++ b/test/LuaJIT-tests/lib/ffi/ffi_jit_call.lua > @@ -35,33 +35,37 @@ double __stdcall stdcall_dd(double a, double b); > float __stdcall stdcall_ff(float a, float b); > ]] > > -local lib = ffi.load("../clib/ctest") > - > -do > - local x > - for i=1,100 do > - x = lib.call_10i(-42, 17, 12345, 9987, -100, 11, 51, 0x12345678, 338, -78901234) > +local lib = ffi.load("ctest") > + > +do --- 10 int args > + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI > + local x > + for i=1,100 do > + x = lib.call_10i(-42, 17, 12345, 9987, -100, 11, 51, 0x12345678, 338, -78901234) > + end > + assert(x == -42 + 17 + 12345 + 9987 - 100 + 11 + 51 + 0x12345678 + 338 - 78901234) > end > - assert(x == -42+17+12345+9987-100+11+51+0x12345678+338-78901234) > end > > -do > +do --- 17 double args > for i=1,100 do > pcall(lib.call_max, i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i,i) > end > end > > -if ffi.abi("64bit") then > - local y = ffi.cast("void *", 0x123456789abcdefLL) > - local x > - for i=1,100 do > - lib.call_10j_p(0,0,0,0,0,0,0,0,0, y) > - x = lib.call_10j_p(0,0,0,0,0,0,0,0,0, nil) > +do --- 10 ints 1 pointer args +abi64 > + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI > + local y = ffi.cast("void *", 0x123456789abcdefLL) > + local x > + for i=1,100 do > + lib.call_10j_p(0,0,0,0,0,0,0,0,0, y) > + x = lib.call_10j_p(0,0,0,0,0,0,0,0,0, nil) > + end > + assert(x == 0) > end > - assert(x == 0) > end > > -do > +do --- int, int64_t args > local x = 0 > for i=1,100 do > x = x + lib.call_ij(100+i, i*0x300000002LL) > @@ -69,7 +73,7 @@ do > assert(x == 0x3b2e0000623eLL) > end > > -do > +do --- 10 double args > local x > for i=1,100 do > x = lib.call_10d(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x12345678, 338, -78901234.75) > @@ -77,15 +81,17 @@ do > assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x12345678+338-78901234.75) > end > > -do > - local x > - for i=1,100 do > - x = lib.call_10f(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x123456, 338, -789012.75) > +do --- 10 float args > + if not (jit.os == "OSX" and jit.arch == "arm64") then -- NYI > + local x > + for i=1,100 do > + x = lib.call_10f(-42.5, 17.125, 12345.5, 9987, -100.625, 11, 51, 0x123456, 338, -789012.75) > + end > + assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x123456+338-789012.75) > end > - assert(x == -42.5+17.125+12345.5+9987-100.625+11+51+0x123456+338-789012.75) > end > > -do > +do --- boolean result > local x > for i=-100,100 do > if not lib.call_b(i) then x = i end > @@ -100,14 +106,14 @@ do > assert(x == 90) > end > > -do > +do --- boolean result, tail call > local function tail(x) > return lib.call_b(x) > end > for i=1,100 do local a,b,c = tail(1), tail(1), tail(1) end > end > > -do > +do --- int8_t, uint8_t, int16_t, uint16_t args and results > local x = 0 > for i=0x01010080,0x010100ff do x = x + lib.call_i_i8(i) end > assert(x == -8128) > @@ -135,7 +141,7 @@ do > end > > -- target-specific > -if jit.arch == "x86" then > +do --- fastcall +x86 > for i=1,100 do assert(lib.fastcall_i(-42) == -41) end > for i=1,100 do assert(lib.fastcall_ii(-42, 17) == -42+17) end > for i=1,100 do assert(lib.fastcall_iii(-42, 17, 139) == -42+17+139) end > @@ -143,12 +149,12 @@ if jit.arch == "x86" then > for i=1,100 do assert(lib.fastcall_dd(12.5, -3.25) == 12.5-3.25) end > local x = lib.fastcall_ji > for i=1,100 do assert(x(0x123456789LL, -17) == 0x123456789LL-17) end > +end > > - if jit.os == "Windows" then > - for i=1,100 do assert(lib.stdcall_i(-42) == -41) end > - for i=1,100 do assert(lib.stdcall_ii(-42, 17) == -42+17) end > - for i=1,100 do assert(lib.stdcall_dd(12.5, -3.25) == 12.5-3.25) end > - for i=1,100 do assert(lib.stdcall_ff(12.5, -3.25) == 12.5-3.25) end > - end > +do --- stdcall +x86 +windows > + for i=1,100 do assert(lib.stdcall_i(-42) == -41) end > + for i=1,100 do assert(lib.stdcall_ii(-42, 17) == -42+17) end > + for i=1,100 do assert(lib.stdcall_dd(12.5, -3.25) == 12.5-3.25) end > + for i=1,100 do assert(lib.stdcall_ff(12.5, -3.25) == 12.5-3.25) end > end > > diff --git a/test/LuaJIT-tests/lib/ffi/index b/test/LuaJIT-tests/lib/ffi/index > index 0c1e5e66..d6e2b64a 100644 > --- a/test/LuaJIT-tests/lib/ffi/index > +++ b/test/LuaJIT-tests/lib/ffi/index > @@ -11,6 +11,7 @@ ffi_convert.lua > ffi_enum.lua > ffi_gcstep_recursive.lua > ffi_jit_arith.lua > +ffi_jit_call.lua > istype.lua > jit_array.lua > jit_complex.lua