Implement AVX2 flags for GCC and MSC

This commit is contained in:
Jason Perkins 2015-03-26 08:17:13 -04:00
parent d61b995683
commit d34021bcc9
5 changed files with 31 additions and 4 deletions

View File

@ -864,6 +864,7 @@
allowed = {
"Default",
"AVX",
"AVX2",
"SSE",
"SSE2",
}

View File

@ -69,6 +69,7 @@
},
vectorextensions = {
AVX = "-mavx",
AVX2 = "-mavx2",
SSE = "-msse",
SSE2 = "-msse2",
},

View File

@ -54,8 +54,9 @@
},
vectorextensions = {
AVX = "/arch:AVX",
SSE = "/arch:sse",
SSE2 = "/arch:sse2",
AVX2 = "/arch:AVX2",
SSE = "/arch:SSE",
SSE2 = "/arch:SSE2",
},
warnings = {
Extra = "/W4",

View File

@ -123,6 +123,18 @@
test.contains({ "-msse2" }, gcc.getcflags(cfg))
end
function suite.cflags_onAVX()
vectorextensions "AVX"
prepare()
test.contains({ "-mavx" }, gcc.getcflags(cfg))
end
function suite.cflags_onAVX()
vectorextensions "AVX2"
prepare()
test.contains({ "-mavx2" }, gcc.getcflags(cfg))
end
--
-- Check the defines and undefines.

View File

@ -167,13 +167,25 @@
function suite.cflags_onSSE()
vectorextensions "SSE"
prepare()
test.contains("/arch:sse", msc.getcflags(cfg))
test.contains("/arch:SSE", msc.getcflags(cfg))
end
function suite.cflags_onSSE2()
vectorextensions "SSE2"
prepare()
test.contains("/arch:sse2", msc.getcflags(cfg))
test.contains("/arch:SSE2", msc.getcflags(cfg))
end
function suite.cflags_onAVX()
vectorextensions "AVX"
prepare()
test.contains("/arch:AVX", msc.getcflags(cfg))
end
function suite.cflags_onAVX2()
vectorextensions "AVX2"
prepare()
test.contains("/arch:AVX2", msc.getcflags(cfg))
end