-
Notifications
You must be signed in to change notification settings - Fork 387
luajit: bit ops works differently with -march=native on Tiger Lake #6787
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
If we'll dig down to the root of the issue, I would also ask to re-verify, whether it is actually the reason of the difference in vinyl behaviour. This problem is described in tarantool/expirationd#104 and I see a correlation. How to check: checkout expirationd 1.1.1-44-g838c2d1, run
I would also highlight that we see those errors (re vinyl quota) in the integration testing on Ubuntu 20.04 (Focal), where expirationd tests are run using the usual package for Ubuntu Focal. So, if the correlation is actually a relation, this problem is possibly not about some very unusual build. |
Reproduced on Intel Xeon: Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz. /proc/cpuinfo
Minimal test case: local ffi = require("ffi")
local bit = require("bit")
ffi.cdef[[
typedef enum { ZZI = -1 } ienum_t;
typedef enum { ZZU } uenum_t;
]]
-- tobit/band negative unsigned enum
local x = ffi.new("uenum_t", -10)
local y = bit.tobit(x)
assert(type(y) == "number")
assert(y == -10, tostring(y)) Related to AVX512? |
When build with -march=native on Tiger Lake (or any other CPU architecture with AVX512) the following script print(ffi.new('uint64_t', -10)) prints This instruction is avalable with CPU feature flag AVX512F. #(gdb) x /16i lj_num2u64
0x445c48 <lj_cconv_ct_ct+2376>: vcvttsd2usi rax,xmm0
=> 0x445c4e <lj_cconv_ct_ct+2382>: mov QWORD PTR [r14],rax
and the result is the
As stated in instruction description:
So as far as -10 doesn't hit unsigned integer range In upstream this function is modified by the following patch. After the patch the assembler of this function contains See also LuaJIT/LuaJIT#415. |
This commit adds the build with aforementioned option to exotic builds matrix, so it is tested on both x86_64 and ARM64 architectures now. Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds the build with aforementioned option to exotic builds matrix, so it is tested on both x86_64 and ARM64 architectures now. Defining outputs for jobs 1. https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs 2. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif 3. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds the build with aforementioned option to exotic builds matrix, so it is tested on both x86_64 and ARM64 architectures now. Defining outputs for jobs 1. https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs 2. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif 3. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds a workflow for building and testing with enabled AVX512. Defining outputs for jobs 1. https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs 2. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif 3. https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds a workflow for building and testing with enabled AVX512. Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds a workflow for building and testing with enabled AVX512. Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds a workflow for building and testing with enabled AVX512. Needed for tarantool/tarantool#9595 Related to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9595 Relates to tarantool/tarantool#6787
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9924 Relates to tarantool/tarantool#6787 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Kaplun <skaplun@tarantool.org> Signed-off-by: Sergey Kaplun <skaplun@tarantool.org> (cherry picked from commit bb08425)
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9924 Relates to tarantool/tarantool#6787 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Kaplun <skaplun@tarantool.org> Signed-off-by: Sergey Kaplun <skaplun@tarantool.org>
This commit adds a workflow for building and testing with AVX512 enabled. Needed for tarantool/tarantool#9924 Relates to tarantool/tarantool#6787 Reviewed-by: Maxim Kokryashkin <m.kokryashkin@tarantool.org> Reviewed-by: Sergey Kaplun <skaplun@tarantool.org> Signed-off-by: Sergey Kaplun <skaplun@tarantool.org> (cherry picked from commit bb08425)
Tarantool version:
2.10.0-beta2-5-gdc19be406
Successful build:
Failed build:
How it fails:
The test case itself:
Hardware
Dell Latitude 5420. Tiger Lake CPU.
Environment
The problem was initially found, when I built tarantool using emerge, and then it was narrowed down to the reproducer above. I'll share configuration applied on tarantool package just in case.
emerge configuration
Ebuild is here.
USE flags: backtrace debug system-libcurl system-libyaml system-zstd -feedback-daemon -gcov -gprof -systemd -test CPU_FLAGS_X86="avx sse2".
The text was updated successfully, but these errors were encountered: