Path: blob/master/tools/android-sdk/renderscript/clang-include/mm3dnow.h
496 views
/*===---- mm3dnow.h - 3DNow! intrinsics ------------------------------------===1*2* Permission is hereby granted, free of charge, to any person obtaining a copy3* of this software and associated documentation files (the "Software"), to deal4* in the Software without restriction, including without limitation the rights5* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6* copies of the Software, and to permit persons to whom the Software is7* furnished to do so, subject to the following conditions:8*9* The above copyright notice and this permission notice shall be included in10* all copies or substantial portions of the Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN18* THE SOFTWARE.19*20*===-----------------------------------------------------------------------===21*/2223#ifndef _MM3DNOW_H_INCLUDED24#define _MM3DNOW_H_INCLUDED2526#include <mmintrin.h>27#include <prfchwintrin.h>2829typedef float __v2sf __attribute__((__vector_size__(8)));3031/* Define the default attributes for the functions in this file. */32#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnow")))3334static __inline__ void __DEFAULT_FN_ATTRS35_m_femms(void) {36__builtin_ia32_femms();37}3839static __inline__ __m64 __DEFAULT_FN_ATTRS40_m_pavgusb(__m64 __m1, __m64 __m2) {41return (__m64)__builtin_ia32_pavgusb((__v8qi)__m1, (__v8qi)__m2);42}4344static __inline__ __m64 __DEFAULT_FN_ATTRS45_m_pf2id(__m64 __m) {46return (__m64)__builtin_ia32_pf2id((__v2sf)__m);47}4849static __inline__ __m64 __DEFAULT_FN_ATTRS50_m_pfacc(__m64 __m1, __m64 __m2) {51return (__m64)__builtin_ia32_pfacc((__v2sf)__m1, (__v2sf)__m2);52}5354static __inline__ __m64 __DEFAULT_FN_ATTRS55_m_pfadd(__m64 __m1, __m64 __m2) {56return (__m64)__builtin_ia32_pfadd((__v2sf)__m1, (__v2sf)__m2);57}5859static __inline__ __m64 __DEFAULT_FN_ATTRS60_m_pfcmpeq(__m64 __m1, __m64 __m2) {61return (__m64)__builtin_ia32_pfcmpeq((__v2sf)__m1, (__v2sf)__m2);62}6364static __inline__ __m64 __DEFAULT_FN_ATTRS65_m_pfcmpge(__m64 __m1, __m64 __m2) {66return (__m64)__builtin_ia32_pfcmpge((__v2sf)__m1, (__v2sf)__m2);67}6869static __inline__ __m64 __DEFAULT_FN_ATTRS70_m_pfcmpgt(__m64 __m1, __m64 __m2) {71return (__m64)__builtin_ia32_pfcmpgt((__v2sf)__m1, (__v2sf)__m2);72}7374static __inline__ __m64 __DEFAULT_FN_ATTRS75_m_pfmax(__m64 __m1, __m64 __m2) {76return (__m64)__builtin_ia32_pfmax((__v2sf)__m1, (__v2sf)__m2);77}7879static __inline__ __m64 __DEFAULT_FN_ATTRS80_m_pfmin(__m64 __m1, __m64 __m2) {81return (__m64)__builtin_ia32_pfmin((__v2sf)__m1, (__v2sf)__m2);82}8384static __inline__ __m64 __DEFAULT_FN_ATTRS85_m_pfmul(__m64 __m1, __m64 __m2) {86return (__m64)__builtin_ia32_pfmul((__v2sf)__m1, (__v2sf)__m2);87}8889static __inline__ __m64 __DEFAULT_FN_ATTRS90_m_pfrcp(__m64 __m) {91return (__m64)__builtin_ia32_pfrcp((__v2sf)__m);92}9394static __inline__ __m64 __DEFAULT_FN_ATTRS95_m_pfrcpit1(__m64 __m1, __m64 __m2) {96return (__m64)__builtin_ia32_pfrcpit1((__v2sf)__m1, (__v2sf)__m2);97}9899static __inline__ __m64 __DEFAULT_FN_ATTRS100_m_pfrcpit2(__m64 __m1, __m64 __m2) {101return (__m64)__builtin_ia32_pfrcpit2((__v2sf)__m1, (__v2sf)__m2);102}103104static __inline__ __m64 __DEFAULT_FN_ATTRS105_m_pfrsqrt(__m64 __m) {106return (__m64)__builtin_ia32_pfrsqrt((__v2sf)__m);107}108109static __inline__ __m64 __DEFAULT_FN_ATTRS110_m_pfrsqrtit1(__m64 __m1, __m64 __m2) {111return (__m64)__builtin_ia32_pfrsqit1((__v2sf)__m1, (__v2sf)__m2);112}113114static __inline__ __m64 __DEFAULT_FN_ATTRS115_m_pfsub(__m64 __m1, __m64 __m2) {116return (__m64)__builtin_ia32_pfsub((__v2sf)__m1, (__v2sf)__m2);117}118119static __inline__ __m64 __DEFAULT_FN_ATTRS120_m_pfsubr(__m64 __m1, __m64 __m2) {121return (__m64)__builtin_ia32_pfsubr((__v2sf)__m1, (__v2sf)__m2);122}123124static __inline__ __m64 __DEFAULT_FN_ATTRS125_m_pi2fd(__m64 __m) {126return (__m64)__builtin_ia32_pi2fd((__v2si)__m);127}128129static __inline__ __m64 __DEFAULT_FN_ATTRS130_m_pmulhrw(__m64 __m1, __m64 __m2) {131return (__m64)__builtin_ia32_pmulhrw((__v4hi)__m1, (__v4hi)__m2);132}133134/* Handle the 3dnowa instructions here. */135#undef __DEFAULT_FN_ATTRS136#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("3dnowa")))137138static __inline__ __m64 __DEFAULT_FN_ATTRS139_m_pf2iw(__m64 __m) {140return (__m64)__builtin_ia32_pf2iw((__v2sf)__m);141}142143static __inline__ __m64 __DEFAULT_FN_ATTRS144_m_pfnacc(__m64 __m1, __m64 __m2) {145return (__m64)__builtin_ia32_pfnacc((__v2sf)__m1, (__v2sf)__m2);146}147148static __inline__ __m64 __DEFAULT_FN_ATTRS149_m_pfpnacc(__m64 __m1, __m64 __m2) {150return (__m64)__builtin_ia32_pfpnacc((__v2sf)__m1, (__v2sf)__m2);151}152153static __inline__ __m64 __DEFAULT_FN_ATTRS154_m_pi2fw(__m64 __m) {155return (__m64)__builtin_ia32_pi2fw((__v2si)__m);156}157158static __inline__ __m64 __DEFAULT_FN_ATTRS159_m_pswapdsf(__m64 __m) {160return (__m64)__builtin_ia32_pswapdsf((__v2sf)__m);161}162163static __inline__ __m64 __DEFAULT_FN_ATTRS164_m_pswapdsi(__m64 __m) {165return (__m64)__builtin_ia32_pswapdsi((__v2si)__m);166}167168#undef __DEFAULT_FN_ATTRS169170#endif171172173