1 /*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------===
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 *===-----------------------------------------------------------------------===
24 #ifndef _MM3DNOW_H_INCLUDED
25 #define _MM3DNOW_H_INCLUDED
28 #include <prfchwintrin.h>
30 typedef float __v2sf __attribute__((__vector_size__(8)));
32 /* Define the default attributes for the functions in this file. */
33 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
35 static __inline__ void __DEFAULT_FN_ATTRS
37 __builtin_ia32_femms();
40 static __inline__ __m64 __DEFAULT_FN_ATTRS
41 _m_pavgusb(__m64 __m1, __m64 __m2) {
42 return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);
45 static __inline__ __m64 __DEFAULT_FN_ATTRS
47 return (__m64)__builtin_ia32_pf2id((__v2sf)__m);
50 static __inline__ __m64 __DEFAULT_FN_ATTRS
51 _m_pfacc(__m64 __m1, __m64 __m2) {
52 return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);
55 static __inline__ __m64 __DEFAULT_FN_ATTRS
56 _m_pfadd(__m64 __m1, __m64 __m2) {
57 return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2);
60 static __inline__ __m64 __DEFAULT_FN_ATTRS
61 _m_pfcmpeq(__m64 __m1, __m64 __m2) {
62 return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2);
65 static __inline__ __m64 __DEFAULT_FN_ATTRS
66 _m_pfcmpge(__m64 __m1, __m64 __m2) {
67 return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2);
70 static __inline__ __m64 __DEFAULT_FN_ATTRS
71 _m_pfcmpgt(__m64 __m1, __m64 __m2) {
72 return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2);
75 static __inline__ __m64 __DEFAULT_FN_ATTRS
76 _m_pfmax(__m64 __m1, __m64 __m2) {
77 return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2);
80 static __inline__ __m64 __DEFAULT_FN_ATTRS
81 _m_pfmin(__m64 __m1, __m64 __m2) {
82 return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2);
85 static __inline__ __m64 __DEFAULT_FN_ATTRS
86 _m_pfmul(__m64 __m1, __m64 __m2) {
87 return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2);
90 static __inline__ __m64 __DEFAULT_FN_ATTRS
92 return (__m64)__builtin_ia32_pfrcp((__v2sf)__m);
95 static __inline__ __m64 __DEFAULT_FN_ATTRS
96 _m_pfrcpit1(__m64 __m1, __m64 __m2) {
97 return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2);
100 static __inline__ __m64 __DEFAULT_FN_ATTRS
101 _m_pfrcpit2(__m64 __m1, __m64 __m2) {
102 return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2);
105 static __inline__ __m64 __DEFAULT_FN_ATTRS
106 _m_pfrsqrt(__m64 __m) {
107 return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m);
110 static __inline__ __m64 __DEFAULT_FN_ATTRS
111 _m_pfrsqrtit1(__m64 __m1, __m64 __m2) {
112 return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2);
115 static __inline__ __m64 __DEFAULT_FN_ATTRS
116 _m_pfsub(__m64 __m1, __m64 __m2) {
117 return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2);
120 static __inline__ __m64 __DEFAULT_FN_ATTRS
121 _m_pfsubr(__m64 __m1, __m64 __m2) {
122 return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2);
125 static __inline__ __m64 __DEFAULT_FN_ATTRS
126 _m_pi2fd(__m64 __m) {
127 return (__m64)__builtin_ia32_pi2fd((__v2si)__m);
130 static __inline__ __m64 __DEFAULT_FN_ATTRS
131 _m_pmulhrw(__m64 __m1, __m64 __m2) {
132 return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2);
135 static __inline__ __m64 __DEFAULT_FN_ATTRS
136 _m_pf2iw(__m64 __m) {
137 return (__m64)__builtin_ia32_pf2iw((__v2sf)__m);
140 static __inline__ __m64 __DEFAULT_FN_ATTRS
141 _m_pfnacc(__m64 __m1, __m64 __m2) {
142 return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2);
145 static __inline__ __m64 __DEFAULT_FN_ATTRS
146 _m_pfpnacc(__m64 __m1, __m64 __m2) {
147 return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2);
150 static __inline__ __m64 __DEFAULT_FN_ATTRS
151 _m_pi2fw(__m64 __m) {
152 return (__m64)__builtin_ia32_pi2fw((__v2si)__m);
155 static __inline__ __m64 __DEFAULT_FN_ATTRS
156 _m_pswapdsf(__m64 __m) {
157 return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m);
160 static __inline__ __m64 __DEFAULT_FN_ATTRS
161 _m_pswapdsi(__m64 __m) {
162 return (__m64)__builtin_ia32_pswapdsi((__v2si)__m);
165 #undef __DEFAULT_FN_ATTRS