Commit 6a56aad0 authored by Davis King's avatar Davis King

A minor change to avoid a compiler error when not using SSE instructions.

...@@ -83,10 +83,15 @@ namespace dlib ...@@ -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];} simd4f(const simd4i& val) { x[0]=val[0]; x[1]=val[1]; x[2]=val[2]; x[3]=val[3];}
// truncate to 32bit integers // truncate to 32bit integers
operator simd4i() const { return simd4i((int32)x[0], operator simd4i::rawarray() const
(int32)x[1], {
(int32)x[2], simd4i::rawarray temp;
(int32)x[3]); } 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) void load_aligned(const type* ptr)
{ {
......
...@@ -45,6 +45,7 @@ namespace dlib ...@@ -45,6 +45,7 @@ namespace dlib
__m128i x; __m128i x;
}; };
#else #else
class simd4i class simd4i
{ {
public: public:
...@@ -54,6 +55,12 @@ namespace dlib ...@@ -54,6 +55,12 @@ namespace dlib
simd4i(int32 f) { x[0]=f; x[1]=f; x[2]=f; x[3]=f; } 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;} 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) void load_aligned(const type* ptr)
{ {
x[0] = ptr[0]; x[0] = ptr[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment