Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/i386/fma4intrin.h @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | 1 /* Copyright (C) 2007-2017 Free Software Foundation, Inc. |
2 | 2 |
3 This file is part of GCC. | 3 This file is part of GCC. |
4 | 4 |
5 GCC is free software; you can redistribute it and/or modify | 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 | 6 it under the terms of the GNU General Public License as published by |
26 #endif | 26 #endif |
27 | 27 |
28 #ifndef _FMA4INTRIN_H_INCLUDED | 28 #ifndef _FMA4INTRIN_H_INCLUDED |
29 #define _FMA4INTRIN_H_INCLUDED | 29 #define _FMA4INTRIN_H_INCLUDED |
30 | 30 |
31 #ifndef __FMA4__ | |
32 # error "FMA4 instruction set not enabled" | |
33 #else | |
34 | |
35 /* We need definitions from the SSE4A, SSE3, SSE2 and SSE header files. */ | 31 /* We need definitions from the SSE4A, SSE3, SSE2 and SSE header files. */ |
36 #include <ammintrin.h> | 32 #include <ammintrin.h> |
37 | 33 |
34 #ifndef __FMA4__ | |
35 #pragma GCC push_options | |
36 #pragma GCC target("fma4") | |
37 #define __DISABLE_FMA4__ | |
38 #endif /* __FMA4__ */ | |
39 | |
38 /* 128b Floating point multiply/add type instructions. */ | 40 /* 128b Floating point multiply/add type instructions. */ |
39 extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) | 41 extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) |
40 _mm_macc_ps (__m128 __A, __m128 __B, __m128 __C) | 42 _mm_macc_ps (__m128 __A, __m128 __B, __m128 __C) |
41 { | 43 { |
42 return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); | 44 return (__m128) __builtin_ia32_vfmaddps ((__v4sf)__A, (__v4sf)__B, (__v4sf)__C); |
229 _mm256_msubadd_pd (__m256d __A, __m256d __B, __m256d __C) | 231 _mm256_msubadd_pd (__m256d __A, __m256d __B, __m256d __C) |
230 { | 232 { |
231 return (__m256d) __builtin_ia32_vfmaddsubpd256 ((__v4df)__A, (__v4df)__B, -(__v4df)__C); | 233 return (__m256d) __builtin_ia32_vfmaddsubpd256 ((__v4df)__A, (__v4df)__B, -(__v4df)__C); |
232 } | 234 } |
233 | 235 |
236 #ifdef __DISABLE_FMA4__ | |
237 #undef __DISABLE_FMA4__ | |
238 #pragma GCC pop_options | |
239 #endif /* __DISABLE_FMA4__ */ | |
240 | |
234 #endif | 241 #endif |
235 | |
236 #endif |