Skip to content

compiler(amd64): return false on SSE4 unsupported CPUs #1121

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

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

evacchi
Copy link
Contributor

@evacchi evacchi commented Feb 13, 2023

I am not sure whether we should also add some test case to exercise this code path. Maybe enabling emulated tests as suggested in #581? Even my old Window laptop is newer and passes :D

Signed-off-by: Edoardo Vacchi [email protected]

Fixes #580

@evacchi evacchi marked this pull request as ready for review February 13, 2023 16:02
@mathetake mathetake changed the title Compiler(amd64): return false on SSE4 unsupported CPUs compiler(amd64): return false on SSE4 unsupported CPUs Feb 13, 2023
@mathetake
Copy link
Member

mathetake commented Feb 13, 2023

well, at least I would like you to verify it via QEMU, but no need to add it to the CI I think :D (Closed #581.)

@evacchi
Copy link
Contributor Author

evacchi commented Feb 13, 2023

TBF I tried to setup QEMU and I gave up because it was so slow, but I just realized I could just download a preinstalled image instead of starting from scratch 🤦‍♂️ (probably docker would do too...)

@mathetake
Copy link
Member

mathetake commented Feb 13, 2023

If setting toolchains locally is something too slow, you could build a binary go test -c -o outputbin on your main machine, and only send the built test binary to the emulated environment. That's how you could avoid the need to install Go, Git, etc

you need test only the platform package around cpuinfo, no need to run full go tests in this repository.

@mathetake
Copy link
Member

anyway merging as I think this works!

@mathetake mathetake merged commit 28b0084 into tetratelabs:main Feb 13, 2023
@mathetake
Copy link
Member

#1122

@evacchi
Copy link
Contributor Author

evacchi commented Feb 14, 2023

ok I confirm that it works on a qemu machine started with -cpu qemu64,-sse4_1,-sse4_2; i.e. CompilerSupported() returns false.

@evacchi evacchi deleted the sse41 branch February 14, 2023 13:48
@mathetake
Copy link
Member

Coolio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler(amd64): return false on SSE4 unsupported CPUs from platform.CompilerSupported
2 participants