From 0daf3bbef932e51d4d4b3ca46504c81337a87e52 Mon Sep 17 00:00:00 2001 From: kyukhin Date: Mon, 27 Jan 2014 19:21:02 +0000 Subject: [PATCH] gcc/ * config/i386/avx512pfintrin.h (_mm512_mask_prefetch_i32gather_pd): New. (_mm512_mask_prefetch_i64gather_pd): Ditto. (_mm512_prefetch_i32scatter_pd): Ditto. (_mm512_mask_prefetch_i32scatter_pd): Ditto. (_mm512_prefetch_i64scatter_pd): Ditto. (_mm512_mask_prefetch_i64scatter_pd): Ditto. (_mm512_mask_prefetch_i32gather_ps): Fix operand type. (_mm512_mask_prefetch_i64gather_ps): Ditto. (_mm512_prefetch_i32scatter_ps): Ditto. (_mm512_mask_prefetch_i32scatter_ps): Ditto. (_mm512_prefetch_i64scatter_ps): Ditto. (_mm512_mask_prefetch_i64scatter_ps): Ditto. * config/i386/i386-builtin-types.def: Define VOID_FTYPE_QI_V8SI_PCINT64_INT_INT and VOID_FTYPE_QI_V8DI_PCINT64_INT_INT. * config/i386/i386.c (ix86_builtins): Define IX86_BUILTIN_GATHERPFQPD, IX86_BUILTIN_GATHERPFDPD, IX86_BUILTIN_SCATTERPFDPD, IX86_BUILTIN_SCATTERPFQPD. (ix86_init_mmx_sse_builtins): Define __builtin_ia32_gatherpfdpd, __builtin_ia32_gatherpfdps, __builtin_ia32_gatherpfqpd, __builtin_ia32_gatherpfqps, __builtin_ia32_scatterpfdpd, __builtin_ia32_scatterpfdps, __builtin_ia32_scatterpfqpd, __builtin_ia32_scatterpfqps. (ix86_expand_builtin): Expand new built-ins. * config/i386/sse.md (avx512pf_gatherpf): Add SF suffix, fix memory access data type. (*avx512pf_gatherpf_mask): Ditto. (*avx512pf_gatherpf): Ditto. (avx512pf_scatterpf): Ditto. (*avx512pf_scatterpf_mask): Ditto. (*avx512pf_scatterpf): Ditto. (GATHER_SCATTER_SF_MEM_MODE): New. (avx512pf_gatherpfdf): Ditto. (*avx512pf_gatherpfdf_mask): Ditto. (*avx512pf_scatterpfdf): Ditto. testsuite/ * gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: New. * gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Ditto. * gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Ditto. * gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Ditto. * gcc.target/i386/avx512pf-vscatterpf0dpd-1.c: Ditto. * gcc.target/i386/avx512pf-vscatterpf0qpd-1.c: Ditto. * gcc.target/i386/avx512pf-vscatterpf1dpd-1.c: Ditto. * gcc.target/i386/avx512pf-vscatterpf1qpd-1.c: Ditto. * gcc.target/i386/sse-14.c: Add new built-ins, fix AVX-512ER built-ins roudning immediate. * gcc.target/i386/sse-22.c: Add new built-ins. * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/avx-1.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207149 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 37 +++++ gcc/config/i386/avx512pfintrin.h | 113 +++++++++++-- gcc/config/i386/i386-builtin-types.def | 2 + gcc/config/i386/i386.c | 37 ++++- gcc/config/i386/sse.md | 174 +++++++++++++++++++-- gcc/testsuite/ChangeLog | 16 ++ gcc/testsuite/gcc.target/i386/avx-1.c | 4 + .../gcc.target/i386/avx512pf-vgatherpf0dpd-1.c | 15 ++ .../gcc.target/i386/avx512pf-vgatherpf0qpd-1.c | 15 ++ .../gcc.target/i386/avx512pf-vgatherpf1dpd-1.c | 15 ++ .../gcc.target/i386/avx512pf-vgatherpf1qpd-1.c | 15 ++ .../gcc.target/i386/avx512pf-vscatterpf0dpd-1.c | 17 ++ .../gcc.target/i386/avx512pf-vscatterpf0qpd-1.c | 17 ++ .../gcc.target/i386/avx512pf-vscatterpf1dpd-1.c | 17 ++ .../gcc.target/i386/avx512pf-vscatterpf1qpd-1.c | 17 ++ gcc/testsuite/gcc.target/i386/sse-14.c | 4 + gcc/testsuite/gcc.target/i386/sse-22.c | 5 + gcc/testsuite/gcc.target/i386/sse-23.c | 4 + 18 files changed, 493 insertions(+), 31 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0dpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0qpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1dpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1qpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0dpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0qpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1dpd-1.c create mode 100644 gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1qpd-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95a324cebca..da99a66b0fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,40 @@ +2014-01-27 Kirill Yukhin + + * config/i386/avx512pfintrin.h (_mm512_mask_prefetch_i32gather_pd): New. + (_mm512_mask_prefetch_i64gather_pd): Ditto. + (_mm512_prefetch_i32scatter_pd): Ditto. + (_mm512_mask_prefetch_i32scatter_pd): Ditto. + (_mm512_prefetch_i64scatter_pd): Ditto. + (_mm512_mask_prefetch_i64scatter_pd): Ditto. + (_mm512_mask_prefetch_i32gather_ps): Fix operand type. + (_mm512_mask_prefetch_i64gather_ps): Ditto. + (_mm512_prefetch_i32scatter_ps): Ditto. + (_mm512_mask_prefetch_i32scatter_ps): Ditto. + (_mm512_prefetch_i64scatter_ps): Ditto. + (_mm512_mask_prefetch_i64scatter_ps): Ditto. + * config/i386/i386-builtin-types.def: Define + VOID_FTYPE_QI_V8SI_PCINT64_INT_INT and VOID_FTYPE_QI_V8DI_PCINT64_INT_INT. + * config/i386/i386.c (ix86_builtins): Define IX86_BUILTIN_GATHERPFQPD, + IX86_BUILTIN_GATHERPFDPD, IX86_BUILTIN_SCATTERPFDPD, + IX86_BUILTIN_SCATTERPFQPD. + (ix86_init_mmx_sse_builtins): Define __builtin_ia32_gatherpfdpd, + __builtin_ia32_gatherpfdps, __builtin_ia32_gatherpfqpd, + __builtin_ia32_gatherpfqps, __builtin_ia32_scatterpfdpd, + __builtin_ia32_scatterpfdps, __builtin_ia32_scatterpfqpd, + __builtin_ia32_scatterpfqps. + (ix86_expand_builtin): Expand new built-ins. + * config/i386/sse.md (avx512pf_gatherpf): Add SF suffix, + fix memory access data type. + (*avx512pf_gatherpf_mask): Ditto. + (*avx512pf_gatherpf): Ditto. + (avx512pf_scatterpf): Ditto. + (*avx512pf_scatterpf_mask): Ditto. + (*avx512pf_scatterpf): Ditto. + (GATHER_SCATTER_SF_MEM_MODE): New. + (avx512pf_gatherpfdf): Ditto. + (*avx512pf_gatherpfdf_mask): Ditto. + (*avx512pf_scatterpfdf): Ditto. + 2014-01-27 Jakub Jelinek PR bootstrap/59934 diff --git a/gcc/config/i386/avx512pfintrin.h b/gcc/config/i386/avx512pfintrin.h index b8c011032c6..bc7598e7ae1 100644 --- a/gcc/config/i386/avx512pfintrin.h +++ b/gcc/config/i386/avx512pfintrin.h @@ -48,74 +48,157 @@ typedef unsigned short __mmask16; #ifdef __OPTIMIZE__ extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_prefetch_i32gather_pd (__m256i index, __mmask8 mask, + void *addr, int scale, int hint) +{ + __builtin_ia32_gatherpfdpd (mask, (__v8si) index, (long long const *) addr, + scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i32gather_ps (__m512i index, __mmask16 mask, - int const *addr, int scale, int hint) + void *addr, int scale, int hint) +{ + __builtin_ia32_gatherpfdps (mask, (__v16si) index, (int const *) addr, + scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_prefetch_i64gather_pd (__m512i index, __mmask8 mask, + void *addr, int scale, int hint) { - __builtin_ia32_gatherpfdps (mask, (__v16si) index, addr, scale, hint); + __builtin_ia32_gatherpfqpd (mask, (__v8di) index, (long long const *) addr, + scale, hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) _mm512_mask_prefetch_i64gather_ps (__m512i index, __mmask8 mask, - int const *addr, int scale, int hint) + void *addr, int scale, int hint) { - __builtin_ia32_gatherpfqps (mask, (__v8di) index, addr, scale, hint); + __builtin_ia32_gatherpfqps (mask, (__v8di) index, (int const *) addr, + scale, hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_prefetch_i32scatter_ps (int const *addr, __m512i index, int scale, +_mm512_prefetch_i32scatter_pd (void *addr, __m256i index, int scale, int hint) { - __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, addr, scale, - hint); + __builtin_ia32_scatterpfdpd ((__mmask8) 0xFF, (__v8si) index, + (long long const *)addr, scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_prefetch_i32scatter_ps (void *addr, __m512i index, int scale, + int hint) +{ + __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, (int const *) addr, + scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_prefetch_i32scatter_pd (void *addr, __mmask8 mask, + __m256i index, int scale, int hint) +{ + __builtin_ia32_scatterpfdpd (mask, (__v8si) index, (long long const *) addr, + scale, hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_prefetch_i32scatter_ps (int const *addr, __mmask16 mask, +_mm512_mask_prefetch_i32scatter_ps (void *addr, __mmask16 mask, __m512i index, int scale, int hint) { - __builtin_ia32_scatterpfdps (mask, (__v16si) index, addr, scale, hint); + __builtin_ia32_scatterpfdps (mask, (__v16si) index, (int const *) addr, + scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_prefetch_i64scatter_pd (void *addr, __m512i index, int scale, + int hint) +{ + __builtin_ia32_scatterpfqpd ((__mmask8) 0xFF, (__v8di) index, (long long const *) addr, + scale, hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_prefetch_i64scatter_ps (int const *addr, __m512i index, int scale, +_mm512_prefetch_i64scatter_ps (void *addr, __m512i index, int scale, int hint) { - __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, addr, scale, - hint); + __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, (int const *) addr, + scale, hint); +} + +extern __inline void +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_prefetch_i64scatter_pd (void *addr, __mmask16 mask, + __m512i index, int scale, int hint) +{ + __builtin_ia32_scatterpfqpd (mask, (__v8di) index, (long long const *) addr, + scale, hint); } extern __inline void __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_prefetch_i64scatter_ps (int const *addr, __mmask16 mask, +_mm512_mask_prefetch_i64scatter_ps (void *addr, __mmask16 mask, __m512i index, int scale, int hint) { - __builtin_ia32_scatterpfqps (mask, (__v8di) index, addr, scale, hint); + __builtin_ia32_scatterpfqps (mask, (__v8di) index, (int const *) addr, + scale, hint); } + #else +#define _mm512_mask_prefetch_i32gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \ + __builtin_ia32_gatherpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_mask_prefetch_i32gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \ - __builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \ + __builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) +#define _mm512_mask_prefetch_i64gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \ + __builtin_ia32_gatherpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_mask_prefetch_i64gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \ __builtin_ia32_gatherpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) +#define _mm512_prefetch_i32scatter_pd(ADDR, INDEX, SCALE, HINT) \ + __builtin_ia32_scatterpfdpd ((__mmask8)0xFF, (__v8si)(__m256i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_prefetch_i32scatter_ps(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) +#define _mm512_mask_prefetch_i32scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \ + __builtin_ia32_scatterpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_mask_prefetch_i32scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) +#define _mm512_prefetch_i64scatter_pd(ADDR, INDEX, SCALE, HINT) \ + __builtin_ia32_scatterpfqpd ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_prefetch_i64scatter_ps(ADDR, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqps ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) +#define _mm512_mask_prefetch_i64scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \ + __builtin_ia32_scatterpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \ + (long long const *)ADDR, (int)SCALE, (int)HINT) + #define _mm512_mask_prefetch_i64scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \ __builtin_ia32_scatterpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \ (int const *)ADDR, (int)SCALE, (int)HINT) diff --git a/gcc/config/i386/i386-builtin-types.def b/gcc/config/i386/i386-builtin-types.def index acf2f32d9e0..f3c658b61c0 100644 --- a/gcc/config/i386/i386-builtin-types.def +++ b/gcc/config/i386/i386-builtin-types.def @@ -733,7 +733,9 @@ DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V8SI, V8DI, INT) DEF_FUNCTION_TYPE (VOID, PINT, QI, V8DI, V8SI, INT) DEF_FUNCTION_TYPE (VOID, PLONGLONG, QI, V8DI, V8DI, INT) +DEF_FUNCTION_TYPE (VOID, QI, V8SI, PCINT64, INT, INT) DEF_FUNCTION_TYPE (VOID, HI, V16SI, PCINT, INT, INT) +DEF_FUNCTION_TYPE (VOID, QI, V8DI, PCINT64, INT, INT) DEF_FUNCTION_TYPE (VOID, QI, V8DI, PCINT, INT, INT) DEF_FUNCTION_TYPE_ALIAS (V2DF_FTYPE_V2DF, ROUND) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index cf7948616f7..a390b19ebdd 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -28406,9 +28406,13 @@ enum ix86_builtins IX86_BUILTIN_SCATTERSIV8DI, /* AVX512PF */ + IX86_BUILTIN_GATHERPFQPD, IX86_BUILTIN_GATHERPFDPS, + IX86_BUILTIN_GATHERPFDPD, IX86_BUILTIN_GATHERPFQPS, + IX86_BUILTIN_SCATTERPFDPD, IX86_BUILTIN_SCATTERPFDPS, + IX86_BUILTIN_SCATTERPFQPD, IX86_BUILTIN_SCATTERPFQPS, /* AVX-512ER */ @@ -30939,15 +30943,27 @@ ix86_init_mmx_sse_builtins (void) IX86_BUILTIN_SCATTERDIV8DI); /* AVX512PF */ + def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfdpd", + VOID_FTYPE_QI_V8SI_PCINT64_INT_INT, + IX86_BUILTIN_GATHERPFDPD); def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfdps", VOID_FTYPE_HI_V16SI_PCINT_INT_INT, IX86_BUILTIN_GATHERPFDPS); + def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfqpd", + VOID_FTYPE_QI_V8DI_PCINT64_INT_INT, + IX86_BUILTIN_GATHERPFQPD); def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_gatherpfqps", VOID_FTYPE_QI_V8DI_PCINT_INT_INT, IX86_BUILTIN_GATHERPFQPS); + def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfdpd", + VOID_FTYPE_QI_V8SI_PCINT64_INT_INT, + IX86_BUILTIN_SCATTERPFDPD); def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfdps", VOID_FTYPE_HI_V16SI_PCINT_INT_INT, IX86_BUILTIN_SCATTERPFDPS); + def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfqpd", + VOID_FTYPE_QI_V8DI_PCINT64_INT_INT, + IX86_BUILTIN_SCATTERPFQPD); def_builtin (OPTION_MASK_ISA_AVX512PF, "__builtin_ia32_scatterpfqps", VOID_FTYPE_QI_V8DI_PCINT_INT_INT, IX86_BUILTIN_SCATTERPFQPS); @@ -35593,17 +35609,30 @@ addcarryx: case IX86_BUILTIN_SCATTERDIV8DI: icode = CODE_FOR_avx512f_scatterdiv8di; goto scatter_gen; + + case IX86_BUILTIN_GATHERPFDPD: + icode = CODE_FOR_avx512pf_gatherpfv8sidf; + goto vec_prefetch_gen; case IX86_BUILTIN_GATHERPFDPS: - icode = CODE_FOR_avx512pf_gatherpfv16si; + icode = CODE_FOR_avx512pf_gatherpfv16sisf; + goto vec_prefetch_gen; + case IX86_BUILTIN_GATHERPFQPD: + icode = CODE_FOR_avx512pf_gatherpfv8didf; goto vec_prefetch_gen; case IX86_BUILTIN_GATHERPFQPS: - icode = CODE_FOR_avx512pf_gatherpfv8di; + icode = CODE_FOR_avx512pf_gatherpfv8disf; + goto vec_prefetch_gen; + case IX86_BUILTIN_SCATTERPFDPD: + icode = CODE_FOR_avx512pf_scatterpfv8sidf; goto vec_prefetch_gen; case IX86_BUILTIN_SCATTERPFDPS: - icode = CODE_FOR_avx512pf_scatterpfv16si; + icode = CODE_FOR_avx512pf_scatterpfv16sisf; + goto vec_prefetch_gen; + case IX86_BUILTIN_SCATTERPFQPD: + icode = CODE_FOR_avx512pf_scatterpfv8didf; goto vec_prefetch_gen; case IX86_BUILTIN_SCATTERPFQPS: - icode = CODE_FOR_avx512pf_scatterpfv8di; + icode = CODE_FOR_avx512pf_scatterpfv8disf; goto vec_prefetch_gen; gather_gen: diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 2e68fb6241b..fd2ca2f1127 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -417,6 +417,7 @@ [V32QI V16HI V8SI (V8DI "TARGET_AVX512F") (V16SI "TARGET_AVX512F")]) (define_mode_iterator VI48_256 [V8SI V4DI]) (define_mode_iterator VI48_512 [V16SI V8DI]) +(define_mode_iterator VI4_256_8_512 [V8SI V8DI]) ;; Int-float size matches (define_mode_iterator VI4F_128 [V4SI V4SF]) @@ -12495,10 +12496,14 @@ (set_attr "btver2_decode" "vector,vector,vector,vector") (set_attr "mode" "TI")]) -(define_expand "avx512pf_gatherpf" +;; Packed float variants +(define_mode_attr GATHER_SCATTER_SF_MEM_MODE + [(V8DI "V8SF") (V16SI "V16SF")]) + +(define_expand "avx512pf_gatherpfsf" [(unspec [(match_operand: 0 "register_or_constm1_operand") - (mem: + (mem: (match_par_dup 5 [(match_operand 2 "vsib_address_operand") (match_operand:VI48_512 1 "register_operand") @@ -12512,10 +12517,10 @@ operands[3]), UNSPEC_VSIBADDR); }) -(define_insn "*avx512pf_gatherpf_mask" +(define_insn "*avx512pf_gatherpfsf_mask" [(unspec [(match_operand: 0 "register_operand" "k") - (match_operator: 5 "vsib_mem_operator" + (match_operator: 5 "vsib_mem_operator" [(unspec:P [(match_operand:P 2 "vsib_address_operand" "Tv") (match_operand:VI48_512 1 "register_operand" "v") @@ -12539,10 +12544,10 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) -(define_insn "*avx512pf_gatherpf" +(define_insn "*avx512pf_gatherpfsf" [(unspec [(const_int -1) - (match_operator: 4 "vsib_mem_operator" + (match_operator: 4 "vsib_mem_operator" [(unspec:P [(match_operand:P 1 "vsib_address_operand" "Tv") (match_operand:VI48_512 0 "register_operand" "v") @@ -12566,10 +12571,83 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) -(define_expand "avx512pf_scatterpf" +;; Packed double variants +(define_expand "avx512pf_gatherpfdf" + [(unspec + [(match_operand: 0 "register_or_constm1_operand") + (mem:V8DF + (match_par_dup 5 + [(match_operand 2 "vsib_address_operand") + (match_operand:VI4_256_8_512 1 "register_operand") + (match_operand:SI 3 "const1248_operand")])) + (match_operand:SI 4 "const_0_to_1_operand")] + UNSPEC_GATHER_PREFETCH)] + "TARGET_AVX512PF" +{ + operands[5] + = gen_rtx_UNSPEC (Pmode, gen_rtvec (3, operands[2], operands[1], + operands[3]), UNSPEC_VSIBADDR); +}) + +(define_insn "*avx512pf_gatherpfdf_mask" + [(unspec + [(match_operand: 0 "register_operand" "k") + (match_operator:V8DF 5 "vsib_mem_operator" + [(unspec:P + [(match_operand:P 2 "vsib_address_operand" "Tv") + (match_operand:VI4_256_8_512 1 "register_operand" "v") + (match_operand:SI 3 "const1248_operand" "n")] + UNSPEC_VSIBADDR)]) + (match_operand:SI 4 "const_0_to_1_operand" "n")] + UNSPEC_GATHER_PREFETCH)] + "TARGET_AVX512PF" +{ + switch (INTVAL (operands[4])) + { + case 0: + return "vgatherpf0pd\t{%5%{%0%}|%5%{%0%}}"; + case 1: + return "vgatherpf1pd\t{%5%{%0%}|%5%{%0%}}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sse") + (set_attr "prefix" "evex") + (set_attr "mode" "XI")]) + +(define_insn "*avx512pf_gatherpfdf" + [(unspec + [(const_int -1) + (match_operator:V8DF 4 "vsib_mem_operator" + [(unspec:P + [(match_operand:P 1 "vsib_address_operand" "Tv") + (match_operand:VI4_256_8_512 0 "register_operand" "v") + (match_operand:SI 2 "const1248_operand" "n")] + UNSPEC_VSIBADDR)]) + (match_operand:SI 3 "const_0_to_1_operand" "n")] + UNSPEC_GATHER_PREFETCH)] + "TARGET_AVX512PF" +{ + switch (INTVAL (operands[3])) + { + case 0: + return "vgatherpf0pd\t{%4|%4}"; + case 1: + return "vgatherpf1pd\t{%4|%4}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sse") + (set_attr "prefix" "evex") + (set_attr "mode" "XI")]) + +;; Packed float variants +(define_expand "avx512pf_scatterpfsf" [(unspec [(match_operand: 0 "register_or_constm1_operand") - (mem: + (mem: (match_par_dup 5 [(match_operand 2 "vsib_address_operand") (match_operand:VI48_512 1 "register_operand") @@ -12583,10 +12661,10 @@ operands[3]), UNSPEC_VSIBADDR); }) -(define_insn "*avx512pf_scatterpf_mask" +(define_insn "*avx512pf_scatterpfsf_mask" [(unspec [(match_operand: 0 "register_operand" "k") - (match_operator: 5 "vsib_mem_operator" + (match_operator: 5 "vsib_mem_operator" [(unspec:P [(match_operand:P 2 "vsib_address_operand" "Tv") (match_operand:VI48_512 1 "register_operand" "v") @@ -12610,10 +12688,10 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) -(define_insn "*avx512pf_scatterpf" +(define_insn "*avx512pf_scatterpfsf" [(unspec [(const_int -1) - (match_operator: 4 "vsib_mem_operator" + (match_operator: 4 "vsib_mem_operator" [(unspec:P [(match_operand:P 1 "vsib_address_operand" "Tv") (match_operand:VI48_512 0 "register_operand" "v") @@ -12637,6 +12715,78 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) +;; Packed double variants +(define_expand "avx512pf_scatterpfdf" + [(unspec + [(match_operand: 0 "register_or_constm1_operand") + (mem:V8DF + (match_par_dup 5 + [(match_operand 2 "vsib_address_operand") + (match_operand:VI4_256_8_512 1 "register_operand") + (match_operand:SI 3 "const1248_operand")])) + (match_operand:SI 4 "const_0_to_1_operand")] + UNSPEC_SCATTER_PREFETCH)] + "TARGET_AVX512PF" +{ + operands[5] + = gen_rtx_UNSPEC (Pmode, gen_rtvec (3, operands[2], operands[1], + operands[3]), UNSPEC_VSIBADDR); +}) + +(define_insn "*avx512pf_scatterpfdf_mask" + [(unspec + [(match_operand: 0 "register_operand" "k") + (match_operator:V8DF 5 "vsib_mem_operator" + [(unspec:P + [(match_operand:P 2 "vsib_address_operand" "Tv") + (match_operand:VI4_256_8_512 1 "register_operand" "v") + (match_operand:SI 3 "const1248_operand" "n")] + UNSPEC_VSIBADDR)]) + (match_operand:SI 4 "const_0_to_1_operand" "n")] + UNSPEC_SCATTER_PREFETCH)] + "TARGET_AVX512PF" +{ + switch (INTVAL (operands[4])) + { + case 0: + return "vscatterpf0pd\t{%5%{%0%}|%5%{%0%}}"; + case 1: + return "vscatterpf1pd\t{%5%{%0%}|%5%{%0%}}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sse") + (set_attr "prefix" "evex") + (set_attr "mode" "XI")]) + +(define_insn "*avx512pf_scatterpfdf" + [(unspec + [(const_int -1) + (match_operator:V8DF 4 "vsib_mem_operator" + [(unspec:P + [(match_operand:P 1 "vsib_address_operand" "Tv") + (match_operand:VI4_256_8_512 0 "register_operand" "v") + (match_operand:SI 2 "const1248_operand" "n")] + UNSPEC_VSIBADDR)]) + (match_operand:SI 3 "const_0_to_1_operand" "n")] + UNSPEC_SCATTER_PREFETCH)] + "TARGET_AVX512PF" +{ + switch (INTVAL (operands[3])) + { + case 0: + return "vscatterpf0pd\t{%4|%4}"; + case 1: + return "vscatterpf1pd\t{%4|%4}"; + default: + gcc_unreachable (); + } +} + [(set_attr "type" "sse") + (set_attr "prefix" "evex") + (set_attr "mode" "XI")]) + (define_insn "avx512er_exp2" [(set (match_operand:VF_512 0 "register_operand" "=v") (unspec:VF_512 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa61d5c9874..fab60011331 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2014-01-27 Kirill Yukhin + + * gcc.target/i386/avx512pf-vgatherpf0dpd-1.c: New. + * gcc.target/i386/avx512pf-vgatherpf0qpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vgatherpf1dpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vgatherpf1qpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vscatterpf0dpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vscatterpf0qpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vscatterpf1dpd-1.c: Ditto. + * gcc.target/i386/avx512pf-vscatterpf1qpd-1.c: Ditto. + * gcc.target/i386/sse-14.c: Add new built-ins, fix AVX-512ER + built-ins roudning immediate. + * gcc.target/i386/sse-22.c: Add new built-ins. + * gcc.target/i386/sse-23.c: Ditto. + * gcc.target/i386/avx-1.c: Ditto. + 2014-01-27 Christian Bruel * gcc.target/sh/torture/strncmp.c: New tests. diff --git a/gcc/testsuite/gcc.target/i386/avx-1.c b/gcc/testsuite/gcc.target/i386/avx-1.c index 12674adf18a..8fb6fb880c1 100644 --- a/gcc/testsuite/gcc.target/i386/avx-1.c +++ b/gcc/testsuite/gcc.target/i386/avx-1.c @@ -362,6 +362,10 @@ #define __builtin_ia32_gatherpfqps(A, B, C, D, E) __builtin_ia32_gatherpfqps(A, B, C, 1, 1) #define __builtin_ia32_scatterpfdps(A, B, C, D, E) __builtin_ia32_scatterpfdps(A, B, C, 1, 1) #define __builtin_ia32_scatterpfqps(A, B, C, D, E) __builtin_ia32_scatterpfqps(A, B, C, 1, 1) +#define __builtin_ia32_gatherpfdpd(A, B, C, D, E) __builtin_ia32_gatherpfdpd(A, B, C, 1, 1) +#define __builtin_ia32_gatherpfqpd(A, B, C, D, E) __builtin_ia32_gatherpfqpd(A, B, C, 1, 1) +#define __builtin_ia32_scatterpfdpd(A, B, C, D, E) __builtin_ia32_scatterpfdpd(A, B, C, 1, 1) +#define __builtin_ia32_scatterpfqpd(A, B, C, D, E) __builtin_ia32_scatterpfqpd(A, B, C, 1, 1) /* shaintrin.h */ #define __builtin_ia32_sha1rnds4(A, B, C) __builtin_ia32_sha1rnds4(A, B, 1) diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0dpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0dpd-1.c new file mode 100644 index 00000000000..1368b7a459d --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0dpd-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vgatherpf0dpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m256i idx; +volatile __mmask8 m8; +void *base; + +void extern +avx512pf_test (void) +{ + _mm512_mask_prefetch_i32gather_pd (idx, m8, base, 8, 0); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0qpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0qpd-1.c new file mode 100644 index 00000000000..61a81bb29ae --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf0qpd-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vgatherpf0qpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m512i idx; +volatile __mmask8 m8; +int *base; + +void extern +avx512pf_test (void) +{ + _mm512_mask_prefetch_i64gather_pd (idx, m8, base, 8, 0); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1dpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1dpd-1.c new file mode 100644 index 00000000000..5bc7599712e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1dpd-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vgatherpf1dpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m256i idx; +volatile __mmask8 m8; +int *base; + +void extern +avx512pf_test (void) +{ + _mm512_mask_prefetch_i32gather_pd (idx, m8, base, 8, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1qpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1qpd-1.c new file mode 100644 index 00000000000..96610dbe243 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vgatherpf1qpd-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vgatherpf1qpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m512i idx; +volatile __mmask8 m8; +int *base; + +void extern +avx512pf_test (void) +{ + _mm512_mask_prefetch_i64gather_pd (idx, m8, base, 8, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0dpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0dpd-1.c new file mode 100644 index 00000000000..83c31cc4594 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0dpd-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vscatterpf0dpd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vscatterpf0dpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m256i idx; +volatile __mmask8 m8; +void *base; + +void extern +avx512pf_test (void) +{ + _mm512_prefetch_i32scatter_pd (base, idx, 8, 0); + _mm512_mask_prefetch_i32scatter_pd (base, m8, idx, 8, 0); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0qpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0qpd-1.c new file mode 100644 index 00000000000..31172f85586 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf0qpd-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vscatterpf0qpd\[ \\t\]+\[^\n\]*%zmm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vscatterpf0qpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m512i idx; +volatile __mmask8 m8; +void *base; + +void extern +avx512pf_test (void) +{ + _mm512_prefetch_i64scatter_pd (base, idx, 8, 0); + _mm512_mask_prefetch_i64scatter_pd (base, m8, idx, 8, 0); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1dpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1dpd-1.c new file mode 100644 index 00000000000..205505b8597 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1dpd-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vscatterpf1dpd\[ \\t\]+\[^\n\]*%ymm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vscatterpf1dpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m256i idx; +volatile __mmask8 m8; +void *base; + +void extern +avx512pf_test (void) +{ + _mm512_prefetch_i32scatter_pd (base, idx, 8, 1); + _mm512_mask_prefetch_i32scatter_pd (base, m8, idx, 8, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1qpd-1.c b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1qpd-1.c new file mode 100644 index 00000000000..64d7dfa95f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512pf-vscatterpf1qpd-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512pf -O2" } */ +/* { dg-final { scan-assembler-times "vscatterpf1qpd\[ \\t\]+\[^\n\]*%zmm\[0-9\]" 2 } } */ +/* { dg-final { scan-assembler-times "vscatterpf1qpd\[ \\t\]+\[^\n\]*\{%k\[1-7\]" 1 } } */ + +#include + +volatile __m512i idx; +volatile __mmask8 m8; +int *base; + +void extern +avx512pf_test (void) +{ + _mm512_prefetch_i64scatter_pd (base, idx, 8, 1); + _mm512_mask_prefetch_i64scatter_pd (base, m8, idx, 8, 1); +} diff --git a/gcc/testsuite/gcc.target/i386/sse-14.c b/gcc/testsuite/gcc.target/i386/sse-14.c index ad7ca7600f7..643eb992f48 100644 --- a/gcc/testsuite/gcc.target/i386/sse-14.c +++ b/gcc/testsuite/gcc.target/i386/sse-14.c @@ -523,6 +523,10 @@ test_3vx (_mm512_mask_prefetch_i32gather_ps, __m512i, __mmask16, void const *, 1 test_3vx (_mm512_mask_prefetch_i32scatter_ps, void const *, __mmask16, __m512i, 1, 1) test_3vx (_mm512_mask_prefetch_i64gather_ps, __m512i, __mmask8, void const *, 1, 1) test_3vx (_mm512_mask_prefetch_i64scatter_ps, void const *, __mmask8, __m512i, 1, 1) +test_3vx (_mm512_mask_prefetch_i32gather_pd, __m256i, __mmask8, void const *, 1, 1) +test_3vx (_mm512_mask_prefetch_i32scatter_pd, void const *, __mmask8, __m256i, 1, 1) +test_3vx (_mm512_mask_prefetch_i64gather_pd, __m512i, __mmask8, void const *, 1, 1) +test_3vx (_mm512_mask_prefetch_i64scatter_pd, void const *, __mmask8, __m512i, 1, 1) /* avx512erintrin.h */ test_1 (_mm512_exp2a23_round_pd, __m512d, __m512d, 5) diff --git a/gcc/testsuite/gcc.target/i386/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c index 630c952ab69..7d68be1a5ed 100644 --- a/gcc/testsuite/gcc.target/i386/sse-22.c +++ b/gcc/testsuite/gcc.target/i386/sse-22.c @@ -646,6 +646,11 @@ test_3vx (_mm512_mask_prefetch_i32scatter_ps, void const *, __mmask16, __m512i, test_3vx (_mm512_mask_prefetch_i64gather_ps, __m512i, __mmask8, void const *, 1, 1) test_3vx (_mm512_mask_prefetch_i64scatter_ps, void const *, __mmask8, __m512i, 1, 1) +test_3vx (_mm512_mask_prefetch_i32gather_pd, __m256i, __mmask8, void const *, 1, 1) +test_3vx (_mm512_mask_prefetch_i32scatter_pd, void const *, __mmask8, __m256i, 1, 1) +test_3vx (_mm512_mask_prefetch_i64gather_pd, __m512i, __mmask8, long long *, 1, 1) +test_3vx (_mm512_mask_prefetch_i64scatter_pd, void const *, __mmask8, __m512i, 1, 1) + /* avx512erintrin.h */ test_1 (_mm512_exp2a23_round_pd, __m512d, __m512d, 5) test_1 (_mm512_exp2a23_round_ps, __m512, __m512, 5) diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c index 309cd739e60..77c8d67af39 100644 --- a/gcc/testsuite/gcc.target/i386/sse-23.c +++ b/gcc/testsuite/gcc.target/i386/sse-23.c @@ -365,6 +365,10 @@ #define __builtin_ia32_gatherpfqps(A, B, C, D, E) __builtin_ia32_gatherpfqps(A, B, C, 1, 1) #define __builtin_ia32_scatterpfdps(A, B, C, D, E) __builtin_ia32_scatterpfdps(A, B, C, 1, 1) #define __builtin_ia32_scatterpfqps(A, B, C, D, E) __builtin_ia32_scatterpfqps(A, B, C, 1, 1) +#define __builtin_ia32_gatherpfdpd(A, B, C, D, E) __builtin_ia32_gatherpfdpd(A, B, C, 1, 1) +#define __builtin_ia32_gatherpfqpd(A, B, C, D, E) __builtin_ia32_gatherpfqpd(A, B, C, 1, 1) +#define __builtin_ia32_scatterpfdpd(A, B, C, D, E) __builtin_ia32_scatterpfdpd(A, B, C, 1, 1) +#define __builtin_ia32_scatterpfqpd(A, B, C, D, E) __builtin_ia32_scatterpfqpd(A, B, C, 1, 1) /* avx512erintrin.h */ #define __builtin_ia32_exp2pd_mask(A, B, C, D) __builtin_ia32_exp2pd_mask (A, B, C, 5) -- 2.11.4.GIT