From e35cb23d69f74f8285a636ff7586c2cb7331ba9e Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 16 Feb 2019 19:50:03 -0500 Subject: [PATCH] Add f32<4>(float, float, float, float) constructor. --- include/dsp/simd.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/dsp/simd.hpp b/include/dsp/simd.hpp index 769064ea..3e3e7de4 100644 --- a/include/dsp/simd.hpp +++ b/include/dsp/simd.hpp @@ -56,6 +56,11 @@ struct f32<4> { v = _mm_set_ps1(x); } + /** Constructs a vector from four values. */ + f32<4>(float x1, float x2, float x3, float x4) { + v = _mm_set_ps(x1, x2, x3, x4); + } + /** Reads an array of 4 values. */ static f32<4> load(const float *x) { return f32<4>(_mm_loadu_ps(x));