extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pandn (__m64 __m1, __m64 __m2) { return _mm_andnot_si64 (__m1, __m2); } /* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_or_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_por (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_por (__m64 __m1, __m64 __m2) { return _mm_or_si64 (__m1, __m2); } /* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_xor_si64 (__m64 __m1, __m64 __m2) { return __builtin_ia32_pxor (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pxor (__m64 __m1, __m64 __m2) { return _mm_xor_si64 (__m1, __m2); } /* Compare eight 8-bit values. The result of the comparison is 0xFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqb (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi8 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi8 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtb ((__v8qi)__m1, (__v8qi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtb (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi8 (__m1, __m2); } /* Compare four 16-bit values. The result of the comparison is 0xFFFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqw (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi16 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi16 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtw ((__v4hi)__m1, (__v4hi)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtw (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi16 (__m1, __m2); } /* Compare two 32-bit values. The result of the comparison is 0xFFFFFFFF if the test is true and zero if false. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpeqd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpeqd (__m64 __m1, __m64 __m2) { return _mm_cmpeq_pi32 (__m1, __m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpgt_pi32 (__m64 __m1, __m64 __m2) { return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pcmpgtd (__m64 __m1, __m64 __m2) { return _mm_cmpgt_pi32 (__m1, __m2); } /* Creates a 64-bit zero. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setzero_si64 (void) { return (__m64)0LL; } /* Creates a vector of two 32-bit values; I0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi32 (int __i1, int __i0) { return (__m64) __builtin_ia32_vec_init_v2si (__i0, __i1); } /* Creates a vector of four 16-bit values; W0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi16 (short __w3, short __w2, short __w1, short __w0) { return (__m64) __builtin_ia32_vec_init_v4hi (__w0, __w1, __w2, __w3); } /* Creates a vector of eight 8-bit values; B0 is least significant. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pi8 (char __b7, char __b6, char __b5, char __b4, char __b3, char __b2, char __b1, char __b0) { return (__m64) __builtin_ia32_vec_init_v8qi (__b0, __b1, __b2, __b3, __b4, __b5, __b6, __b7); } /* Similar, but with the arguments in reverse order. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi32 (int __i0, int __i1) { return _mm_set_pi32 (__i1, __i0); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi16 (short __w0, short __w1, short __w2, short __w3) { return _mm_set_pi16 (__w3, __w2, __w1, __w0); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_setr_pi8 (char __b0, char __b1, char __b2, char __b3, char __b4, char __b5, char __b6, char __b7) { return _mm_set_pi8 (__b7, __b6, __b5, __b4, __b3, __b2, __b1, __b0); } /* Creates a vector of two 32-bit values, both elements containing I. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi32 (int __i) { return _mm_set_pi32 (__i, __i); } /* Creates a vector of four 16-bit values, all elements containing W. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi16 (short __w) { return _mm_set_pi16 (__w, __w, __w, __w); } /* Creates a vector of eight 8-bit values, all elements containing B. */ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pi8 (char __b) { return _mm_set_pi8 (__b, __b, __b, __b, __b, __b, __b, __b); } #endif /* __MMX__ */ #endif /* _MMINTRIN_H_INCLUDED */ /* Copyright (C) 2004, 2006 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ #ifndef _MM_MALLOC_H_INCLUDED #define _MM_MALLOC_H_INCLUDED #include /* We can't depend on since the prototype of posix_memalign may not be visible. */ #ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); #else extern "C" int posix_memalign (void **, size_t, size_t) throw (); #endif static __inline void * _mm_malloc (size_t size, size_t alignment) { void *ptr; if (alignment == 1) return malloc (size); if (alignment == 2 || (sizeof (void *) == 8 && alignment == 4)) alignment = sizeof (void *); if (posix_memalign (&ptr, alignment, size) == 0) return ptr; else return NULL; } static __inline void _mm_free (void * ptr) { free (ptr); } #endif /* _MM_MALLOC_H_INCLUDED */ /* * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * * This file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * In addition to the permissions in the GNU General Public License, the * Free Software Foundation gives you unlimited permission to link the * compiled version of this file with other programs, and to distribute * those programs without any restriction coming from the use of this * file. (The General Public License restrictions do apply in other * respects; for example, they cover modification of the file, and * distribution when not linked into another program.) * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * As a special exception, if you link this library with files * compiled with GCC to produce an executable, this does not cause * the resulting executable to be covered by the GNU General Public License. * This exception does not however invalidate any other reasons why * the executable file might be covered by the GNU General Public License. */ /* %ecx */ #define bit_SSE3 (1 << 0) #define bit_SSSE3 (1 << 9) #define bit_CMPXCHG16B (1 << 13) #define bit_SSE4_1 (1 << 19) #define bit_SSE4_2 (1 << 20) #define bit_POPCNT (1 << 23) /* %edx */ #define bit_CMPXCHG8B (1 << 8) #define bit_CMOV (1 << 15) #define bit_MMX (1 << 23) #define bit_FXSAVE (1 << 24) #define bit_SSE (1 << 25) #define bit_SSE2 (1 << 26) /* Extended Features */ /* %ecx */ #define bit_LAHF_LM (1 << 0) #define bit_SSE4a (1 << 6) #define bit_SSE5 (1 << 11) /* %edx */ #define bit_LM (1 << 29) #define bit_3DNOWP (1 << 30) #define bit_3DNOW (1 << 31) #if defined(__i386__) && defined(__PIC__) /* %ebx may be the PIC register. */ #if __GNUC__ >= 3 #define __cpuid(level, a, b, c, d) \ __asm__ ("xchg{l}\t{%%}ebx, %1\n\t" \ "cpuid\n\t" \ "xchg{l}\t{%%}ebx, %1\n\t" \ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ : "0" (level)) #else /* Host GCCs older than 3.0 weren't supporting Intel asm syntax nor alternatives in i386 code. */ #define __cpuid(level, a, b, c, d) \ __asm__ ("xchgl\t%%ebx, %1\n\t" \ "cpuid\n\t" \ "xchgl\t%%ebx, %1\n\t" \ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ : "0" (level)) #endif #else #define __cpuid(level, a, b, c, d) \ __asm__ ("cpuid\n\t" \ : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ : "0" (level)) #endif /* Return highest supported input value for cpuid instruction. ext can be either 0x0 or 0x8000000 to return highest supported value for basic or extended cpuid information. Function returns 0 if cpuid is not supported or whatever cpuid returns in eax register. If sig pointer is non-null, then first four bytes of the signature (as found in ebx register) are returned in location pointed by sig. */ static __inline unsigned int __get_cpuid_max (unsigned int __ext, unsigned int *__sig) { unsigned int __eax, __ebx, __ecx, __edx; #ifndef __x86_64__ #if __GNUC__ >= 3 /* See if we can use cpuid. On AMD64 we always can. */ __asm__ ("pushf{l|d}\n\t" "pushf{l|d}\n\t" "pop{l}\t%0\n\t" "mov{l}\t{%0, %1|%1, %0}\n\t" "xor{l}\t{%2, %0|%0, %2}\n\t" "push{l}\t%0\n\t" "popf{l|d}\n\t" "pushf{l|d}\n\t" "pop{l}\t%0\n\t" "popf{l|d}\n\t" : "=&r" (__eax), "=&r" (__ebx) : "i" (0x00200000)); #else /* Host GCCs older than 3.0 weren't supporting Intel asm syntax nor alternatives in i386 code. */ __asm__ ("pushfl\n\t" "pushfl\n\t" "popl\t%0\n\t" "movl\t%0, %1\n\t" "xorl\t%2, %0\n\t" "pushl\t%0\n\t" "popfl\n\t" "pushfl\n\t" "popl\t%0\n\t" "popfl\n\t" : "=&r" (__eax), "=&r" (__ebx) : "i" (0x00200000)); #endif if (!((__eax ^ __ebx) & 0x00200000)) return 0; #endif /* Host supports cpuid. Return highest supported cpuid input value. */ __cpuid (__ext, __eax, __ebx, __ecx, __edx); if (__sig) *__sig = __ebx; return __eax; } /* Return cpuid data for requested cpuid level, as found in returned eax, ebx, ecx and edx registers. The function checks if cpuid is supported and returns 1 for valid cpuid information or 0 for unsupported cpuid level. All pointers are required to be non-null. */ static __inline int __get_cpuid (unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx) { unsigned int __ext = __level & 0x80000000; if (__get_cpuid_max (__ext, 0) < __level) return 0; __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx); return 1; } /* Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.1. */ #ifndef _TMMINTRIN_H_INCLUDED #define _TMMINTRIN_H_INCLUDED #ifndef __SSSE3__ # error "SSSE3 instruction set not enabled" #else /* We need definitions from the SSE3, SSE2 and SSE header files*/ #include extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadds_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadd_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hadds_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsubs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsub_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_hsubs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maddubs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_maddubs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhrs_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_mulhrs_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pmulhrsw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_pshufb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_shuffle_pi8 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_pshufb ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi8 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignb128 ((__v16qi)__X, (__v16qi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi16 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignw128 ((__v8hi)__X, (__v8hi)__Y); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_epi32 (__m128i __X, __m128i __Y) { return (__m128i) __builtin_ia32_psignd128 ((__v4si)__X, (__v4si)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi8 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignb ((__v8qi)__X, (__v8qi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi16 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignw ((__v4hi)__X, (__v4hi)__Y); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_sign_pi32 (__m64 __X, __m64 __Y) { return (__m64) __builtin_ia32_psignd ((__v2si)__X, (__v2si)__Y); } #ifdef __OPTIMIZE__ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_alignr_epi8(__m128i __X, __m128i __Y, const int __N) { return (__m128i) __builtin_ia32_palignr128 ((__v2di)__X, (__v2di)__Y, __N * 8); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_alignr_pi8(__m64 __X, __m64 __Y, const int __N) { return (__m64) __builtin_ia32_palignr ((long long)__X, (long long)__Y, __N * 8); } #else #define _mm_alignr_epi8(X, Y, N) \ ((__m128i) __builtin_ia32_palignr128 ((__v2di)(__m128i)(X), \ (__v2di)(__m128i)(Y), \ (int)(N) * 8)) #define _mm_alignr_pi8(X, Y, N) \ ((__m64) __builtin_ia32_palignr ((long long)(__m64)(X), \ (long long)(__m64)(Y), \ (int)(N) * 8)) #endif extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi8 (__m128i __X) { return (__m128i) __builtin_ia32_pabsb128 ((__v16qi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi16 (__m128i __X) { return (__m128i) __builtin_ia32_pabsw128 ((__v8hi)__X); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_epi32 (__m128i __X) { return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi8 (__m64 __X) { return (__m64) __builtin_ia32_pabsb ((__v8qi)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi16 (__m64 __X) { return (__m64) __builtin_ia32_pabsw ((__v4hi)__X); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_abs_pi32 (__m64 __X) { return (__m64) __builtin_ia32_pabsd ((__v2si)__X); } #endif /* __SSSE3__ */ #endif /* _TMMINTRIN_H_INCLUDED */ /* Exception handling and frame unwind runtime interface routines. Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* This is derived from the C++ ABI for IA-64. Where we diverge for cross-architecture compatibility are noted with "@@@". */ #ifndef _UNWIND_H #define _UNWIND_H #ifndef HIDE_EXPORTS #pragma GCC visibility push(default) #endif #ifdef __cplusplus extern "C" { #endif /* Level 1: Base ABI */ /* @@@ The IA-64 ABI uses uint64 throughout. Most places this is inefficient for 32-bit and smaller machines. */ typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__))); typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__))); #if defined(__ia64__) && defined(__hpux__) typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); #else typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); #endif typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); /* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and consumer of an exception. We'll go along with this for now even on 32-bit machines. We'll need to provide some other option for 16-bit machines and for machines with > 8 bits per byte. */ typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); /* The unwind interface uses reason codes in several contexts to identify the reasons for failures or other actions. */ typedef enum { _URC_NO_REASON = 0, _URC_FOREIGN_EXCEPTION_CAUGHT = 1, _URC_FATAL_PHASE2_ERROR = 2, _URC_FATAL_PHASE1_ERROR = 3, _URC_NORMAL_STOP = 4, _URC_END_OF_STACK = 5, _URC_HANDLER_FOUND = 6, _URC_INSTALL_CONTEXT = 7, _URC_CONTINUE_UNWIND = 8 } _Unwind_Reason_Code; /* The unwind interface uses a pointer to an exception header object as its representation of an exception being thrown. In general, the full representation of an exception object is language- and implementation-specific, but it will be prefixed by a header understood by the unwind interface. */ struct _Unwind_Exception; typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, struct _Unwind_Exception *); struct _Unwind_Exception { _Unwind_Exception_Class exception_class; _Unwind_Exception_Cleanup_Fn exception_cleanup; _Unwind_Word private_1; _Unwind_Word private_2; /* @@@ The IA-64 ABI says that this structure must be double-word aligned. Taking that literally does not make much sense generically. Instead we provide the maximum alignment required by any type for the machine. */ } __attribute__((__aligned__)); /* The ACTIONS argument to the personality routine is a bitwise OR of one or more of the following constants. */ typedef int _Unwind_Action; #define _UA_SEARCH_PHASE 1 #define _UA_CLEANUP_PHASE 2 #define _UA_HANDLER_FRAME 4 #define _UA_FORCE_UNWIND 8 #define _UA_END_OF_STACK 16 /* The target can override this macro to define any back-end-specific attributes required for the lowest-level stack frame. */ #ifndef LIBGCC2_UNWIND_ATTRIBUTE #define LIBGCC2_UNWIND_ATTRIBUTE #endif /* This is an opaque type used to refer to a system-specific data structure used by the system unwinder. This context is created and destroyed by the system, and passed to the personality routine during unwinding. */ struct _Unwind_Context; /* Raise an exception, passing along the given exception object. */ extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_RaiseException (struct _Unwind_Exception *); /* Raise an exception for forced unwinding. */ typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, struct _Unwind_Context *, void *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); /* Helper to invoke the exception_cleanup routine. */ extern void _Unwind_DeleteException (struct _Unwind_Exception *); /* Resume propagation of an existing exception. This is used after e.g. executing cleanup code, and not to implement rethrowing. */ extern void LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Resume (struct _Unwind_Exception *); /* @@@ Resume propagation of a FORCE_UNWIND exception, or to rethrow a normal exception that was handled. */ extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *); /* @@@ Use unwind data to perform a stack backtrace. The trace callback is called for every stack frame in the call chain, but no cleanup actions are performed. */ typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *, void *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_Backtrace (_Unwind_Trace_Fn, void *); /* These functions are used for communicating information about the unwind context (i.e. the unwind descriptors and the user register state) between the unwind library and the personality routine and landing pad. Only selected registers may be manipulated. */ extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *); extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); /* @@@ Retrieve the CFA of the given context. */ extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); /* The personality routine is the function in the C++ (or other language) runtime library which serves as an interface between the system unwind library and language-specific exception handling semantics. It is specific to the code fragment described by an unwind info block, and it is always referenced via the pointer in the unwind info block, and hence it has no ABI-specified name. Note that this implies that two different C++ implementations can use different names, and have different contents in the language specific data area. Moreover, that the language specific data area contains no version info because name of the function invoked provides more effective versioning by detecting at link time the lack of code to handle the different data format. */ typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, struct _Unwind_Context *); /* @@@ The following alternate entry points are for setjmp/longjmp based unwinding. */ struct SjLj_Function_Context; extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_SjLj_RaiseException (struct _Unwind_Exception *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_SjLj_ForcedUnwind (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); extern void LIBGCC2_UNWIND_ATTRIBUTE _Unwind_SjLj_Resume (struct _Unwind_Exception *); extern _Unwind_Reason_Code LIBGCC2_UNWIND_ATTRIBUTE _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *); /* @@@ The following provide access to the base addresses for text and data-relative addressing in the LDSA. In order to stay link compatible with the standard ABI for IA-64, we inline these. */ #ifdef __ia64__ #include static inline _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *_C) { /* The GP is stored in R1. */ return _Unwind_GetGR (_C, 1); } static inline _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *_C __attribute__ ((__unused__))) { abort (); return 0; } /* @@@ Retrieve the Backing Store Pointer of the given context. */ extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); #else extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); #endif /* @@@ Given an address, return the entry point of the function that contains it. */ extern void * _Unwind_FindEnclosingFunction (void *pc); #ifndef __SIZEOF_LONG__ #error "__SIZEOF_LONG__ macro not defined" #endif #ifndef __SIZEOF_POINTER__ #error "__SIZEOF_POINTER__ macro not defined" #endif /* leb128 type numbers have a potentially unlimited size. The target of the following definitions of _sleb128_t and _uleb128_t is to have efficient data types large enough to hold the leb128 type numbers used in the unwind code. Mostly these types will simply be defined to long and unsigned long except when a unsigned long data type on the target machine is not capable of storing a pointer. */ #if __SIZEOF_LONG__ >= __SIZEOF_POINTER__ typedef long _sleb128_t; typedef unsigned long _uleb128_t; #elif __SIZEOF_LONG_LONG__ >= __SIZEOF_POINTER__ typedef long long _sleb128_t; typedef unsigned long long _uleb128_t; #else # error "What type shall we use for _sleb128_t?" #endif #ifdef __cplusplus } #endif #ifndef HIDE_EXPORTS #pragma GCC visibility pop #endif #endif /* unwind.h */ /* Copyright (C) 2002, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* * ISO C Standard: 5.2.4.2.2 Characteristics of floating types */ #ifndef _FLOAT_H___ #define _FLOAT_H___ /* Radix of exponent representation, b. */ #undef FLT_RADIX #define FLT_RADIX __FLT_RADIX__ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef FLT_MANT_DIG #undef DBL_MANT_DIG #undef LDBL_MANT_DIG #define FLT_MANT_DIG __FLT_MANT_DIG__ #define DBL_MANT_DIG __DBL_MANT_DIG__ #define LDBL_MANT_DIG __LDBL_MANT_DIG__ /* Number of decimal digits, q, such that any floating-point number with q decimal digits can be rounded into a floating-point number with p radix b digits and back again without change to the q decimal digits, p * log10(b) if b is a power of 10 floor((p - 1) * log10(b)) otherwise */ #undef FLT_DIG #undef DBL_DIG #undef LDBL_DIG #define FLT_DIG __FLT_DIG__ #define DBL_DIG __DBL_DIG__ #define LDBL_DIG __LDBL_DIG__ /* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ #undef FLT_MIN_EXP #undef DBL_MIN_EXP #undef LDBL_MIN_EXP #define FLT_MIN_EXP __FLT_MIN_EXP__ #define DBL_MIN_EXP __DBL_MIN_EXP__ #define LDBL_MIN_EXP __LDBL_MIN_EXP__ /* Minimum negative integer such that 10 raised to that power is in the range of normalized floating-point numbers, ceil(log10(b) * (emin - 1)) */ #undef FLT_MIN_10_EXP #undef DBL_MIN_10_EXP #undef LDBL_MIN_10_EXP #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ #undef FLT_MAX_EXP #undef DBL_MAX_EXP #undef LDBL_MAX_EXP #define FLT_MAX_EXP __FLT_MAX_EXP__ #define DBL_MAX_EXP __DBL_MAX_EXP__ #define LDBL_MAX_EXP __LDBL_MAX_EXP__ /* Maximum integer such that 10 raised to that power is in the range of representable finite floating-point numbers, floor(log10((1 - b**-p) * b**emax)) */ #undef FLT_MAX_10_EXP #undef DBL_MAX_10_EXP #undef LDBL_MAX_10_EXP #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ /* Maximum representable finite floating-point number, (1 - b**-p) * b**emax */ #undef FLT_MAX #undef DBL_MAX #undef LDBL_MAX #define FLT_MAX __FLT_MAX__ #define DBL_MAX __DBL_MAX__ #define LDBL_MAX __LDBL_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type, b**1-p. */ #undef FLT_EPSILON #undef DBL_EPSILON #undef LDBL_EPSILON #define FLT_EPSILON __FLT_EPSILON__ #define DBL_EPSILON __DBL_EPSILON__ #define LDBL_EPSILON __LDBL_EPSILON__ /* Minimum normalized positive floating-point number, b**(emin - 1). */ #undef FLT_MIN #undef DBL_MIN #undef LDBL_MIN #define FLT_MIN __FLT_MIN__ #define DBL_MIN __DBL_MIN__ #define LDBL_MIN __LDBL_MIN__ /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ /* ??? This is supposed to change with calls to fesetround in . */ #undef FLT_ROUNDS #define FLT_ROUNDS 1 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type float and double to the range and precision of the double type, evaluate long double operations and constants to the range and precision of the long double type 2 evaluate all operations and constants to the range and precision of the long double type ??? This ought to change with the setting of the fp control word; the value provided by the compiler assumes the widest setting. */ #undef FLT_EVAL_METHOD #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ /* Number of decimal digits, n, such that any floating-point number in the widest supported floating type with pmax radix b digits can be rounded to a floating-point number with n decimal digits and back again without change to the value, pmax * log10(b) if b is a power of 10 ceil(1 + pmax * log10(b)) otherwise */ #undef DECIMAL_DIG #define DECIMAL_DIG __DECIMAL_DIG__ #endif /* C99 */ #ifdef __STDC_WANT_DEC_FP__ /* Draft Technical Report 24732, extension for decimal floating-point arithmetic: Characteristic of decimal floating types . */ /* Number of base-FLT_RADIX digits in the significand, p. */ #undef DEC32_MANT_DIG #undef DEC64_MANT_DIG #undef DEC128_MANT_DIG #define DEC32_MANT_DIG __DEC32_MANT_DIG__ #define DEC64_MANT_DIG __DEC64_MANT_DIG__ #define DEC128_MANT_DIG __DEC128_MANT_DIG__ /* Minimum exponent. */ #undef DEC32_MIN_EXP #undef DEC64_MIN_EXP #undef DEC128_MIN_EXP #define DEC32_MIN_EXP __DEC32_MIN_EXP__ #define DEC64_MIN_EXP __DEC64_MIN_EXP__ #define DEC128_MIN_EXP __DEC128_MIN_EXP__ /* Maximum exponent. */ #undef DEC32_MAX_EXP #undef DEC64_MAX_EXP #undef DEC128_MAX_EXP #define DEC32_MAX_EXP __DEC32_MAX_EXP__ #define DEC64_MAX_EXP __DEC64_MAX_EXP__ #define DEC128_MAX_EXP __DEC128_MAX_EXP__ /* Maximum representable finite decimal floating-point number (there are 6, 15, and 33 9s after the decimal points respectively). */ #undef DEC32_MAX #undef DEC64_MAX #undef DEC128_MAX #define DEC32_MAX __DEC32_MAX__ #define DEC64_MAX __DEC64_MAX__ #define DEC128_MAX __DEC128_MAX__ /* The difference between 1 and the least value greater than 1 that is representable in the given floating point type. */ #undef DEC32_EPSILON #undef DEC64_EPSILON #undef DEC128_EPSILON #define DEC32_EPSILON __DEC32_EPSILON__ #define DEC64_EPSILON __DEC64_EPSILON__ #define DEC128_EPSILON __DEC128_EPSILON__ /* Minimum normalized positive floating-point number. */ #undef DEC32_MIN #undef DEC64_MIN #undef DEC128_MIN #define DEC32_MIN __DEC32_MIN__ #define DEC64_MIN __DEC64_MIN__ #define DEC128_MIN __DEC128_MIN__ /* Minimum denormalized positive floating-point number. */ #undef DEC32_DEN #undef DEC64_DEN #undef DEC128_DEN #define DEC32_DEN __DEC32_DEN__ #define DEC64_DEN __DEC64_DEN__ #define DEC128_DEN __DEC128_DEN__ /* The floating-point expression evaluation method. -1 indeterminate 0 evaluate all operations and constants just to the range and precision of the type 1 evaluate operations and constants of type _Decimal32 and _Decimal64 to the range and precision of the _Decimal64 type, evaluate _Decimal128 operations and constants to the range and precision of the _Decimal128 type; 2 evaluate all operations and constants to the range and precision of the _Decimal128 type. */ #undef DECFLT_EVAL_METHOD #define DECFLT_EVAL_METHOD __DECFLT_EVAL_METHOD__ #endif /* __STDC_WANT_DEC_FP__ */ #endif /* _FLOAT_H___ */ /* Copyright (C) 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* Common definition of the ROUND and PTEST intrinsics that are shared between SSE4.1 and SSE5. */ #ifndef _MMINTRIN_COMMON_H_INCLUDED #define _MMINTRIN_COMMON_H_INCLUDED #if !defined(__SSE5__) && !defined(__SSE4_1__) # error "SSE5 or SSE4.1 instruction set not enabled" #else /* Rounding mode macros. */ #define _MM_FROUND_TO_NEAREST_INT 0x00 #define _MM_FROUND_TO_NEG_INF 0x01 #define _MM_FROUND_TO_POS_INF 0x02 #define _MM_FROUND_TO_ZERO 0x03 #define _MM_FROUND_CUR_DIRECTION 0x04 #define _MM_FROUND_RAISE_EXC 0x00 #define _MM_FROUND_NO_EXC 0x08 #define _MM_FROUND_NINT \ (_MM_FROUND_TO_NEAREST_INT | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_FLOOR \ (_MM_FROUND_TO_NEG_INF | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_CEIL \ (_MM_FROUND_TO_POS_INF | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_TRUNC \ (_MM_FROUND_TO_ZERO | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_RINT \ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_RAISE_EXC) #define _MM_FROUND_NEARBYINT \ (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC) /* Test Instruction */ /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & __M) == 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testz_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestz128 ((__v2di)__M, (__v2di)__V); } /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & ~__M) == 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testc_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestc128 ((__v2di)__M, (__v2di)__V); } /* Packed integer 128-bit bitwise comparison. Return 1 if (__V & __M) != 0 && (__V & ~__M) != 0. */ extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_testnzc_si128 (__m128i __M, __m128i __V) { return __builtin_ia32_ptestnzc128 ((__v2di)__M, (__v2di)__V); } /* Macros for packed integer 128-bit comparison intrinsics. */ #define _mm_test_all_zeros(M, V) _mm_testz_si128 ((M), (V)) #define _mm_test_all_ones(V) \ _mm_testc_si128 ((V), _mm_cmpeq_epi32 ((V), (V))) #define _mm_test_mix_ones_zeros(M, V) _mm_testnzc_si128 ((M), (V)) /* Packed/scalar double precision floating point rounding. */ #ifdef __OPTIMIZE__ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_pd (__m128d __V, const int __M) { return (__m128d) __builtin_ia32_roundpd ((__v2df)__V, __M); } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_sd(__m128d __D, __m128d __V, const int __M) { return (__m128d) __builtin_ia32_roundsd ((__v2df)__D, (__v2df)__V, __M); } #else #define _mm_round_pd(V, M) \ ((__m128d) __builtin_ia32_roundpd ((__v2df)(__m128d)(V), (int)(M))) #define _mm_round_sd(D, V, M) \ ((__m128d) __builtin_ia32_roundsd ((__v2df)(__m128d)(D), \ (__v2df)(__m128d)(V), (int)(M))) #endif /* Packed/scalar single precision floating point rounding. */ #ifdef __OPTIMIZE__ extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_ps (__m128 __V, const int __M) { return (__m128) __builtin_ia32_roundps ((__v4sf)__V, __M); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_round_ss (__m128 __D, __m128 __V, const int __M) { return (__m128) __builtin_ia32_roundss ((__v4sf)__D, (__v4sf)__V, __M); } #else #define _mm_round_ps(V, M) \ ((__m128) __builtin_ia32_roundps ((__v4sf)(__m128)(V), (int)(M))) #define _mm_round_ss(D, V, M) \ ((__m128) __builtin_ia32_roundss ((__v4sf)(__m128)(D), \ (__v4sf)(__m128)(V), (int)(M))) #endif /* Macros for ceil/floor intrinsics. */ #define _mm_ceil_pd(V) _mm_round_pd ((V), _MM_FROUND_CEIL) #define _mm_ceil_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_CEIL) #define _mm_floor_pd(V) _mm_round_pd((V), _MM_FROUND_FLOOR) #define _mm_floor_sd(D, V) _mm_round_sd ((D), (V), _MM_FROUND_FLOOR) #define _mm_ceil_ps(V) _mm_round_ps ((V), _MM_FROUND_CEIL) #define _mm_ceil_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_CEIL) #define _mm_floor_ps(V) _mm_round_ps ((V), _MM_FROUND_FLOOR) #define _mm_floor_ss(D, V) _mm_round_ss ((D), (V), _MM_FROUND_FLOOR) #endif /* __SSE5__/__SSE4_1__ */ #endif /* _MMINTRIN_COMMON_H_INCLUDED */ #ifndef _VARARGS_H #define _VARARGS_H #error "GCC no longer implements ." #error "Revise your code to use ." #endif /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* * ISO C Standard: 7.15 Variable arguments */ #ifndef _STDARG_H #ifndef _ANSI_STDARG_H_ #ifndef __need___va_list #define _STDARG_H #define _ANSI_STDARG_H_ #endif /* not __need___va_list */ #undef __need___va_list /* Define __gnuc_va_list. */ #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef __builtin_va_list __gnuc_va_list; #endif /* Define the standard macros for the user, if this invocation was from the user program. */ #ifdef _STDARG_H #define va_start(v,l) __builtin_va_start(v,l) #define va_end(v) __builtin_va_end(v) #define va_arg(v,l) __builtin_va_arg(v,l) #if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L #define va_copy(d,s) __builtin_va_copy(d,s) #endif #define __va_copy(d,s) __builtin_va_copy(d,s) /* Define va_list, if desired, from __gnuc_va_list. */ /* We deliberately do not define va_list when called from stdio.h, because ANSI C says that stdio.h is not supposed to define va_list. stdio.h needs to have access to that data type, but must not use that name. It should use the name __gnuc_va_list, which is safe because it is reserved for the implementation. */ #ifdef _HIDDEN_VA_LIST /* On OSF1, this means varargs.h is "half-loaded". */ #undef _VA_LIST #endif #ifdef _BSD_VA_LIST #undef _BSD_VA_LIST #endif #if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST)) /* SVR4.2 uses _VA_LIST for an internal alias for va_list, so we must avoid testing it and setting it here. SVR4 uses _VA_LIST as a flag in stdarg.h, but we should have no conflict with that. */ #ifndef _VA_LIST_ #define _VA_LIST_ #ifdef __i860__ #ifndef _VA_LIST #define _VA_LIST va_list #endif #endif /* __i860__ */ typedef __gnuc_va_list va_list; #ifdef _SCO_DS #define __VA_LIST #endif #endif /* _VA_LIST_ */ #else /* not __svr4__ || _SCO_DS */ /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. But on BSD NET2 we must not test or define or undef it. (Note that the comments in NET 2's ansi.h are incorrect for _VA_LIST_--see stdio.h!) */ #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT) /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */ #ifndef _VA_LIST_DEFINED /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST /* The macro _VA_LIST_T_H is used in the Bull dpx2 */ #ifndef _VA_LIST_T_H /* The macro __va_list__ is used by BeOS. */ #ifndef __va_list__ typedef __gnuc_va_list va_list; #endif /* not __va_list__ */ #endif /* not _VA_LIST_T_H */ #endif /* not _VA_LIST */ #endif /* not _VA_LIST_DEFINED */ #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) #define _VA_LIST_ #endif #ifndef _VA_LIST #define _VA_LIST #endif #ifndef _VA_LIST_DEFINED #define _VA_LIST_DEFINED #endif #ifndef _VA_LIST_T_H #define _VA_LIST_T_H #endif #ifndef __va_list__ #define __va_list__ #endif #endif /* not _VA_LIST_, except on certain systems */ #endif /* not __svr4__ */ #endif /* _STDARG_H */ #endif /* not _ANSI_STDARG_H_ */ #endif /* not _STDARG_H */ /* Copyright (C) 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* Implemented from the mm3dnow.h (of supposedly AMD origin) included with MSVC 7.1. */ #ifndef _MM3DNOW_H_INCLUDED #define _MM3DNOW_H_INCLUDED #ifdef __3dNOW__ #include /* Internal data types for implementing the intrinsics. */ typedef float __v2sf __attribute__ ((__vector_size__ (8))); extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_femms (void) { __builtin_ia32_femms(); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pavgusb (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pavgusb ((__v8qi)__A, (__v8qi)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pf2id (__m64 __A) { return (__m64)__builtin_ia32_pf2id ((__v2sf)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfacc (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfacc ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfadd (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfadd ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfcmpeq (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfcmpeq ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfcmpge (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfcmpge ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfcmpgt (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfcmpgt ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfmax (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfmax ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfmin (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfmin ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfmul (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfmul ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfrcp (__m64 __A) { return (__m64)__builtin_ia32_pfrcp ((__v2sf)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfrcpit1 (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfrcpit1 ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfrcpit2 (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfrcpit2 ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfrsqrt (__m64 __A) { return (__m64)__builtin_ia32_pfrsqrt ((__v2sf)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfrsqit1 (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfrsqit1 ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfsub (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfsub ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfsubr (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfsubr ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pi2fd (__m64 __A) { return (__m64)__builtin_ia32_pi2fd ((__v2si)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pmulhrw (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pmulhrw ((__v4hi)__A, (__v4hi)__B); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_prefetch (void *__P) { __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); } extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_prefetchw (void *__P) { __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_from_float (float __A) { return __extension__ (__m64)(__v2sf){ __A, 0.0f }; } extern __inline float __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_to_float (__m64 __A) { union { __v2sf v; float a[2]; } __tmp; __tmp.v = (__v2sf)__A; return __tmp.a[0]; } #ifdef __3dNOW_A__ extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pf2iw (__m64 __A) { return (__m64)__builtin_ia32_pf2iw ((__v2sf)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfnacc (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfnacc ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pfpnacc (__m64 __A, __m64 __B) { return (__m64)__builtin_ia32_pfpnacc ((__v2sf)__A, (__v2sf)__B); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pi2fw (__m64 __A) { return (__m64)__builtin_ia32_pi2fw ((__v2si)__A); } extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_pswapd (__m64 __A) { return (__m64)__builtin_ia32_pswapdsf ((__v2sf)__A); } #endif /* __3dNOW_A__ */ #endif /* __3dNOW__ */ #endif /* _MM3DNOW_H_INCLUDED */ /* Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* Implemented from the specification included in the Intel C++ Compiler User Guide and Reference, version 9.0. */ #ifndef _EMMINTRIN_H_INCLUDED #define _EMMINTRIN_H_INCLUDED #ifndef __SSE2__ # error "SSE2 instruction set not enabled" #else /* We need definitions from the SSE header files*/ #include /* SSE2 */ typedef double __v2df __attribute__ ((__vector_size__ (16))); typedef long long __v2di __attribute__ ((__vector_size__ (16))); typedef int __v4si __attribute__ ((__vector_size__ (16))); typedef short __v8hi __attribute__ ((__vector_size__ (16))); typedef char __v16qi __attribute__ ((__vector_size__ (16))); /* The Intel API is flexible enough that we must allow aliasing with other vector types, and their scalar components. */ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__)); typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__)); /* Create a selector for use with the SHUFPD instruction. */ #define _MM_SHUFFLE2(fp1,fp0) \ (((fp1) << 1) | (fp0)) /* Create a vector with element 0 as F and the rest zero. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_sd (double __F) { return __extension__ (__m128d){ __F, 0.0 }; } /* Create a vector with both elements equal to F. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set1_pd (double __F) { return __extension__ (__m128d){ __F, __F }; } extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pd1 (double __F) { return _mm_set1_pd (__F); } /* Create a vector with the lower value X and upper value W. */ extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_set_pd (double __W, double __X) { return __extension__ (__m128d){ __X, __W }; } /* Create a