From e598a946707e7f1429db505d1f96711a367993b2 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Mon, 11 Nov 2024 17:08:32 +0800 Subject: [PATCH] Fix Regx2::store() and Regx2::storeu() The implentations of `Regx2::store()` and `Regx2::storeu()` with `MIPP_NO_INTRINSICS` are incorrect because `Reg` cannot be implicitly converted to `T`. The value in `Reg` should be accessed explicitly. In contrast, `Regx2::load()` and `Regx2::loadu()` use the exact reverse assignment approach but work correctly because `Reg` includes a constructor `Reg(const T val)`, which allows implicit conversion from `T` to `Reg`. --- include/mipp_object.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mipp_object.hxx b/include/mipp_object.hxx index 5f57aac..f8f0f97 100644 --- a/include/mipp_object.hxx +++ b/include/mipp_object.hxx @@ -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 interleave ( ) const { return *this; } inline Regx2 deinterleave( ) const { return *this; } inline Regx2 conj ( ) const { return Regx2(val[0].r, -val[1].r); }