ska-sa / spead2

Library for the Streaming Protocol for Exchange of Astronomical Data (SPEAD)
http://spead2.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
23 stars 14 forks source link

Add detection of function multi-versioning in the compiler #234

Closed bmerry closed 1 year ago

bmerry commented 1 year ago

This support is used so that the SSE2 version of memcpy_nontemporal is selected only if the CPU supports SSE2 at runtime.

On x86-64 there is guaranteed to be runtime support, so this only affects i386. Note that i386 is not currently tested. The real motivation is that it lays the groundwork for adding more specialised variants e.g. AVX, AVX-512, MOVDIR64B etc.

bmerry commented 1 year ago

@james-smith-za I think hold off the reviewing for now - it's going to need some tweaks to make it play nice with MacOS's universal binaries.

james-smith-za commented 1 year ago

@james-smith-za I think hold off the reviewing for now - it's going to need some tweaks to make it play nice with MacOS's universal binaries.

Why we are bothering to support macOS is still beyond me...

Does the Apple silicon even support SSE2?

bmerry commented 1 year ago

Why we are bothering to support macOS is still beyond me...

Some applications that use spead2 are developed by people who have Macs (like @ludwigschwardt).

Does the Apple silicon even support SSE2?

It doesn't. But the Python builder tries to build universal binaries that have code for both x86-64 and ARM64, which confuses things.

bmerry commented 1 year ago

@james-smith-za looks like I've got the MacOS support fixed.

rtobar commented 1 year ago

Why we are bothering to support macOS is still beyond me...

Some applications that use spead2 are developed by people who have Macs (like @ludwigschwardt).

To further support this point: in SKA there are several developers that use Macs and either indirectly use spead2, or actually develop applications on top of it.