Skip to content

Commit

Permalink
Fix Regx2::store() and Regx2::storeu()
Browse files Browse the repository at this point in the history
The implentations of `Regx2::store()` and `Regx2::storeu()` with
`MIPP_NO_INTRINSICS` are incorrect because `Reg<T>` cannot be implicitly
converted to `T`. The value in `Reg<T>` should be accessed explicitly.

In contrast, `Regx2::load()` and `Regx2::loadu()` use the exact reverse
assignment approach but work correctly because `Reg<T>` includes a
constructor `Reg(const T val)`, which allows implicit conversion from
`T` to `Reg<T>`.
  • Loading branch information
wh201906 committed Nov 11, 2024
1 parent f727ba9 commit e598a94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/mipp_object.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ public:
#else
inline void load (const T* data ) { val[0] = data[0]; val[1] = data[1]; }
inline void loadu (const T* data ) { val[0] = data[0]; val[1] = data[1]; }
inline void store (T* data ) const { data[0] = val[0]; data[1] = val[1]; }
inline void storeu (T* data ) const { data[0] = val[0]; data[1] = val[1]; }
inline void store (T* data ) const { data[0] = val[0].r; data[1] = val[1].r; }
inline void storeu (T* data ) const { data[0] = val[0].r; data[1] = val[1].r; }
inline Regx2<T> interleave ( ) const { return *this; }
inline Regx2<T> deinterleave( ) const { return *this; }
inline Regx2<T> conj ( ) const { return Regx2<T>(val[0].r, -val[1].r); }
Expand Down

0 comments on commit e598a94

Please sign in to comment.