diff --git a/modules/d/actions/vcxproj.lua b/modules/d/actions/vcxproj.lua index 8e22a8e3..019d1ef1 100644 --- a/modules/d/actions/vcxproj.lua +++ b/modules/d/actions/vcxproj.lua @@ -492,6 +492,7 @@ SSE3 = "sse3", SSSE3 = "ssse3", ["SSE4.1"] = "sse4.1", + ["SSE4.2"] = "sse4.2", } if vextMap[cfg.vectorextensions] ~= nil then table.insert(opts, "-mattr=+" .. vextMap[cfg.vectorextensions]) diff --git a/modules/d/tools/ldc.lua b/modules/d/tools/ldc.lua index 0900cf4f..bf0a3b8b 100644 --- a/modules/d/tools/ldc.lua +++ b/modules/d/tools/ldc.lua @@ -116,6 +116,7 @@ SSE3 = "-mattr=+sse3", SSSE3 = "-mattr=+ssse3", ["SSE4.1"] = "-mattr=+sse4.1", + ["SSE4.2"] = "-mattr=+sse4.2", }, warnings = { Default = "-wi", diff --git a/modules/vstudio/vs2010_vcxproj.lua b/modules/vstudio/vs2010_vcxproj.lua index d0605bb2..e2770fb5 100644 --- a/modules/vstudio/vs2010_vcxproj.lua +++ b/modules/vstudio/vs2010_vcxproj.lua @@ -1788,7 +1788,7 @@ elseif x == "AVX2" and _ACTION > "vs2012" then v = "AdvancedVectorExtensions2" elseif cfg.architecture ~= "x86_64" then - if x == "SSE2" or x == "SSE3" or x == "SSSE3" or x == "SSE4.1" then + if x == "SSE2" or x == "SSE3" or x == "SSSE3" or x == "SSE4.1" or x == "SSE4.2" then v = "StreamingSIMDExtensions2" elseif x == "SSE" then v = "StreamingSIMDExtensions" diff --git a/src/_premake_init.lua b/src/_premake_init.lua index 7aba4046..7ed81dd9 100644 --- a/src/_premake_init.lua +++ b/src/_premake_init.lua @@ -1316,6 +1316,7 @@ "SSE3", "SSSE3", "SSE4.1", + "SSE4.2", } } diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index d6bcd71f..fef1c142 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -86,6 +86,7 @@ SSE3 = "-msse3", SSSE3 = "-mssse3", ["SSE4.1"] = "-msse4.1", + ["SSE4.2"] = "-msse4.2", }, isaextensions = { MOVBE = "-mmovbe", diff --git a/src/tools/msc.lua b/src/tools/msc.lua index 2ddefec5..a5a67753 100644 --- a/src/tools/msc.lua +++ b/src/tools/msc.lua @@ -88,6 +88,7 @@ SSE3 = "/arch:SSE2", SSSE3 = "/arch:SSE2", ["SSE4.1"] = "/arch:SSE2", + ["SSE4.2"] = "/arch:SSE2", }, warnings = { Off = "/W0", diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index faf2e9a9..ade14436 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -136,6 +136,12 @@ test.contains({ "-msse2" }, gcc.getcflags(cfg)) end + function suite.cflags_onSSE4_2() + vectorextensions "SSE4.2" + prepare() + test.contains({ "-msse4.2" }, gcc.getcflags(cfg)) + end + function suite.cflags_onAVX() vectorextensions "AVX" prepare() diff --git a/tests/tools/test_msc.lua b/tests/tools/test_msc.lua index 65a2f9d5..32992264 100644 --- a/tests/tools/test_msc.lua +++ b/tests/tools/test_msc.lua @@ -307,6 +307,13 @@ test.contains("/arch:SSE2", msc.getcflags(cfg)) end + function suite.cflags_onSSE4_2() + vectorextensions "SSE4.2" + prepare() + test.contains("/arch:SSE2", msc.getcflags(cfg)) + end + + function suite.cflags_onAVX() vectorextensions "AVX" prepare() diff --git a/website/docs/vectorextensions.md b/website/docs/vectorextensions.md index 66f5e291..5f68c2fe 100644 --- a/website/docs/vectorextensions.md +++ b/website/docs/vectorextensions.md @@ -21,6 +21,7 @@ If no value is set for a configuration, the toolset's default vector extension s | SSE3 | Use the SSE3 instruction set. | | SSSE3 | Use the SSSE3 instruction set. | | SSE4.1 | Use the SSE4.1 instruction set. | +| SSE4.2 | Use the SSE4.2 instruction set. | | NEON | Use the NEON instruction set (Android only) | | MXU | Use the XBurst SIMD instructions (Android only) |