From 6a56aad01a07aa72994536a7ab3721ea590d759d Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 10 Nov 2013 21:21:57 -0500 Subject: [PATCH] A minor change to avoid a compiler error when not using SSE instructions. --- dlib/simd/simd4f.h | 13 +++++++++---- dlib/simd/simd4i.h | 7 +++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dlib/simd/simd4f.h b/dlib/simd/simd4f.h index 7ed09e015..ae43c1dfb 100644 --- a/dlib/simd/simd4f.h +++ b/dlib/simd/simd4f.h @@ -83,10 +83,15 @@ namespace dlib simd4f(const simd4i& val) { x[0]=val[0]; x[1]=val[1]; x[2]=val[2]; x[3]=val[3];} // truncate to 32bit integers - operator simd4i() const { return simd4i((int32)x[0], - (int32)x[1], - (int32)x[2], - (int32)x[3]); } + operator simd4i::rawarray() const + { + simd4i::rawarray temp; + temp.a[0] = (int32)x[0]; + temp.a[1] = (int32)x[1]; + temp.a[2] = (int32)x[2]; + temp.a[3] = (int32)x[3]; + return temp; + } void load_aligned(const type* ptr) { diff --git a/dlib/simd/simd4i.h b/dlib/simd/simd4i.h index d32bc1c9a..d310697dd 100644 --- a/dlib/simd/simd4i.h +++ b/dlib/simd/simd4i.h @@ -45,6 +45,7 @@ namespace dlib __m128i x; }; #else + class simd4i { public: @@ -54,6 +55,12 @@ namespace dlib simd4i(int32 f) { x[0]=f; x[1]=f; x[2]=f; x[3]=f; } simd4i(int32 r0, int32 r1, int32 r2, int32 r3) { x[0]=r0; x[1]=r1; x[2]=r2; x[3]=r3;} + struct rawarray + { + int32 a[4]; + }; + simd4i(const rawarray& a) { x[0]=a.a[0]; x[1]=a.a[1]; x[2]=a.a[2]; x[3]=a.a[3]; } + void load_aligned(const type* ptr) { x[0] = ptr[0];