diff --git a/README.md b/README.md index 30c88d39..a143691f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ This package contains: - libvorbisenc, a BSD-style license library that provides a simple, programmatic encoding setup interface +- the generic scalar fallback used on non-x86 targets such as `riscv64` + - example code making use of libogg, libvorbis, libvorbisfile and libvorbisenc diff --git a/lib/os.h b/lib/os.h index ae1e6f78..b84c985a 100644 --- a/lib/os.h +++ b/lib/os.h @@ -145,8 +145,10 @@ static __inline void vorbis_fpu_restore(vorbis_fpu_control fpu){ /* Optimized code path for x86_64 builds. Uses SSE2 intrinsics. This can be - done safely because all x86_64 CPUs supports SSE2. */ -#if (defined(_MSC_VER) && (defined(_M_X64) && !defined(_M_ARM64EC))) || (defined(__GNUC__) && defined (__SSE2_MATH__)) + done safely because all x86_64 CPUs supports SSE2. Keep it gated on x86_64 + only, and explicitly step aside when a forced non-x86 target probe defines + __riscv on an x86_64 host for portability smoke testing. */ +#if (defined(_MSC_VER) && (defined(_M_X64) && !defined(_M_ARM64EC))) || (defined(__GNUC__) && defined(__x86_64__) && defined(__SSE2_MATH__) && !defined(__riscv)) # define VORBIS_FPU_CONTROL typedef ogg_int16_t vorbis_fpu_control;