[Premake] Remove AVX2 requirement from linux build
Co-authored-by: has207 <429230+has207@users.noreply.github.com>
This commit is contained in:
committed by
Radosław Gliński
parent
3252d256ca
commit
892aa85913
@@ -126,7 +126,7 @@ filter({"configurations:Release", "platforms:Windows"}) -- "toolset:msc"
|
||||
filter("platforms:Linux")
|
||||
system("linux")
|
||||
toolset("clang")
|
||||
vectorextensions("AVX2")
|
||||
vectorextensions("AVX")
|
||||
--buildoptions({
|
||||
-- "-mlzcnt", -- (don't) Assume lzcnt is supported.
|
||||
--})
|
||||
|
||||
@@ -308,6 +308,11 @@ void copy_and_swap_32_aligned(void* dest_ptr, const void* src_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
// Enable AVX2 for this function even when building with -mavx
|
||||
// The function has runtime detection to only use AVX2 on supported CPUs
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
__attribute__((target("avx2")))
|
||||
#endif
|
||||
void copy_and_swap_32_unaligned(void* dest_ptr, const void* src_ptr,
|
||||
size_t count) {
|
||||
auto dest = reinterpret_cast<uint32_t*>(dest_ptr);
|
||||
|
||||
Reference in New Issue
Block a user