1  /* Copyright (C) 2021-2023 Free Software Foundation, Inc.
       2  
       3     This file is part of GCC.
       4  
       5     GCC is free software; you can redistribute it and/or modify
       6     it under the terms of the GNU General Public License as published by
       7     the Free Software Foundation; either version 3, or (at your option)
       8     any later version.
       9  
      10     GCC is distributed in the hope that it will be useful,
      11     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      13     GNU General Public License for more details.
      14  
      15     Under Section 7 of GPL version 3, you are granted additional
      16     permissions described in the GCC Runtime Library Exception, version
      17     3.1, as published by the Free Software Foundation.
      18  
      19     You should have received a copy of the GNU General Public License and
      20     a copy of the GCC Runtime Library Exception along with this program;
      21     see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
      22     <http://www.gnu.org/licenses/>.  */
      23  
      24  #ifndef _IMMINTRIN_H_INCLUDED
      25  #error "Never use <avxneconvertintrin.h> directly; include <immintrin.h> instead."
      26  #endif
      27  
      28  #ifndef _AVXNECONVERTINTRIN_H_INCLUDED
      29  #define _AVXNECONVERTINTRIN_H_INCLUDED
      30  
      31  #ifndef __AVXNECONVERT__
      32  #pragma GCC push_options
      33  #pragma GCC target ("avxneconvert")
      34  #define __DISABLE_AVXNECONVERT__
      35  #endif /* __AVXNECONVERT__ */
      36  
      37  extern __inline __m128
      38  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      39  _mm_bcstnebf16_ps (const void *__P)
      40  {
      41    return (__m128) __builtin_ia32_vbcstnebf162ps128 ((const __bf16 *) __P);
      42  }
      43  
      44  extern __inline __m256
      45  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      46  _mm256_bcstnebf16_ps (const void *__P)
      47  {
      48    return (__m256) __builtin_ia32_vbcstnebf162ps256 ((const __bf16 *) __P);
      49  }
      50  
      51  extern __inline __m128
      52  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      53  _mm_bcstnesh_ps (const void *__P)
      54  {
      55    return (__m128) __builtin_ia32_vbcstnesh2ps128 ((const _Float16 *) __P);
      56  }
      57  
      58  extern __inline __m256
      59  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      60  _mm256_bcstnesh_ps (const void *__P)
      61  {
      62    return (__m256) __builtin_ia32_vbcstnesh2ps256 ((const _Float16 *) __P);
      63  }
      64  
      65  extern __inline __m128
      66  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      67  _mm_cvtneebf16_ps (const __m128bh *__A)
      68  {
      69    return (__m128) __builtin_ia32_vcvtneebf162ps128 ((const __v8bf *) __A);
      70  }
      71  
      72  extern __inline __m256
      73  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      74  _mm256_cvtneebf16_ps (const __m256bh *__A)
      75  {
      76    return (__m256) __builtin_ia32_vcvtneebf162ps256 ((const __v16bf *) __A);
      77  }
      78  
      79  extern __inline __m128
      80  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      81  _mm_cvtneeph_ps (const __m128h *__A)
      82  {
      83    return (__m128) __builtin_ia32_vcvtneeph2ps128 ((const __v8hf *) __A);
      84  }
      85  
      86  extern __inline __m256
      87  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      88  _mm256_cvtneeph_ps (const __m256h *__A)
      89  {
      90    return (__m256) __builtin_ia32_vcvtneeph2ps256 ((const __v16hf *) __A);
      91  }
      92  
      93  extern __inline __m128
      94  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
      95  _mm_cvtneobf16_ps (const __m128bh *__A)
      96  {
      97    return (__m128) __builtin_ia32_vcvtneobf162ps128 ((const __v8bf *) __A);
      98  }
      99  
     100  extern __inline __m256
     101  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
     102  _mm256_cvtneobf16_ps (const __m256bh *__A)
     103  {
     104    return (__m256) __builtin_ia32_vcvtneobf162ps256 ((const __v16bf *) __A);
     105  }
     106  
     107  extern __inline __m128
     108  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
     109  _mm_cvtneoph_ps (const __m128h *__A)
     110  {
     111    return (__m128) __builtin_ia32_vcvtneoph2ps128 ((const __v8hf *) __A);
     112  }
     113  
     114  extern __inline __m256
     115  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
     116  _mm256_cvtneoph_ps (const __m256h *__A)
     117  {
     118    return (__m256) __builtin_ia32_vcvtneoph2ps256 ((const __v16hf *) __A);
     119  }
     120  
     121  extern __inline __m128bh
     122  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
     123  _mm_cvtneps_avx_pbh (__m128 __A)
     124  {
     125    return (__m128bh) __builtin_ia32_cvtneps2bf16_v4sf (__A);
     126  }
     127  
     128  extern __inline __m128bh
     129  __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
     130  _mm256_cvtneps_avx_pbh (__m256 __A)
     131  {
     132    return (__m128bh) __builtin_ia32_cvtneps2bf16_v8sf (__A);
     133  }
     134  
     135  #ifdef __DISABLE_AVXNECONVERT__
     136  #undef __DISABLE_AVXNECONVERT__
     137  #pragma GCC pop_options
     138  #endif /* __DISABLE_AVXNECONVERT__ */
     139  
     140  #endif /* _AVXNECONVERTINTRIN_H_INCLUDED */