re PR target/79481 (AVX512PF: unmasked gather prefetch intrinsics missing)

PR target/79481
	* config/i386/avx512pfintrin.h (_mm512_prefetch_i32gather_pd,
	_mm512_prefetch_i32gather_ps, _mm512_prefetch_i64gather_pd,
	_mm512_prefetch_i64gather_ps): New inline functions and macros.

	* gcc.target/i386/sse-14.c (test_2vx): Add void return type.
	(test_3vx): Change return type from int to void. 
	(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
	_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
	_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
	_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
	tests.
	* gcc.target/i386/sse-22.c (test_2vx): Add void return type.
	(test_3vx): Change return type from int to void.
	(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
	_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
	_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
	_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
	tests.
	* gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: Add non-masked
	intrinsic.  Change scan-assembler-times number from 1 to 2.
	* gcc.target/i386/avx512pf-vgatherpf0dps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf0qps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1dps-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Likewise.
	* gcc.target/i386/avx512pf-vgatherpf1qps-1.c: Likewise.

From-SVN: r245444
This commit is contained in:
Jakub Jelinek 2017-02-14 20:39:17 +01:00 committed by Jakub Jelinek
parent 8668fae0b7
commit 63d0903380
13 changed files with 122 additions and 13 deletions

View File

@ -1,3 +1,10 @@
2017-02-14 Jakub Jelinek <jakub@redhat.com>
PR target/79481
* config/i386/avx512pfintrin.h (_mm512_prefetch_i32gather_pd,
_mm512_prefetch_i32gather_ps, _mm512_prefetch_i64gather_pd,
_mm512_prefetch_i64gather_ps): New inline functions and macros.
2017-02-14 Uros Bizjak <ubizjak@gmail.com>
PR target/79495

View File

@ -46,6 +46,24 @@ typedef unsigned char __mmask8;
typedef unsigned short __mmask16;
#ifdef __OPTIMIZE__
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i32gather_pd (__m256i __index, void const *__addr,
int __scale, int __hint)
{
__builtin_ia32_gatherpfdpd ((__mmask8) 0xFF, (__v8si) __index, __addr,
__scale, __hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i32gather_ps (__m512i __index, void const *__addr,
int __scale, int __hint)
{
__builtin_ia32_gatherpfdps ((__mmask16) 0xFFFF, (__v16si) __index, __addr,
__scale, __hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i32gather_pd (__m256i __index, __mmask8 __mask,
@ -64,6 +82,24 @@ _mm512_mask_prefetch_i32gather_ps (__m512i __index, __mmask16 __mask,
__hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i64gather_pd (__m512i __index, void const *__addr,
int __scale, int __hint)
{
__builtin_ia32_gatherpfqpd ((__mmask8) 0xFF, (__v8di) __index, __addr,
__scale, __hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_prefetch_i64gather_ps (__m512i __index, void const *__addr,
int __scale, int __hint)
{
__builtin_ia32_gatherpfqps ((__mmask8) 0xFF, (__v8di) __index, __addr,
__scale, __hint);
}
extern __inline void
__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
_mm512_mask_prefetch_i64gather_pd (__m512i __index, __mmask8 __mask,
@ -155,6 +191,14 @@ _mm512_mask_prefetch_i64scatter_ps (void *__addr, __mmask16 __mask,
}
#else
#define _mm512_prefetch_i32gather_pd(INDEX, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfdpd ((__mmask8)0xFF, (__v8si)(__m256i)INDEX, \
(void const *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i32gather_ps(INDEX, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i)INDEX, \
(void const *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i32gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \
(void const *)ADDR, (int)SCALE, (int)HINT)
@ -163,6 +207,14 @@ _mm512_mask_prefetch_i64scatter_ps (void *__addr, __mmask16 __mask,
__builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
(void const *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i64gather_pd(INDEX, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfqpd ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
(void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_prefetch_i64gather_ps(INDEX, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfqps ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
(void *)ADDR, (int)SCALE, (int)HINT)
#define _mm512_mask_prefetch_i64gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
__builtin_ia32_gatherpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
(void *)ADDR, (int)SCALE, (int)HINT)

View File

@ -1,3 +1,30 @@
2017-02-14 Jakub Jelinek <jakub@redhat.com>
PR target/79481
* gcc.target/i386/sse-14.c (test_2vx): Add void return type.
(test_3vx): Change return type from int to void.
(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
tests.
* gcc.target/i386/sse-22.c (test_2vx): Add void return type.
(test_3vx): Change return type from int to void.
(_mm512_prefetch_i32gather_ps, _mm512_prefetch_i32scatter_ps,
_mm512_prefetch_i64gather_ps, _mm512_prefetch_i64scatter_ps,
_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32scatter_pd,
_mm512_prefetch_i64gather_pd, _mm512_prefetch_i64scatter_pd): New
tests.
* gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: Add non-masked
intrinsic. Change scan-assembler-times number from 1 to 2.
* gcc.target/i386/avx512pf-vgatherpf0dps-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf0qps-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf1dps-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Likewise.
* gcc.target/i386/avx512pf-vgatherpf1qps-1.c: Likewise.
2017-02-14 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/61225

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf0dpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf0dpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ void *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i32gather_pd (idx, base, 8, _MM_HINT_T0);
_mm512_mask_prefetch_i32gather_pd (idx, m8, base, 8, _MM_HINT_T0);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf0dps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf0dps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i32gather_ps (idx, base, 8, _MM_HINT_T0);
_mm512_mask_prefetch_i32gather_ps (idx, m16, base, 8, _MM_HINT_T0);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf0qpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf0qpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i64gather_pd (idx, base, 8, _MM_HINT_T0);
_mm512_mask_prefetch_i64gather_pd (idx, m8, base, 8, _MM_HINT_T0);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf0qps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf0qps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i64gather_ps (idx, base, 8, _MM_HINT_T0);
_mm512_mask_prefetch_i64gather_ps (idx, m8, base, 8, _MM_HINT_T0);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf1dpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf1dpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i32gather_pd (idx, base, 8, _MM_HINT_T1);
_mm512_mask_prefetch_i32gather_pd (idx, m8, base, 8, _MM_HINT_T1);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf1dps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf1dps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i32gather_ps (idx, base, 8, _MM_HINT_T1);
_mm512_mask_prefetch_i32gather_ps (idx, m16, base, 8, _MM_HINT_T1);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf1qpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf1qpd\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i64gather_pd (idx, base, 8, _MM_HINT_T1);
_mm512_mask_prefetch_i64gather_pd (idx, m8, base, 8, _MM_HINT_T1);
}

View File

@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-mavx512pf -O2" } */
/* { dg-final { scan-assembler-times "vgatherpf1qps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */
/* { dg-final { scan-assembler-times "vgatherpf1qps\[ \\t\]+\[^\{\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 2 } } */
#include <immintrin.h>
@ -11,5 +11,6 @@ int *base;
void extern
avx512pf_test (void)
{
_mm512_prefetch_i64gather_ps (idx, base, 8, _MM_HINT_T1);
_mm512_mask_prefetch_i64gather_ps (idx, m8, base, 8, _MM_HINT_T1);
}

View File

@ -50,7 +50,7 @@
{ return func (A, B, imm1, imm2, imm3); }
#define test_2vx(func, op1_type, op2_type, imm1, imm2) \
_CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \
void _CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \
{ func (A, B, imm1, imm2); }
#define test_3(func, type, op1_type, op2_type, op3_type, imm) \
@ -74,7 +74,7 @@
{ func (A, B, C, imm); }
#define test_3vx(func, op1_type, op2_type, op3_type, imm1, imm2) \
int _CONCAT(_,func) (op1_type A, op2_type B, \
void _CONCAT(_,func) (op1_type A, op2_type B, \
op3_type C, int const I, int const L) \
{ func (A, B, C, imm1, imm2); }
@ -520,6 +520,14 @@ test_4x (_mm_maskz_fixupimm_round_sd, __m128d, __mmask8, __m128d, __m128d, __m12
test_4x (_mm_maskz_fixupimm_round_ss, __m128, __mmask8, __m128, __m128, __m128i, 1, 8)
/* avx512pfintrin.h */
test_2vx (_mm512_prefetch_i32gather_ps, __m512i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32scatter_ps, void const *, __m512i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64gather_ps, __m512i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64scatter_ps, void const *, __m512i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32gather_pd, __m256i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32scatter_pd, void const *, __m256i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64gather_pd, __m512i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64scatter_pd, void const *, __m512i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32gather_ps, __m512i, __mmask16, void const *, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32scatter_ps, void const *, __mmask16, __m512i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i64gather_ps, __m512i, __mmask8, void const *, 1, _MM_HINT_T0)

View File

@ -50,7 +50,7 @@
{ return func (A, B, imm1, imm2, imm3); }
#define test_2vx(func, op1_type, op2_type, imm1, imm2) \
_CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \
void _CONCAT(_,func) (op1_type A, op2_type B, int const I, int const L) \
{ func (A, B, imm1, imm2); }
#define test_3(func, type, op1_type, op2_type, op3_type, imm) \
@ -74,7 +74,7 @@
{ func (A, B, C, imm); }
#define test_3vx(func, op1_type, op2_type, op3_type, imm1, imm2) \
int _CONCAT(_,func) (op1_type A, op2_type B, \
void _CONCAT(_,func) (op1_type A, op2_type B, \
op3_type C, int const I, int const L) \
{ func (A, B, C, imm1, imm2); }
@ -647,11 +647,18 @@ test_4x (_mm_maskz_fixupimm_round_sd, __m128d, __mmask8, __m128d, __m128d, __m12
test_4x (_mm_maskz_fixupimm_round_ss, __m128, __mmask8, __m128, __m128, __m128i, 1, 8)
/* avx512pfintrin.h */
test_2vx (_mm512_prefetch_i32gather_ps, __m512i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32scatter_ps, void const *, __m512i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64gather_ps, __m512i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64scatter_ps, void const *, __m512i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32gather_pd, __m256i, void const *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i32scatter_pd, void const *, __m256i, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64gather_pd, __m512i, long long *, 1, _MM_HINT_T0)
test_2vx (_mm512_prefetch_i64scatter_pd, void const *, __m512i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32gather_ps, __m512i, __mmask16, void const *, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32scatter_ps, void const *, __mmask16, __m512i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i64gather_ps, __m512i, __mmask8, void const *, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i64scatter_ps, void const *, __mmask8, __m512i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32gather_pd, __m256i, __mmask8, void const *, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i32scatter_pd, void const *, __mmask8, __m256i, 1, _MM_HINT_T0)
test_3vx (_mm512_mask_prefetch_i64gather_pd, __m512i, __mmask8, long long *, 1, _MM_HINT_T0)