diff --git a/internal/cgen/base/pixconv-submodule-ycck.c b/internal/cgen/base/pixconv-submodule-ycck.c index adf8d24c..936bb517 100644 --- a/internal/cgen/base/pixconv-submodule-ycck.c +++ b/internal/cgen/base/pixconv-submodule-ycck.c @@ -1049,10 +1049,17 @@ wuffs_base__pixel_swizzler__swizzle_ycck( wuffs_base__pixel_swizzler__has_triangle_upsampler(inv_h2, inv_v2))) { func = &wuffs_base__pixel_swizzler__swizzle_ycc__general__triangle_filter; #if defined(WUFFS_BASE__CPU_ARCH__X86_64) +#if defined(__GNUC__) && !defined(__clang__) + // Don't use our AVX2 implementation for GCC (but do use it for clang). For + // some unknown reason, GCC performs noticably better on the non-SIMD + // version. Possibly because GCC's auto-vectorizer is smarter (just with + // SSE2, not AVX2) than our hand-written code, but that's just a guess. +#else if (wuffs_base__cpu_arch__have_x86_avx2()) { upfuncs[1][1] = wuffs_base__pixel_swizzler__swizzle_ycc__upsample_inv_h2v2_triangle_x86_avx2; } +#endif #endif } else { diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 61e2ab36..ecbef92d 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -24871,10 +24871,17 @@ wuffs_base__pixel_swizzler__swizzle_ycck( wuffs_base__pixel_swizzler__has_triangle_upsampler(inv_h2, inv_v2))) { func = &wuffs_base__pixel_swizzler__swizzle_ycc__general__triangle_filter; #if defined(WUFFS_BASE__CPU_ARCH__X86_64) +#if defined(__GNUC__) && !defined(__clang__) + // Don't use our AVX2 implementation for GCC (but do use it for clang). For + // some unknown reason, GCC performs noticably better on the non-SIMD + // version. Possibly because GCC's auto-vectorizer is smarter (just with + // SSE2, not AVX2) than our hand-written code, but that's just a guess. +#else if (wuffs_base__cpu_arch__have_x86_avx2()) { upfuncs[1][1] = wuffs_base__pixel_swizzler__swizzle_ycc__upsample_inv_h2v2_triangle_x86_avx2; } +#endif #endif } else {