clang API Documentation

mm3dnow.h
Go to the documentation of this file.
00001 /*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------===
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining a copy
00004  * of this software and associated documentation files (the "Software"), to deal
00005  * in the Software without restriction, including without limitation the rights
00006  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00007  * copies of the Software, and to permit persons to whom the Software is
00008  * furnished to do so, subject to the following conditions:
00009  *
00010  * The above copyright notice and this permission notice shall be included in
00011  * all copies or substantial portions of the Software.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00016  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00017  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00018  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00019  * THE SOFTWARE.
00020  *
00021  *===-----------------------------------------------------------------------===
00022  */
00023 
00024 #ifndef _MM3DNOW_H_INCLUDED
00025 #define _MM3DNOW_H_INCLUDED
00026 
00027 #include <mmintrin.h>
00028 #include <prfchwintrin.h>
00029 
00030 typedef float __v2sf __attribute__((__vector_size__(8)));
00031 
00032 static __inline__ void __attribute__((__always_inline__, __nodebug__))
00033 _m_femms() {
00034   __builtin_ia32_femms();
00035 }
00036 
00037 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00038 _m_pavgusb(__m64 __m1, __m64 __m2) {
00039   return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);
00040 }
00041 
00042 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00043 _m_pf2id(__m64 __m) {
00044   return (__m64)__builtin_ia32_pf2id((__v2sf)__m);
00045 }
00046 
00047 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00048 _m_pfacc(__m64 __m1, __m64 __m2) {
00049   return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);
00050 }
00051 
00052 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00053 _m_pfadd(__m64 __m1, __m64 __m2) {
00054   return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2);
00055 }
00056 
00057 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00058 _m_pfcmpeq(__m64 __m1, __m64 __m2) {
00059   return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2);
00060 }
00061 
00062 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00063 _m_pfcmpge(__m64 __m1, __m64 __m2) {
00064   return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2);
00065 }
00066 
00067 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00068 _m_pfcmpgt(__m64 __m1, __m64 __m2) {
00069   return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2);
00070 }
00071 
00072 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00073 _m_pfmax(__m64 __m1, __m64 __m2) {
00074   return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2);
00075 }
00076 
00077 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00078 _m_pfmin(__m64 __m1, __m64 __m2) {
00079   return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2);
00080 }
00081 
00082 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00083 _m_pfmul(__m64 __m1, __m64 __m2) {
00084   return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2);
00085 }
00086 
00087 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00088 _m_pfrcp(__m64 __m) {
00089   return (__m64)__builtin_ia32_pfrcp((__v2sf)__m);
00090 }
00091 
00092 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00093 _m_pfrcpit1(__m64 __m1, __m64 __m2) {
00094   return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2);
00095 }
00096 
00097 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00098 _m_pfrcpit2(__m64 __m1, __m64 __m2) {
00099   return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2);
00100 }
00101 
00102 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00103 _m_pfrsqrt(__m64 __m) {
00104   return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m);
00105 }
00106 
00107 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00108 _m_pfrsqrtit1(__m64 __m1, __m64 __m2) {
00109   return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2);
00110 }
00111 
00112 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00113 _m_pfsub(__m64 __m1, __m64 __m2) {
00114   return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2);
00115 }
00116 
00117 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00118 _m_pfsubr(__m64 __m1, __m64 __m2) {
00119   return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2);
00120 }
00121 
00122 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00123 _m_pi2fd(__m64 __m) {
00124   return (__m64)__builtin_ia32_pi2fd((__v2si)__m);
00125 }
00126 
00127 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00128 _m_pmulhrw(__m64 __m1, __m64 __m2) {
00129   return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2);
00130 }
00131 
00132 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00133 _m_pf2iw(__m64 __m) {
00134   return (__m64)__builtin_ia32_pf2iw((__v2sf)__m);
00135 }
00136 
00137 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00138 _m_pfnacc(__m64 __m1, __m64 __m2) {
00139   return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2);
00140 }
00141 
00142 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00143 _m_pfpnacc(__m64 __m1, __m64 __m2) {
00144   return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2);
00145 }
00146 
00147 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00148 _m_pi2fw(__m64 __m) {
00149   return (__m64)__builtin_ia32_pi2fw((__v2si)__m);
00150 }
00151 
00152 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00153 _m_pswapdsf(__m64 __m) {
00154   return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m);
00155 }
00156 
00157 static __inline__ __m64 __attribute__((__always_inline__, __nodebug__))
00158 _m_pswapdsi(__m64 __m) {
00159   return (__m64)__builtin_ia32_pswapdsi((__v2si)__m);
00160 }
00161 
00162 #endif