diff options
| author | ruki <[email protected]> | 2023-07-27 00:39:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-07-27 00:39:50 +0800 |
| commit | 1bf614da70028c2f1316d0ec6e22cd39dd8540aa (patch) | |
| tree | fe1723a4ef01aaf871cc832576c64400dd8e2934 | |
| parent | 6edfa59d6d7941455c5d647a3f351d4ee546ae26 (diff) | |
improve avx512
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 4 | ||||
| -rw-r--r-- | xmake/modules/private/check/checkers/api/target/vectorexts.lua | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 0f4012775..aa8c9aba1 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -187,6 +187,7 @@ function nf_vectorext(self, extension) , avx2 = "-arch:AVX2" , avx512 = "-arch:AVX512" -- for msvc 2019+ avx512 support , fma = "-arch:AVX2" + , all = {"-arch:SSE", "-arch:SSE2", "/d2archSSE42", "-arch:AVX", "-arch:AVX2", "-arch:AVX512"} } local flag = maps[extension] if flag and self:has_flags(flag, "cxflags") then diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 218fc73f0..b45c04119 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -164,6 +164,7 @@ function nf_optimize(self, level) end -- make the vector extension flag +-- @see https://github.com/xmake-io/xmake/issues/1613 function nf_vectorext(self, extension) local maps = { mmx = "-mmmx" @@ -174,9 +175,10 @@ function nf_vectorext(self, extension) , ["sse4.2"] = "-msse4.2" , avx = "-mavx" , avx2 = "-mavx2" - , avx512 = "-march=skylake-avx512" -- @see https://github.com/xmake-io/xmake/issues/1613 + , avx512 = {"-mavx512f", "-mavx512dq", "-mavx512bw", "-mavx512vl"} , fma = "-mfma" , neon = "-mfpu=neon" + , all = "-march=native" } return maps[extension] end diff --git a/xmake/modules/private/check/checkers/api/target/vectorexts.lua b/xmake/modules/private/check/checkers/api/target/vectorexts.lua index c46020b60..1dbbc0735 100644 --- a/xmake/modules/private/check/checkers/api/target/vectorexts.lua +++ b/xmake/modules/private/check/checkers/api/target/vectorexts.lua @@ -24,5 +24,5 @@ import(".api_checker") function main(opt) opt = opt or {} api_checker.check_targets("vectorexts", table.join(opt, {values = { - "none", "sse", "sse2", "sse3", "ssse3", "sse4.2", "avx", "avx2", "avx512", "fma", "neon"}})) + "none", "all", "sse", "sse2", "sse3", "ssse3", "sse4.2", "avx", "avx2", "avx512", "fma", "neon"}})) end |
