+2018-07-13 Bill Schmidt <wschmidt@linux.ibm.com>
+ Steve Munroe <munroesj52@gmail.com>
+
+ * config/rs6000/emmintrin.h (_mm_and_si128): New function.
+ (_mm_andnot_si128): Likewise.
+ (_mm_or_si128): Likewise.
+ (_mm_xor_si128): Likewise.
+
2018-07-13 Qing Zhao <qing.zhao@oracle.com>
PR middle-end/78809
return (vec_xor ((__v2df) __A, (__v2df) __B));
}
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_and_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)vec_and ((__v2di) __A, (__v2di) __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_andnot_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)vec_andc ((__v2di) __B, (__v2di) __A);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_or_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)vec_or ((__v2di) __A, (__v2di) __B);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_xor_si128 (__m128i __A, __m128i __B)
+{
+ return (__m128i)vec_xor ((__v2di) __A, (__v2di) __B);
+}
+
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_cmpeq_epi8 (__m128i __A, __m128i __B)
{
}
#endif /* EMMINTRIN_H_ */
+
+2018-07-13 Bill Schmidt <wschmidt@linux.ibm.com>
+ Steve Munroe <munroesj52@gmail.com>
+
+ * gcc.target/powerpc/sse2-pand-1.c: New file.
+ * gcc.target/powerpc/sse2-pandn-1.c: Likewise.
+ * gcc.target/powerpc/sse2-por-1.c: Likewise.
+ * gcc.target/powerpc/sse2-pxor-1.c: Likewise.
+
2018-07-13 Nathan Sidwell <nathan@acm.org>
PR c++/86374
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target p8vector_hw } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse2-check.h"
+#endif
+
+#include CHECK_H
+
+#ifndef TEST
+#define TEST sse2_test_pand_1
+#endif
+
+#include <emmintrin.h>
+
+static __m128i
+__attribute__((noinline, unused))
+test (__m128i s1, __m128i s2)
+{
+ return _mm_and_si128 (s1, s2);
+}
+
+static void
+TEST (void)
+{
+ union128i_b u, s1, s2;
+ char e[16];
+ int i;
+
+ s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7);
+ s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119);
+ u.x = test (s1.x, s2.x);
+
+ for (i = 0; i < 16; i++)
+ e[i] = s1.a[i] & s2.a[i];
+
+ if (check_union128i_b (u, e))
+ abort ();
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target p8vector_hw } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse2-check.h"
+#endif
+
+#include CHECK_H
+
+#ifndef TEST
+#define TEST sse2_test_pandn_1
+#endif
+
+#include <emmintrin.h>
+
+static __m128i
+__attribute__((noinline, unused))
+test (__m128i s1, __m128i s2)
+{
+ return _mm_andnot_si128 (s1, s2);
+}
+
+static void
+TEST (void)
+{
+ union128i_b u, s1, s2;
+ char e[16];
+ int i;
+
+ s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,-80,-40,-100,-15,98, 25, 98,7);
+ s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, -100, -34, -78, -39, 6, 3, 4, 5, 119);
+ u.x = test (s1.x, s2.x);
+
+ for (i = 0; i < 16; i++)
+ e[i] = (~s1.a[i]) & s2.a[i];
+
+ if (check_union128i_b (u, e))
+ abort ();
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target p8vector_hw } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse2-check.h"
+#endif
+
+#include CHECK_H
+
+#ifndef TEST
+#define TEST sse2_test_por_1
+#endif
+
+#include <emmintrin.h>
+
+static __m128i
+__attribute__((noinline, unused))
+test (__m128i s1, __m128i s2)
+{
+ return _mm_or_si128 (s1, s2);
+}
+
+static void
+TEST (void)
+{
+ union128i_w u, s1, s2;
+ short e[8];
+ int i;
+
+ s1.x = _mm_set_epi16 (10,20,30,90,-80,-40,-100,-15);
+ s2.x = _mm_set_epi16 (11, 98, 76, -100, -34, -78, -39, 14);
+ u.x = test (s1.x, s2.x);
+
+ for (i = 0; i < 8; i++)
+ {
+ e[i] = s1.a[i] | s2.a[i];
+ }
+
+ if (check_union128i_w (u, e))
+ abort ();
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O3 -mpower8-vector -Wno-psabi" } */
+/* { dg-require-effective-target lp64 } */
+/* { dg-require-effective-target p8vector_hw } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse2-check.h"
+#endif
+
+#include CHECK_H
+
+#ifndef TEST
+#define TEST sse2_test_pxor_1
+#endif
+
+#include <emmintrin.h>
+
+static __m128i
+__attribute__((noinline, unused))
+test (__m128i s1, __m128i s2)
+{
+ return _mm_xor_si128 (s1, s2);
+}
+
+static void
+TEST (void)
+{
+ union128i_ub u, s1, s2;
+ unsigned char e[16] = {0};
+ int i;
+
+ s1.x = _mm_set_epi8 (1,2,3,4,10,20,30,90,80,40,100,15,98, 25, 98,7);
+ s2.x = _mm_set_epi8 (88, 44, 33, 22, 11, 98, 76, 100, 34, 78, 39, 6, 3, 4, 5, 119);
+ u.x = test (s1.x, s2.x);
+
+ for (i = 0; i < 16; i++)
+ e[i] = s1.a[i] ^ s2.a[i];
+
+ if (check_union128i_ub (u, e))
+ abort ();
+}