diff options
Diffstat (limited to 'xmake/modules/core')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 13 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 22 |
2 files changed, 21 insertions, 14 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index e69b7d814..aa8c9aba1 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -180,11 +180,14 @@ end function nf_vectorext(self, extension) local maps = { - sse = "-arch:SSE" - , sse2 = "-arch:SSE2" - , avx = "-arch:AVX" - , avx2 = "-arch:AVX2" - , fma = "-arch:AVX2" + sse = "-arch:SSE" + , sse2 = "-arch:SSE2" + , ["sse4.2"] = "/d2archSSE42" -- the only undocumented way works, @see https://github.com/xmake-io/xmake/issues/3786 + , avx = "-arch:AVX" + , 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 60f6ac805..b45c04119 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -164,17 +164,21 @@ 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" - , sse = "-msse" - , sse2 = "-msse2" - , sse3 = "-msse3" - , ssse3 = "-mssse3" - , avx = "-mavx" - , avx2 = "-mavx2" - , fma = "-mfma" - , neon = "-mfpu=neon" + mmx = "-mmmx" + , sse = "-msse" + , sse2 = "-msse2" + , sse3 = "-msse3" + , ssse3 = "-mssse3" + , ["sse4.2"] = "-msse4.2" + , avx = "-mavx" + , avx2 = "-mavx2" + , avx512 = {"-mavx512f", "-mavx512dq", "-mavx512bw", "-mavx512vl"} + , fma = "-mfma" + , neon = "-mfpu=neon" + , all = "-march=native" } return maps[extension] end |
