-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SSE 4.2. #1710
Add support for SSE 4.2. #1710
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a unit test for the value.
Thank your for your speedy response. Do you really think a test is necessary? There are also no tests that I can find for SSE 3, SSSE 3 or SSE 4.1 and I think that is totally fine that way. If you insist that this must be tested, I am actually not sure how to. The only tests for SSE-like kind of things seem to be for specific toolsets. Would I need to make a new test for each of them? |
I'll defer to @starkos or @samsinsane for final decision on a unit test, but it's part of our checklist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the unit tests, I guess it would depend if SSE4.2 is only supported by a subset of VS. It looks like that's how it's been tested before, I'm not sure if explicitly testing each possible value is worth the effort but given how we map the values for VS perhaps we should ensure we are mapping correctly? I think this can be merged without any unit tests though.
As for how to do the tests, just as they are already:
premake-core/modules/vstudio/tests/vc2010/test_vectorextensions.lua
Lines 33 to 93 in 65deb61
function suite.instructionSet_onIA32_onVS2010() | |
vectorextensions "IA32" | |
prepare() | |
test.isemptycapture() | |
end | |
function suite.instructionSet_onIA32() | |
p.action.set("vs2012") | |
vectorextensions "IA32" | |
prepare() | |
test.capture [[ | |
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> | |
]] | |
end | |
function suite.instructionSet_onSSE() | |
vectorextensions "SSE" | |
prepare() | |
test.capture [[ | |
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet> | |
]] | |
end | |
function suite.instructionSet_onSSE2() | |
vectorextensions "SSE2" | |
prepare() | |
test.capture [[ | |
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet> | |
]] | |
end | |
function suite.instructionSet_onAVX() | |
p.action.set("vs2013") | |
vectorextensions "AVX" | |
prepare() | |
test.capture [[ | |
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet> | |
]] | |
end | |
function suite.instructionSet_onAVX_onVS2010() | |
vectorextensions "AVX" | |
prepare() | |
test.isemptycapture() | |
end | |
function suite.instructionSet_onAVX2() | |
p.action.set("vs2013") | |
vectorextensions "AVX2" | |
prepare() | |
test.capture [[ | |
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet> | |
]] | |
end | |
function suite.instructionSet_onAVX2_onVS2012() | |
p.action.set("vs2012") | |
vectorextensions "AVX2" | |
prepare() | |
test.isemptycapture() | |
end |
premake-core/tests/tools/test_msc.lua
Lines 298 to 320 in 65deb61
function suite.cflags_onSSE() | |
vectorextensions "SSE" | |
prepare() | |
test.contains("/arch:SSE", msc.getcflags(cfg)) | |
end | |
function suite.cflags_onSSE2() | |
vectorextensions "SSE2" | |
prepare() | |
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 |
premake-core/tests/tools/test_gcc.lua
Lines 127 to 149 in 65deb61
function suite.cflags_onSSE() | |
vectorextensions "SSE" | |
prepare() | |
test.contains({ "-msse" }, gcc.getcflags(cfg)) | |
end | |
function suite.cflags_onSSE2() | |
vectorextensions "SSE2" | |
prepare() | |
test.contains({ "-msse2" }, gcc.getcflags(cfg)) | |
end | |
function suite.cflags_onAVX() | |
vectorextensions "AVX" | |
prepare() | |
test.contains({ "-mavx" }, gcc.getcflags(cfg)) | |
end | |
function suite.cflags_onAVX2() | |
vectorextensions "AVX2" | |
prepare() | |
test.contains({ "-mavx2" }, gcc.getcflags(cfg)) | |
end |
ec9616c
to
510f50d
Compare
You are right, there are no changes regarding the VS version because VS (unfortunately) can't directly target SSE3 - SSE4.2 in any version with it's code generation controlled by these compiler switches. I have made the AVX entry the second one again even though I am sceptical of the existing order in regards to if there is any meaning to it. |
Can we maybe make progress with this? @nickclark2016 Apparently both @starkos and @samsinsane consider the level of preexisting testing sufficient. If I am not mistaken, your counter argument was only due to the formal requirement of fulfilling the checklist. Can you accept this patch set? |
If tests are added for MSC (see |
95b91f4
to
237e820
Compare
@nickclark2016 Can we make progress with this now? |
What does this PR do?
This adds support for SSE 4.2 in Premake. The change is quite simple. The lack of SSE 4.2 support so far was probably just an oversight.
How does this PR change Premake's behavior?
There are no behaviour changes for already written and currently working Premake build scripts.
Anything else we should know?
I did not add new tests, since there are none for global configurations themselves and I just added new table entries and really did not change any actual logic.
Did you check all the boxes?
closes #XXXX
in comment to auto-close issue when PR is merged)You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!