Skip to content

Commit

Permalink
[gcc] Use compat for _mm_storeu_si32 on older GCCs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
grandchild committed Oct 30, 2024
1 parent 1e7d831 commit d53c9f5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions avs/vis_avs/blend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<float*>(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,
Expand Down

0 comments on commit d53c9f5

Please sign in to comment.