From 0d12ca94fe31060216337d96736a3b8cb756beb9 Mon Sep 17 00:00:00 2001 From: jakob Date: Wed, 30 Oct 2024 21:58:42 +0100 Subject: [PATCH] [gcc] Use compat for _mm_storeu_si32 on older GCCs Older GCC versions [which? at least GCC9] don't implement `_mm_storeu_si32()`. In these cases use the intrinsic for storing a single float value instead and cast the argument and the destination accordingly. --- avs/vis_avs/blend.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/avs/vis_avs/blend.cpp b/avs/vis_avs/blend.cpp index 454408f..eba52d8 100644 --- a/avs/vis_avs/blend.cpp +++ b/avs/vis_avs/blend.cpp @@ -779,6 +779,13 @@ static inline void print_m128i(__m128i a) { printf(":: %08x %08x %08x %08x\n", debug[3], debug[2], debug[1], debug[0]); } +// Some older compilers don't implement the `_mm_storeu_si32()` instrinsic. They do +// implement the `_mm_store_ss()` intrinsic which stores the same, just expects floats. +#ifndef _mm_storeu_si32 +#define _mm_storeu_si32(dest, a) \ + _mm_store_ss(reinterpret_cast(dest), _mm_castsi128_ps(a)); +#endif + static inline uint32_t blend_bilinear_2x2_rgb0_8_x86v128(const uint32_t* src, uint32_t w, uint8_t lerp_x,