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

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

parent a29472ab
......@@ -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)
{
......
......@@ -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];
......
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