1 /* Copyright (C) 2004, 2007 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GCC; see the file COPYING. If not, write to
17 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA. */
20 /* As a special exception, if you include this header file into source
21 files compiled by GCC, this header file does not by itself cause
22 the resulting executable to be covered by the GNU General Public
23 License. This exception does not however invalidate any other
24 reasons why the executable file might be covered by the GNU General
27 /* Implemented from the mm3dnow.h (of supposedly AMD origin) included with
30 #ifndef _MM3DNOW_H_INCLUDED
31 #define _MM3DNOW_H_INCLUDED
37 /* Internal data types for implementing the intrinsics. */
38 typedef float __v2sf
__attribute__ ((__vector_size__ (8)));
40 extern __inline
void __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
43 __builtin_ia32_femms();
46 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
47 _m_pavgusb (__m64 __A
, __m64 __B
)
49 return (__m64
)__builtin_ia32_pavgusb ((__v8qi
)__A
, (__v8qi
)__B
);
52 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
55 return (__m64
)__builtin_ia32_pf2id ((__v2sf
)__A
);
58 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
59 _m_pfacc (__m64 __A
, __m64 __B
)
61 return (__m64
)__builtin_ia32_pfacc ((__v2sf
)__A
, (__v2sf
)__B
);
64 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
65 _m_pfadd (__m64 __A
, __m64 __B
)
67 return (__m64
)__builtin_ia32_pfadd ((__v2sf
)__A
, (__v2sf
)__B
);
70 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
71 _m_pfcmpeq (__m64 __A
, __m64 __B
)
73 return (__m64
)__builtin_ia32_pfcmpeq ((__v2sf
)__A
, (__v2sf
)__B
);
76 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
77 _m_pfcmpge (__m64 __A
, __m64 __B
)
79 return (__m64
)__builtin_ia32_pfcmpge ((__v2sf
)__A
, (__v2sf
)__B
);
82 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
83 _m_pfcmpgt (__m64 __A
, __m64 __B
)
85 return (__m64
)__builtin_ia32_pfcmpgt ((__v2sf
)__A
, (__v2sf
)__B
);
88 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
89 _m_pfmax (__m64 __A
, __m64 __B
)
91 return (__m64
)__builtin_ia32_pfmax ((__v2sf
)__A
, (__v2sf
)__B
);
94 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
95 _m_pfmin (__m64 __A
, __m64 __B
)
97 return (__m64
)__builtin_ia32_pfmin ((__v2sf
)__A
, (__v2sf
)__B
);
100 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
101 _m_pfmul (__m64 __A
, __m64 __B
)
103 return (__m64
)__builtin_ia32_pfmul ((__v2sf
)__A
, (__v2sf
)__B
);
106 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
109 return (__m64
)__builtin_ia32_pfrcp ((__v2sf
)__A
);
112 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
113 _m_pfrcpit1 (__m64 __A
, __m64 __B
)
115 return (__m64
)__builtin_ia32_pfrcpit1 ((__v2sf
)__A
, (__v2sf
)__B
);
118 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
119 _m_pfrcpit2 (__m64 __A
, __m64 __B
)
121 return (__m64
)__builtin_ia32_pfrcpit2 ((__v2sf
)__A
, (__v2sf
)__B
);
124 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
125 _m_pfrsqrt (__m64 __A
)
127 return (__m64
)__builtin_ia32_pfrsqrt ((__v2sf
)__A
);
130 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
131 _m_pfrsqit1 (__m64 __A
, __m64 __B
)
133 return (__m64
)__builtin_ia32_pfrsqit1 ((__v2sf
)__A
, (__v2sf
)__B
);
136 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
137 _m_pfsub (__m64 __A
, __m64 __B
)
139 return (__m64
)__builtin_ia32_pfsub ((__v2sf
)__A
, (__v2sf
)__B
);
142 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
143 _m_pfsubr (__m64 __A
, __m64 __B
)
145 return (__m64
)__builtin_ia32_pfsubr ((__v2sf
)__A
, (__v2sf
)__B
);
148 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
151 return (__m64
)__builtin_ia32_pi2fd ((__v2si
)__A
);
154 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
155 _m_pmulhrw (__m64 __A
, __m64 __B
)
157 return (__m64
)__builtin_ia32_pmulhrw ((__v4hi
)__A
, (__v4hi
)__B
);
160 extern __inline
void __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
161 _m_prefetch (void *__P
)
163 __builtin_prefetch (__P
, 0, 3 /* _MM_HINT_T0 */);
166 extern __inline
void __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
167 _m_prefetchw (void *__P
)
169 __builtin_prefetch (__P
, 1, 3 /* _MM_HINT_T0 */);
172 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
173 _m_from_float (float __A
)
175 return __extension__ (__m64
)(__v2sf
){ __A
, 0.0f
};
178 extern __inline
float __attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
179 _m_to_float (__m64 __A
)
181 union { __v2sf v
; float a
[2]; } __tmp
;
182 __tmp
.v
= (__v2sf
)__A
;
188 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
191 return (__m64
)__builtin_ia32_pf2iw ((__v2sf
)__A
);
194 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
195 _m_pfnacc (__m64 __A
, __m64 __B
)
197 return (__m64
)__builtin_ia32_pfnacc ((__v2sf
)__A
, (__v2sf
)__B
);
200 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
201 _m_pfpnacc (__m64 __A
, __m64 __B
)
203 return (__m64
)__builtin_ia32_pfpnacc ((__v2sf
)__A
, (__v2sf
)__B
);
206 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
209 return (__m64
)__builtin_ia32_pi2fw ((__v2si
)__A
);
212 extern __inline __m64
__attribute__((__gnu_inline__
, __always_inline__
, __artificial__
))
213 _m_pswapd (__m64 __A
)
215 return (__m64
)__builtin_ia32_pswapdsf ((__v2sf
)__A
);
218 #endif /* __3dNOW_A__ */
219 #endif /* __3dNOW__ */
221 #endif /* _MM3DNOW_H_INCLUDED */