return _mm_cvtsi64_si32 (__i);
}
-#ifdef __powerpc64__
/* Convert I to a __m64 object. */
/* Intel intrinsic. */
__vector signed short vm1;
__vector signed char vresult;
- vm1 = (__vector signed short)__builtin_pack_vector_int128 (__m2, __m1);
+ vm1 = (__vector signed short) (__vector unsigned long long) { __m2, __m1 };
vresult = vec_vpkshss (vm1, vm1);
- return (__m64) __builtin_unpack_vector_int128 ((__vector __int128)vresult, 0);
+ return (__m64) ((vector long long) vresult)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__vector signed int vm1;
__vector signed short vresult;
- vm1 = (__vector signed int)__builtin_pack_vector_int128 (__m2, __m1);
+ vm1 = (__vector signed int) (__vector unsigned long long) { __m2, __m1 };
vresult = vec_vpkswss (vm1, vm1);
- return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)vresult, 0));
+ return (__m64) ((vector long long) vresult)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__vector signed short vm1;
__vector unsigned char vresult;
- vm1 = (__vector signed short)__builtin_pack_vector_int128 (__m2, __m1);
+ vm1 = (__vector signed short) (__vector unsigned long long) { __m2, __m1 };
vresult = vec_vpkshus (vm1, vm1);
- return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)vresult, 0));
+ return (__m64) ((vector long long) vresult)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned char)vec_splats (__m1);
b = (__vector unsigned char)vec_splats (__m2);
c = vec_mergel (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector unsigned char)vec_splats (__m1);
b = (__vector unsigned char)vec_splats (__m2);
c = vec_mergel (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 1));
+ return (__m64) ((vector long long) c)[1];
#else
__m64_union m1, m2, res;
a = (__vector signed char)vec_splats (__m1);
b = (__vector signed char)vec_splats (__m2);
c = vec_add (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = vec_add (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed int)vec_splats (__m1);
b = (__vector signed int)vec_splats (__m2);
c = vec_add (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed char)vec_splats (__m1);
b = (__vector signed char)vec_splats (__m2);
c = vec_sub (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = vec_sub (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed int)vec_splats (__m1);
b = (__vector signed int)vec_splats (__m2);
c = vec_sub (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed char)vec_splats (__m1);
b = (__vector signed char)vec_splats (__m2);
c = (__vector signed char)vec_cmpgt (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = (__vector signed short)vec_cmpeq (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = (__vector signed short)vec_cmpgt (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed int)vec_splats (__m1);
b = (__vector signed int)vec_splats (__m2);
c = (__vector signed int)vec_cmpeq (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed int)vec_splats (__m1);
b = (__vector signed int)vec_splats (__m2);
c = (__vector signed int)vec_cmpgt (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
#else
__m64_union m1, m2, res;
a = (__vector signed char)vec_splats (__m1);
b = (__vector signed char)vec_splats (__m2);
c = vec_adds (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = vec_adds (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned char)vec_splats (__m1);
b = (__vector unsigned char)vec_splats (__m2);
c = vec_adds (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned short)vec_splats (__m1);
b = (__vector unsigned short)vec_splats (__m2);
c = vec_adds (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector signed char)vec_splats (__m1);
b = (__vector signed char)vec_splats (__m2);
c = vec_subs (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = vec_subs (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned char)vec_splats (__m1);
b = (__vector unsigned char)vec_splats (__m2);
c = vec_subs (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned short)vec_splats (__m1);
b = (__vector unsigned short)vec_splats (__m2);
c = vec_subs (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = vec_vmsumshm (a, b, zero);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
w1 = vec_vmulosh (a, b);
c = (__vector signed short)vec_perm (w0, w1, xform1);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector signed short)vec_splats (__m1);
b = (__vector signed short)vec_splats (__m2);
c = a * b;
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
m = (__vector signed short)vec_splats (__m);
c = (__vector unsigned short)vec_splats ((unsigned short)__count);
r = vec_sl (m, (__vector unsigned short)c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
}
else
return (0);
m = (__vector signed short)vec_splats (__m);
c = (__vector unsigned short)vec_splats ((unsigned short)__count);
r = vec_sra (m, (__vector unsigned short)c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
}
else
return (0);
m = (__vector unsigned short)vec_splats (__m);
c = (__vector unsigned short)vec_splats ((unsigned short)__count);
r = vec_sr (m, (__vector unsigned short)c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
}
else
return (0);
__vector signed short w;
w = (__vector signed short)vec_splats (__w);
- return (__builtin_unpack_vector_int128 ((__vector __int128)w, 0));
+ return (__m64) ((vector long long) w)[0];
#else
__m64_union res;
__vector signed char b;
b = (__vector signed char)vec_splats (__b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)b, 0));
+ return (__m64) ((vector long long) b)[0];
#else
__m64_union res;
return (res.as_m64);
#endif
}
-#endif /* __powerpc64__ */
#endif /* _MMINTRIN_H_INCLUDED */
rounded = vec_rint(temp);
result = (__vector unsigned long long) vec_cts (rounded, 0);
- return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0));
+ return (__m64) ((vector long long) result)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
temp = (__v4sf) vec_splat ((__vector long long)__A, 0);
result = (__vector unsigned long long) vec_cts (temp, 0);
- return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0));
+ return (__m64) ((vector long long) result)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
__vector signed int vm1;
__vector float vf1;
- vm1 = (__vector signed int) __builtin_pack_vector_int128 (__B, __B);
+ vm1 = (__vector signed int) (__vector unsigned long long) {__B, __B};
vf1 = (__vector float) vec_ctf (vm1, 0);
return ((__m128) (__vector unsigned long long)
__vector signed int vi4;
__vector float vf1;
- vs8 = (__vector signed short) __builtin_pack_vector_int128 (__A, __A);
+ vs8 = (__vector signed short) (__vector unsigned long long) { __A, __A };
vi4 = vec_vupklsh (vs8);
vf1 = (__vector float) vec_ctf (vi4, 0);
__vector unsigned int vi4;
__vector float vf1;
- vs8 = (__vector unsigned short) __builtin_pack_vector_int128 (__A, __A);
+ vs8 = (__vector unsigned short) (__vector unsigned long long) { __A, __A };
vi4 = (__vector unsigned int) vec_vmrglh (vs8, zero);
vf1 = (__vector float) vec_ctf (vi4, 0);
__vector signed int vi4;
__vector float vf1;
- vc16 = (__vector signed char) __builtin_pack_vector_int128 (__A, __A);
+ vc16 = (__vector signed char) (__vector unsigned long long) { __A, __A };
vs8 = vec_vupkhsb (vc16);
vi4 = vec_vupkhsh (vs8);
vf1 = (__vector float) vec_ctf (vi4, 0);
__vector unsigned int vi4;
__vector float vf1;
- vc16 = (__vector unsigned char) __builtin_pack_vector_int128 (__A, __A);
+ vc16 = (__vector unsigned char) (__vector unsigned long long) { __A, __A };
vs8 = (__vector unsigned short) vec_vmrglb (vc16, zero);
vi4 = (__vector unsigned int) vec_vmrghh (vs8,
(__vector unsigned short) zero);
__vector signed int vi4;
__vector float vf4;
- vi4 = (__vector signed int) __builtin_pack_vector_int128 (__B, __A);
+ vi4 = (__vector signed int) (__vector unsigned long long) { __B, __A };
vf4 = (__vector float) vec_ctf (vi4, 0);
return (__m128) vf4;
}
temp = vec_cts (rounded, 0);
result = (__vector unsigned long long) vec_pack (temp, temp);
- return ((__m64) __builtin_unpack_vector_int128 ((__vector __int128)result, 0));
+ return (__m64) ((vector long long) result)[0];
}
/* Convert the four SPFP values in A to four signed 8-bit integers. */
static const __vector signed int zero = {0, 0, 0, 0};
__vector signed short tmp_s;
__vector signed char res_v;
- __m64 result;
rounded = vec_rint(__A);
tmp_i = vec_cts (rounded, 0);
tmp_s = vec_pack (tmp_i, zero);
res_v = vec_pack (tmp_s, tmp_s);
- result = (__m64) __builtin_unpack_vector_int128 ((__vector __int128)res_v, 0);
-
- return (result);
+ return (__m64) ((vector long long) res_v)[0];
}
/* Selects four specific SPFP values from A and B based on MASK. */
b = (__vector signed short)vec_splats (__B);
c = (__vector __bool short)vec_cmpgt (a, b);
r = vec_sel (b, a, c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
#else
__m64_union m1, m2, res;
b = (__vector unsigned char)vec_splats (__B);
c = (__vector __bool char)vec_cmpgt (a, b);
r = vec_sel (b, a, c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
#else
__m64_union m1, m2, res;
long i;
b = (__vector signed short)vec_splats (__B);
c = (__vector __bool short)vec_cmplt (a, b);
r = vec_sel (b, a, c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
#else
__m64_union m1, m2, res;
b = (__vector unsigned char)vec_splats (__B);
c = (__vector __bool char)vec_cmplt (a, b);
r = vec_sel (b, a, c);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
#else
__m64_union m1, m2, res;
long i;
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_movemask_pi8 (__m64 __A)
{
- unsigned long p = 0x0008101820283038UL; // permute control for sign bits
+ unsigned long long p = 0x0008101820283038UL; // permute control for sign bits
return __builtin_bpermd (p, __A);
}
w1 = vec_vmulouh (a, b);
c = (__vector unsigned short)vec_perm (w0, w1, xform1);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
p = vec_splats (t.as_m64);
a = vec_splats (__A);
r = vec_perm (a, a, (__vector unsigned char)p);
- return (__builtin_unpack_vector_int128 ((__vector __int128)r, 0));
+ return (__m64) ((vector long long) r)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned char)vec_splats (__A);
b = (__vector unsigned char)vec_splats (__B);
c = vec_avg (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
a = (__vector unsigned short)vec_splats (__A);
b = (__vector unsigned short)vec_splats (__B);
c = vec_avg (a, b);
- return (__builtin_unpack_vector_int128 ((__vector __int128)c, 0));
+ return (__m64) ((vector long long) c)[0];
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
{ 0, 0, 0, 0 };
unsigned short result;
- a = (__vector unsigned char) __builtin_pack_vector_int128 (0UL, __A);
- b = (__vector unsigned char) __builtin_pack_vector_int128 (0UL, __B);
+ a = (__vector unsigned char) (__vector unsigned long long) { 0UL, __A };
+ b = (__vector unsigned char) (__vector unsigned long long) { 0UL, __B };
vmin = vec_min (a, b);
vmax = vec_max (a, b);
vabsdiff = vec_sub (vmax, vmin);