From 9a53d503a433b3ca0c4e312e9ebea5f1b344efed Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 8 Mar 2019 16:53:47 +0100 Subject: [PATCH] re PR target/68924 (No intrinsic for x86 `MOVQ m64, %xmm` in 32bit mode.) PR target/68924 PR target/78782 PR target/87558 * config/i386/emmintrin.h (_mm_loadu_si64): New intrinsic. (_mm_storeu_si64): Ditto. testsuite/ChangeLog: PR target/68924 PR target/78782 PR target/87558 * gcc.target/i386/pr78782.c: New test. * gcc.target/i386/pr87558.c: Ditto. From-SVN: r269497 --- gcc/ChangeLog | 8 ++++++++ gcc/config/i386/emmintrin.h | 12 ++++++++++++ gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.target/i386/pr78782.c | 9 +++++++++ gcc/testsuite/gcc.target/i386/pr87558.c | 9 +++++++++ 5 files changed, 46 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr78782.c create mode 100644 gcc/testsuite/gcc.target/i386/pr87558.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e737bd1842..9ecc07d0d28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-03-08 Uroš Bizjak + + PR target/68924 + PR target/78782 + PR target/87558 + * config/i386/emmintrin.h (_mm_loadu_si64): New intrinsic. + (_mm_storeu_si64): Ditto. + 2019-03-08 Martin Liska PR target/86952 diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h index d9bc3f7f28f..f9e7b33b0dd 100644 --- a/gcc/config/i386/emmintrin.h +++ b/gcc/config/i386/emmintrin.h @@ -709,6 +709,12 @@ _mm_loadl_epi64 (__m128i_u const *__P) return _mm_set_epi64 ((__m64)0LL, *(__m64_u *)__P); } +extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_loadu_si64 (void const *__P) +{ + return _mm_loadl_epi64 ((__m128i_u *)__P); +} + extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_store_si128 (__m128i *__P, __m128i __B) { @@ -727,6 +733,12 @@ _mm_storel_epi64 (__m128i_u *__P, __m128i __B) *(__m64_u *)__P = (__m64) ((__v2di)__B)[0]; } +extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +_mm_storeu_si64 (void *__P, __m128i __B) +{ + _mm_storel_epi64 ((__m128i_u *)__P, __B); +} + extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_movepi64_pi64 (__m128i __B) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b566c624aaa..a58b29dbfd2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2019-03-08 Uroš Bizjak + + PR target/68924 + PR target/78782 + PR target/87558 + * gcc.target/i386/pr78782.c: New test. + * gcc.target/i386/pr87558.c: Ditto. + 2019-03-08 Jakub Jelinek PR c/85870 diff --git a/gcc/testsuite/gcc.target/i386/pr78782.c b/gcc/testsuite/gcc.target/i386/pr78782.c new file mode 100644 index 00000000000..e91d953dba9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr78782.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +#include + +__m128i foo (unsigned char *p) +{ + return _mm_loadu_si64 ((void *)p); +} diff --git a/gcc/testsuite/gcc.target/i386/pr87558.c b/gcc/testsuite/gcc.target/i386/pr87558.c new file mode 100644 index 00000000000..c210507d04f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87558.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +#include + +void foo (unsigned char *p, __m128i x) +{ + _mm_storeu_si64 ((void *)p, x); +} -- 2.30.2