mm3dnow.h revision 249423
1221339Sdim/*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------=== 2221339Sdim * 3221339Sdim * Permission is hereby granted, free of charge, to any person obtaining a copy 4221339Sdim * of this software and associated documentation files (the "Software"), to deal 5221339Sdim * in the Software without restriction, including without limitation the rights 6221339Sdim * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7221339Sdim * copies of the Software, and to permit persons to whom the Software is 8221339Sdim * furnished to do so, subject to the following conditions: 9221339Sdim * 10221339Sdim * The above copyright notice and this permission notice shall be included in 11221339Sdim * all copies or substantial portions of the Software. 12221339Sdim * 13221339Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14221339Sdim * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15221339Sdim * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16221339Sdim * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17221339Sdim * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18221339Sdim * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19221339Sdim * THE SOFTWARE. 20221339Sdim * 21221339Sdim *===-----------------------------------------------------------------------=== 22221339Sdim */ 23221339Sdim 24221339Sdim#ifndef _MM3DNOW_H_INCLUDED 25221339Sdim#define _MM3DNOW_H_INCLUDED 26221339Sdim 27221339Sdim#include <mmintrin.h> 28249423Sdim#include <prfchwintrin.h> 29221339Sdim 30221339Sdimtypedef float __v2sf __attribute__((__vector_size__(8))); 31221339Sdim 32221339Sdimstatic __inline__ void __attribute__((__always_inline__, __nodebug__)) 33221339Sdim_m_femms() { 34221339Sdim __builtin_ia32_femms(); 35221339Sdim} 36221339Sdim 37221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 38221339Sdim_m_pavgusb(__m64 __m1, __m64 __m2) { 39221339Sdim return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2); 40221339Sdim} 41221339Sdim 42221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 43221339Sdim_m_pf2id(__m64 __m) { 44221339Sdim return (__m64)__builtin_ia32_pf2id((__v2sf)__m); 45221339Sdim} 46221339Sdim 47221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 48221339Sdim_m_pfacc(__m64 __m1, __m64 __m2) { 49221339Sdim return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2); 50221339Sdim} 51221339Sdim 52221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 53221339Sdim_m_pfadd(__m64 __m1, __m64 __m2) { 54221339Sdim return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2); 55221339Sdim} 56221339Sdim 57221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 58221339Sdim_m_pfcmpeq(__m64 __m1, __m64 __m2) { 59221339Sdim return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2); 60221339Sdim} 61221339Sdim 62221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 63221339Sdim_m_pfcmpge(__m64 __m1, __m64 __m2) { 64221339Sdim return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2); 65221339Sdim} 66221339Sdim 67221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 68221339Sdim_m_pfcmpgt(__m64 __m1, __m64 __m2) { 69221339Sdim return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2); 70221339Sdim} 71221339Sdim 72221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 73221339Sdim_m_pfmax(__m64 __m1, __m64 __m2) { 74221339Sdim return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2); 75221339Sdim} 76221339Sdim 77221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 78221339Sdim_m_pfmin(__m64 __m1, __m64 __m2) { 79221339Sdim return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2); 80221339Sdim} 81221339Sdim 82221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 83221339Sdim_m_pfmul(__m64 __m1, __m64 __m2) { 84221339Sdim return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2); 85221339Sdim} 86221339Sdim 87221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 88221339Sdim_m_pfrcp(__m64 __m) { 89221339Sdim return (__m64)__builtin_ia32_pfrcp((__v2sf)__m); 90221339Sdim} 91221339Sdim 92221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 93221339Sdim_m_pfrcpit1(__m64 __m1, __m64 __m2) { 94221339Sdim return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2); 95221339Sdim} 96221339Sdim 97221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 98221339Sdim_m_pfrcpit2(__m64 __m1, __m64 __m2) { 99221339Sdim return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2); 100221339Sdim} 101221339Sdim 102221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 103221339Sdim_m_pfrsqrt(__m64 __m) { 104221339Sdim return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m); 105221339Sdim} 106221339Sdim 107221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 108221339Sdim_m_pfrsqrtit1(__m64 __m1, __m64 __m2) { 109234353Sdim return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2); 110221339Sdim} 111221339Sdim 112221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 113221339Sdim_m_pfsub(__m64 __m1, __m64 __m2) { 114221339Sdim return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2); 115221339Sdim} 116221339Sdim 117221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 118221339Sdim_m_pfsubr(__m64 __m1, __m64 __m2) { 119221339Sdim return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2); 120221339Sdim} 121221339Sdim 122221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 123221339Sdim_m_pi2fd(__m64 __m) { 124221339Sdim return (__m64)__builtin_ia32_pi2fd((__v2si)__m); 125221339Sdim} 126221339Sdim 127221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 128221339Sdim_m_pmulhrw(__m64 __m1, __m64 __m2) { 129221339Sdim return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2); 130221339Sdim} 131221339Sdim 132221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 133221339Sdim_m_pf2iw(__m64 __m) { 134221339Sdim return (__m64)__builtin_ia32_pf2iw((__v2sf)__m); 135221339Sdim} 136221339Sdim 137221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 138221339Sdim_m_pfnacc(__m64 __m1, __m64 __m2) { 139221339Sdim return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2); 140221339Sdim} 141221339Sdim 142221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 143221339Sdim_m_pfpnacc(__m64 __m1, __m64 __m2) { 144221339Sdim return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2); 145221339Sdim} 146221339Sdim 147221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 148221339Sdim_m_pi2fw(__m64 __m) { 149221339Sdim return (__m64)__builtin_ia32_pi2fw((__v2si)__m); 150221339Sdim} 151221339Sdim 152221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 153221339Sdim_m_pswapdsf(__m64 __m) { 154221339Sdim return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m); 155221339Sdim} 156221339Sdim 157221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 158221339Sdim_m_pswapdsi(__m64 __m) { 159221339Sdim return (__m64)__builtin_ia32_pswapdsi((__v2si)__m); 160221339Sdim} 161221339Sdim 162221339Sdim#endif 163