aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/mmintrin.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/rs6000/mmintrin.h')
-rw-r--r--gcc/config/rs6000/mmintrin.h72
1 files changed, 35 insertions, 37 deletions
diff --git a/gcc/config/rs6000/mmintrin.h b/gcc/config/rs6000/mmintrin.h
index 78b7cae4dcf..2f6bccaa7a3 100644
--- a/gcc/config/rs6000/mmintrin.h
+++ b/gcc/config/rs6000/mmintrin.h
@@ -112,7 +112,6 @@ _m_to_int (__m64 __i)
return _mm_cvtsi64_si32 (__i);
}
-#ifdef __powerpc64__
/* Convert I to a __m64 object. */
/* Intel intrinsic. */
@@ -173,9 +172,9 @@ _mm_packs_pi16 (__m64 __m1, __m64 __m2)
__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__))
@@ -193,9 +192,9 @@ _mm_packs_pi32 (__m64 __m1, __m64 __m2)
__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__))
@@ -213,9 +212,9 @@ _mm_packs_pu16 (__m64 __m1, __m64 __m2)
__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__))
@@ -236,7 +235,7 @@ _mm_unpackhi_pi8 (__m64 __m1, __m64 __m2)
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;
@@ -317,7 +316,7 @@ _mm_unpacklo_pi8 (__m64 __m1, __m64 __m2)
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;
@@ -398,7 +397,7 @@ _mm_add_pi8 (__m64 __m1, __m64 __m2)
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;
@@ -434,7 +433,7 @@ _mm_add_pi16 (__m64 __m1, __m64 __m2)
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;
@@ -466,7 +465,7 @@ _mm_add_pi32 (__m64 __m1, __m64 __m2)
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;
@@ -496,7 +495,7 @@ _mm_sub_pi8 (__m64 __m1, __m64 __m2)
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;
@@ -532,7 +531,7 @@ _mm_sub_pi16 (__m64 __m1, __m64 __m2)
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;
@@ -564,7 +563,7 @@ _mm_sub_pi32 (__m64 __m1, __m64 __m2)
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;
@@ -754,7 +753,7 @@ _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2)
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;
@@ -791,7 +790,7 @@ _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2)
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;
@@ -822,7 +821,7 @@ _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2)
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;
@@ -855,7 +854,7 @@ _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2)
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;
@@ -884,7 +883,7 @@ _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2)
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;
@@ -915,7 +914,7 @@ _mm_adds_pi8 (__m64 __m1, __m64 __m2)
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__))
@@ -933,7 +932,7 @@ _mm_adds_pi16 (__m64 __m1, __m64 __m2)
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__))
@@ -951,7 +950,7 @@ _mm_adds_pu8 (__m64 __m1, __m64 __m2)
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__))
@@ -970,7 +969,7 @@ _mm_adds_pu16 (__m64 __m1, __m64 __m2)
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__))
@@ -989,7 +988,7 @@ _mm_subs_pi8 (__m64 __m1, __m64 __m2)
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__))
@@ -1008,7 +1007,7 @@ _mm_subs_pi16 (__m64 __m1, __m64 __m2)
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__))
@@ -1027,7 +1026,7 @@ _mm_subs_pu8 (__m64 __m1, __m64 __m2)
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__))
@@ -1046,7 +1045,7 @@ _mm_subs_pu16 (__m64 __m1, __m64 __m2)
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__))
@@ -1068,7 +1067,7 @@ _mm_madd_pi16 (__m64 __m1, __m64 __m2)
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__))
@@ -1096,7 +1095,7 @@ _mm_mulhi_pi16 (__m64 __m1, __m64 __m2)
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__))
@@ -1115,7 +1114,7 @@ _mm_mullo_pi16 (__m64 __m1, __m64 __m2)
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__))
@@ -1136,7 +1135,7 @@ _mm_sll_pi16 (__m64 __m, __m64 __count)
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);
@@ -1205,7 +1204,7 @@ _mm_sra_pi16 (__m64 __m, __m64 __count)
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);
@@ -1274,7 +1273,7 @@ _mm_srl_pi16 (__m64 __m, __m64 __count)
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);
@@ -1417,7 +1416,7 @@ _mm_set1_pi16 (short __w)
__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;
@@ -1437,7 +1436,7 @@ _mm_set1_pi8 (signed char __b)
__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;
@@ -1452,5 +1451,4 @@ _mm_set1_pi8 (signed char __b)
return (res.as_m64);
#endif
}
-#endif /* __powerpc64__ */
#endif /* _MMINTRIN_H_INCLUDED */