mm3dnow.h revision 288943
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 32288943Sdim/* Define the default attributes for the functions in this file. */ 33288943Sdim#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) 34288943Sdim 35288943Sdimstatic __inline__ void __DEFAULT_FN_ATTRS 36221339Sdim_m_femms() { 37221339Sdim __builtin_ia32_femms(); 38221339Sdim} 39221339Sdim 40288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 41221339Sdim_m_pavgusb(__m64 __m1, __m64 __m2) { 42221339Sdim return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2); 43221339Sdim} 44221339Sdim 45288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 46221339Sdim_m_pf2id(__m64 __m) { 47221339Sdim return (__m64)__builtin_ia32_pf2id((__v2sf)__m); 48221339Sdim} 49221339Sdim 50288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 51221339Sdim_m_pfacc(__m64 __m1, __m64 __m2) { 52221339Sdim return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2); 53221339Sdim} 54221339Sdim 55288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 56221339Sdim_m_pfadd(__m64 __m1, __m64 __m2) { 57221339Sdim return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2); 58221339Sdim} 59221339Sdim 60288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 61221339Sdim_m_pfcmpeq(__m64 __m1, __m64 __m2) { 62221339Sdim return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2); 63221339Sdim} 64221339Sdim 65288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 66221339Sdim_m_pfcmpge(__m64 __m1, __m64 __m2) { 67221339Sdim return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2); 68221339Sdim} 69221339Sdim 70288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 71221339Sdim_m_pfcmpgt(__m64 __m1, __m64 __m2) { 72221339Sdim return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2); 73221339Sdim} 74221339Sdim 75288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 76221339Sdim_m_pfmax(__m64 __m1, __m64 __m2) { 77221339Sdim return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2); 78221339Sdim} 79221339Sdim 80288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 81221339Sdim_m_pfmin(__m64 __m1, __m64 __m2) { 82221339Sdim return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2); 83221339Sdim} 84221339Sdim 85288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 86221339Sdim_m_pfmul(__m64 __m1, __m64 __m2) { 87221339Sdim return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2); 88221339Sdim} 89221339Sdim 90288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 91221339Sdim_m_pfrcp(__m64 __m) { 92221339Sdim return (__m64)__builtin_ia32_pfrcp((__v2sf)__m); 93221339Sdim} 94221339Sdim 95288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 96221339Sdim_m_pfrcpit1(__m64 __m1, __m64 __m2) { 97221339Sdim return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2); 98221339Sdim} 99221339Sdim 100288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 101221339Sdim_m_pfrcpit2(__m64 __m1, __m64 __m2) { 102221339Sdim return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2); 103221339Sdim} 104221339Sdim 105288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 106221339Sdim_m_pfrsqrt(__m64 __m) { 107221339Sdim return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m); 108221339Sdim} 109221339Sdim 110288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 111221339Sdim_m_pfrsqrtit1(__m64 __m1, __m64 __m2) { 112234353Sdim return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2); 113221339Sdim} 114221339Sdim 115288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 116221339Sdim_m_pfsub(__m64 __m1, __m64 __m2) { 117221339Sdim return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2); 118221339Sdim} 119221339Sdim 120288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 121221339Sdim_m_pfsubr(__m64 __m1, __m64 __m2) { 122221339Sdim return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2); 123221339Sdim} 124221339Sdim 125288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 126221339Sdim_m_pi2fd(__m64 __m) { 127221339Sdim return (__m64)__builtin_ia32_pi2fd((__v2si)__m); 128221339Sdim} 129221339Sdim 130288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 131221339Sdim_m_pmulhrw(__m64 __m1, __m64 __m2) { 132221339Sdim return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2); 133221339Sdim} 134221339Sdim 135288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 136221339Sdim_m_pf2iw(__m64 __m) { 137221339Sdim return (__m64)__builtin_ia32_pf2iw((__v2sf)__m); 138221339Sdim} 139221339Sdim 140288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 141221339Sdim_m_pfnacc(__m64 __m1, __m64 __m2) { 142221339Sdim return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2); 143221339Sdim} 144221339Sdim 145288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 146221339Sdim_m_pfpnacc(__m64 __m1, __m64 __m2) { 147221339Sdim return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2); 148221339Sdim} 149221339Sdim 150288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 151221339Sdim_m_pi2fw(__m64 __m) { 152221339Sdim return (__m64)__builtin_ia32_pi2fw((__v2si)__m); 153221339Sdim} 154221339Sdim 155288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 156221339Sdim_m_pswapdsf(__m64 __m) { 157221339Sdim return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m); 158221339Sdim} 159221339Sdim 160288943Sdimstatic __inline__ __m64 __DEFAULT_FN_ATTRS 161221339Sdim_m_pswapdsi(__m64 __m) { 162221339Sdim return (__m64)__builtin_ia32_pswapdsi((__v2si)__m); 163221339Sdim} 164221339Sdim 165288943Sdim#undef __DEFAULT_FN_ATTRS 166288943Sdim 167221339Sdim#endif 168