mm3dnow.h revision 221339
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> 28221339Sdim 29221339Sdimtypedef float __v2sf __attribute__((__vector_size__(8))); 30221339Sdim 31221339Sdimstatic __inline__ void __attribute__((__always_inline__, __nodebug__)) 32221339Sdim_m_femms() { 33221339Sdim __builtin_ia32_femms(); 34221339Sdim} 35221339Sdim 36221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 37221339Sdim_m_pavgusb(__m64 __m1, __m64 __m2) { 38221339Sdim return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2); 39221339Sdim} 40221339Sdim 41221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 42221339Sdim_m_pf2id(__m64 __m) { 43221339Sdim return (__m64)__builtin_ia32_pf2id((__v2sf)__m); 44221339Sdim} 45221339Sdim 46221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 47221339Sdim_m_pfacc(__m64 __m1, __m64 __m2) { 48221339Sdim return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2); 49221339Sdim} 50221339Sdim 51221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 52221339Sdim_m_pfadd(__m64 __m1, __m64 __m2) { 53221339Sdim return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2); 54221339Sdim} 55221339Sdim 56221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 57221339Sdim_m_pfcmpeq(__m64 __m1, __m64 __m2) { 58221339Sdim return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2); 59221339Sdim} 60221339Sdim 61221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 62221339Sdim_m_pfcmpge(__m64 __m1, __m64 __m2) { 63221339Sdim return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2); 64221339Sdim} 65221339Sdim 66221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 67221339Sdim_m_pfcmpgt(__m64 __m1, __m64 __m2) { 68221339Sdim return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2); 69221339Sdim} 70221339Sdim 71221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 72221339Sdim_m_pfmax(__m64 __m1, __m64 __m2) { 73221339Sdim return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2); 74221339Sdim} 75221339Sdim 76221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 77221339Sdim_m_pfmin(__m64 __m1, __m64 __m2) { 78221339Sdim return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2); 79221339Sdim} 80221339Sdim 81221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 82221339Sdim_m_pfmul(__m64 __m1, __m64 __m2) { 83221339Sdim return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2); 84221339Sdim} 85221339Sdim 86221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 87221339Sdim_m_pfrcp(__m64 __m) { 88221339Sdim return (__m64)__builtin_ia32_pfrcp((__v2sf)__m); 89221339Sdim} 90221339Sdim 91221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 92221339Sdim_m_pfrcpit1(__m64 __m1, __m64 __m2) { 93221339Sdim return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2); 94221339Sdim} 95221339Sdim 96221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 97221339Sdim_m_pfrcpit2(__m64 __m1, __m64 __m2) { 98221339Sdim return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2); 99221339Sdim} 100221339Sdim 101221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 102221339Sdim_m_pfrsqrt(__m64 __m) { 103221339Sdim return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m); 104221339Sdim} 105221339Sdim 106221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 107221339Sdim_m_pfrsqrtit1(__m64 __m1, __m64 __m2) { 108221339Sdim return (__m64)__builtin_ia32_pfrsqrtit1((__v2sf)__m1, (__v2sf)__m2); 109221339Sdim} 110221339Sdim 111221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 112221339Sdim_m_pfsub(__m64 __m1, __m64 __m2) { 113221339Sdim return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2); 114221339Sdim} 115221339Sdim 116221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 117221339Sdim_m_pfsubr(__m64 __m1, __m64 __m2) { 118221339Sdim return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2); 119221339Sdim} 120221339Sdim 121221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 122221339Sdim_m_pi2fd(__m64 __m) { 123221339Sdim return (__m64)__builtin_ia32_pi2fd((__v2si)__m); 124221339Sdim} 125221339Sdim 126221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 127221339Sdim_m_pmulhrw(__m64 __m1, __m64 __m2) { 128221339Sdim return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2); 129221339Sdim} 130221339Sdim 131221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 132221339Sdim_m_pf2iw(__m64 __m) { 133221339Sdim return (__m64)__builtin_ia32_pf2iw((__v2sf)__m); 134221339Sdim} 135221339Sdim 136221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 137221339Sdim_m_pfnacc(__m64 __m1, __m64 __m2) { 138221339Sdim return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2); 139221339Sdim} 140221339Sdim 141221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 142221339Sdim_m_pfpnacc(__m64 __m1, __m64 __m2) { 143221339Sdim return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2); 144221339Sdim} 145221339Sdim 146221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 147221339Sdim_m_pi2fw(__m64 __m) { 148221339Sdim return (__m64)__builtin_ia32_pi2fw((__v2si)__m); 149221339Sdim} 150221339Sdim 151221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 152221339Sdim_m_pswapdsf(__m64 __m) { 153221339Sdim return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m); 154221339Sdim} 155221339Sdim 156221339Sdimstatic __inline__ __m64 __attribute__((__always_inline__, __nodebug__)) 157221339Sdim_m_pswapdsi(__m64 __m) { 158221339Sdim return (__m64)__builtin_ia32_pswapdsi((__v2si)__m); 159221339Sdim} 160221339Sdim 161221339Sdim#endif 162