Modify vector extensions

I am using some code that uses vector extensions (an SSE 4.2 version and an AVX version). For my SwiftPM generated project, "Enable Additional Vector Extensions" in the build settings is set to "Platform default", which uses $(DEFAULT_SSE_LEVEL_4_2_$(GCC_ENABLE_SSE42_EXTENSIONS)). At best, this would give me SSE 4.2 (if GCC_ENABLE_SSE42_EXTENSIONS was true), but instead disables vector extensions entirely, making the library unusable. I want to set to be able to set this to, e.g., SSE 4.2. I could use unsafeFlags, but then my library wouldn't be usable as a dependency. Any ideas? And as I mention in my other recent post, this is one more example of a cumbersome process for getting compile flags supported by SwiftPM.

It's worth noting that the DEFAULT_SSE_LEVEL_* flags are way too heavy of a hammer for most uses and probably shouldn't exist to begin with; they apply project-wide, so they frequently cause problems for people. Per-file flags (or better, per-function attributes) are a much better way to accomplish this for most uses where a binary will end up getting distributed (I don't think SwiftPM supports those either, yet--except for attributes on C functions--but they're what I would want it to support if we're designing a system from scratch).

None of this takes anything away from your general "we need a way to do this" point.

Terms of Service

Privacy Policy

Cookie Policy