summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-07-26 23:02:44 +0800
committerGitHub <[email protected]>2023-07-26 23:02:44 +0800
commit2ced205fec82c50143fe0fbbbfdb31d52e7aeebe (patch)
treefe1723a4ef01aaf871cc832576c64400dd8e2934 /xmake/modules/core/tools/cl.lua
parentdb47073a5ec27a85073d67c03e38c7bd55598598 (diff)
parent1bf614da70028c2f1316d0ec6e22cd39dd8540aa (diff)
Merge pull request #4012 from xmake-io/avx512
add avx512 for vectorext
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua13
1 files changed, 8 insertions, 5 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