Browse Source

Add `f32<4>::load()` static method instead of constructor.

tags/v1.0.0
Andrew Belt 6 years ago
parent
commit
dba6448c07
2 changed files with 5 additions and 5 deletions
  1. +3
    -3
      include/dsp/simd.hpp
  2. +2
    -2
      include/dsp/sse_mathfun.h

+ 3
- 3
include/dsp/simd.hpp View File

@@ -10,7 +10,7 @@ template <int N>
struct f32;


/** Wrapper for `__m128` representing a vector of 4 single-precision float values. */
/** Wrapper for `__m128` representing an aligned vector of 4 single-precision float values. */
template <>
struct f32<4> {
__m128 v;
@@ -21,8 +21,8 @@ struct f32<4> {
v = _mm_set_ps1(x);
}
/** Reads an array of 4 values. */
f32<4>(const float *x) {
v = _mm_loadu_ps(x);
static f32<4> load(const float *x) {
return f32<4>(_mm_loadu_ps(x));
}
/** Writes an array of 4 values. */
void store(float *x) {


+ 2
- 2
include/dsp/sse_mathfun.h View File

@@ -1,5 +1,5 @@
/*
Modified version of http://gruntthepeon.free.fr/ssemath/ for VCV Rack.
/* Modified version of http://gruntthepeon.free.fr/ssemath/ for VCV Rack.
The following changes were made.
- Remove typedefs for __m128 to avoid type pollution, and because it's not that ugly.
- Make all functions inline since this is a header file.


Loading…
Cancel
Save