[MultiVarStore] Remove SSE / NEON paths

I'm guessing that the compiler is automatically using those already.
This commit is contained in:
Behdad Esfahbod 2024-09-26 14:02:49 -06:00
parent 7cedf7a80b
commit 44daf39962

View file

@ -38,12 +38,6 @@
#include "OT/Layout/Common/Coverage.hh"
#include "OT/Layout/types.hh"
#ifdef __SSE__
#include <xmmintrin.h>
#elif defined(__ARM_NEON)
#include <arm_neon.h>
#endif
// TODO(garretrieger): cleanup these after migration.
using OT::Layout::Common::Coverage;
@ -3152,75 +3146,12 @@ struct MultiVarData
count = hb_min (count, values_iter.length);
values_iter += count;
#ifdef __SSE__
{
if (scalar == 1.f)
{
unsigned i = 0;
for (; i + 4 <= count; i += 4)
{
__m128 a = _mm_loadu_ps (in + i);
__m128 b = _mm_loadu_ps (out + i);
_mm_storeu_ps (out + i, _mm_add_ps (a, b));
}
for (; i < count; i++)
out[i] += in[i];
}
else
{
unsigned i = 0;
__m128 s = _mm_set1_ps (scalar);
for (; i + 4 <= count; i += 4)
{
__m128 a = _mm_loadu_ps (in + i);
__m128 b = _mm_loadu_ps (out + i);
_mm_storeu_ps (out + i, _mm_add_ps (_mm_mul_ps (a, s), b));
}
for (; i < count; i++)
out[i] += in[i] * scalar;
}
return;
}
#elif defined(__ARM_NEON)
{
if (scalar == 1.f)
{
unsigned i = 0;
for (; i + 4 <= count; i += 4)
{
float32x4_t a = vld1q_f32 (in + i);
float32x4_t b = vld1q_f32 (out + i);
vst1q_f32 (out + i, vaddq_f32 (a, b));
}
for (; i < count; i++)
out[i] += in[i];
}
else
{
unsigned i = 0;
float32x4_t s = vdupq_n_f32 (scalar);
for (; i + 4 <= count; i += 4)
{
float32x4_t a = vld1q_f32 (in + i);
float32x4_t b = vld1q_f32 (out + i);
vst1q_f32 (out + i, vmlaq_f32 (b, a, s));
}
for (; i < count; i++)
out[i] += in[i] * scalar;
}
return;
}
#endif
// Fallback
{
if (scalar == 1.f)
for (unsigned i = 0; i < count; i++)
out[i] += in[i];
else
for (unsigned i = 0; i < count; i++)
out[i] += in[i] * scalar;
}
if (scalar == 1.f)
for (unsigned i = 0; i < count; i++)
out[i] += in[i];
else
for (unsigned i = 0; i < count; i++)
out[i] += in[i] * scalar;
}
template <typename DeltaSets>