mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
fa20edc44d
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
85 lines
3.1 KiB
C
85 lines
3.1 KiB
C
#if defined(__x86_64__) && !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
#ifndef _PMMINTRIN_H_INCLUDED
|
|
#define _PMMINTRIN_H_INCLUDED
|
|
#include "third_party/intel/emmintrin.internal.h"
|
|
#ifndef __SSE3__
|
|
#pragma GCC push_options
|
|
#pragma GCC target("sse3")
|
|
#define __DISABLE_SSE3__
|
|
#endif
|
|
#define _MM_DENORMALS_ZERO_MASK 0x0040
|
|
#define _MM_DENORMALS_ZERO_ON 0x0040
|
|
#define _MM_DENORMALS_ZERO_OFF 0x0000
|
|
#define _MM_SET_DENORMALS_ZERO_MODE(mode) _mm_setcsr ((_mm_getcsr () & ~_MM_DENORMALS_ZERO_MASK) | (mode))
|
|
#define _MM_GET_DENORMALS_ZERO_MODE() (_mm_getcsr() & _MM_DENORMALS_ZERO_MASK)
|
|
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_addsub_ps (__m128 __X, __m128 __Y)
|
|
{
|
|
return (__m128) __builtin_ia32_addsubps ((__v4sf)__X, (__v4sf)__Y);
|
|
}
|
|
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_hadd_ps (__m128 __X, __m128 __Y)
|
|
{
|
|
return (__m128) __builtin_ia32_haddps ((__v4sf)__X, (__v4sf)__Y);
|
|
}
|
|
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_hsub_ps (__m128 __X, __m128 __Y)
|
|
{
|
|
return (__m128) __builtin_ia32_hsubps ((__v4sf)__X, (__v4sf)__Y);
|
|
}
|
|
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_movehdup_ps (__m128 __X)
|
|
{
|
|
return (__m128) __builtin_ia32_movshdup ((__v4sf)__X);
|
|
}
|
|
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_moveldup_ps (__m128 __X)
|
|
{
|
|
return (__m128) __builtin_ia32_movsldup ((__v4sf)__X);
|
|
}
|
|
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_addsub_pd (__m128d __X, __m128d __Y)
|
|
{
|
|
return (__m128d) __builtin_ia32_addsubpd ((__v2df)__X, (__v2df)__Y);
|
|
}
|
|
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_hadd_pd (__m128d __X, __m128d __Y)
|
|
{
|
|
return (__m128d) __builtin_ia32_haddpd ((__v2df)__X, (__v2df)__Y);
|
|
}
|
|
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_hsub_pd (__m128d __X, __m128d __Y)
|
|
{
|
|
return (__m128d) __builtin_ia32_hsubpd ((__v2df)__X, (__v2df)__Y);
|
|
}
|
|
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_loaddup_pd (double const *__P)
|
|
{
|
|
return _mm_load1_pd (__P);
|
|
}
|
|
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_movedup_pd (__m128d __X)
|
|
{
|
|
return _mm_shuffle_pd (__X, __X, _MM_SHUFFLE2 (0,0));
|
|
}
|
|
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_lddqu_si128 (__m128i const *__P)
|
|
{
|
|
return (__m128i) __builtin_ia32_lddqu ((char const *)__P);
|
|
}
|
|
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_monitor (void const * __P, unsigned int __E, unsigned int __H)
|
|
{
|
|
__builtin_ia32_monitor (__P, __E, __H);
|
|
}
|
|
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
|
_mm_mwait (unsigned int __E, unsigned int __H)
|
|
{
|
|
__builtin_ia32_mwait (__E, __H);
|
|
}
|
|
#ifdef __DISABLE_SSE3__
|
|
#undef __DISABLE_SSE3__
|
|
#pragma GCC pop_options
|
|
#endif
|
|
#endif
|
|
#endif
|