mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 13:45:43 +01:00
AVX gcc compatibility
`_mm256_cvtss_f32` is only available in avxintrin.h of gcc-8 or
later. There it is defined as
```
extern __inline float
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm256_cvtss_f32 (__m256 __A)
{
return __A[0];
}
```
While explicit `vcurrent[0]` works with gcc-5 and gcc-6,
older gcc-4 fails with the following
error: invalid types 'float __vector__[int]' for array subscript
This commit is contained in:
parent
01dbbb86c3
commit
68f1ec348d
1 changed files with 7 additions and 1 deletions
|
|
@ -137,7 +137,13 @@ x86_sse_avx_compute_peak(const float *src, uint32_t nframes, float current)
|
|||
// zero upper 128 bit of 256 bit ymm register to avoid penalties using non-AVX instructions
|
||||
_mm256_zeroupper();
|
||||
|
||||
return vcurrent[0]; // _mm256_cvtss_f32
|
||||
#if defined(__GNUC__) && (__GNUC__ < 5)
|
||||
return *((float *)&vcurrent);
|
||||
#elif defined(__GNUC__) && (__GNUC__ < 8)
|
||||
return vcurrent[0];
|
||||
#else
|
||||
return _mm256_cvtss_f32 (vcurrent);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue