/*===---- altivec.h - Standard header for type generic math ---------------===*\
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
\*===----------------------------------------------------------------------===*/
#ifndef __ALTIVEC_H
#define __ALTIVEC_H
#ifndef __ALTIVEC__
#error "AltiVec support not enabled"
#endif
/* constants for mapping CR6 bits to predicate result. */
#define __CR6_EQ 0
#define __CR6_EQ_REV 1
#define __CR6_LT 2
#define __CR6_LT_REV 3
#define _ATTRS_o_ai __attribute__((__overloadable__, __always_inline__))
/* vec_abs */
#define __builtin_vec_abs vec_abs
#define __builtin_altivec_abs_v16qi vec_abs
#define __builtin_altivec_abs_v8hi vec_abs
#define __builtin_altivec_abs_v4si vec_abs
static vector signed char _ATTRS_o_ai
vec_abs(vector signed char a)
{
return __builtin_altivec_vmaxsb(a, -a);
}
static vector signed short _ATTRS_o_ai
vec_abs(vector signed short a)
{
return __builtin_altivec_vmaxsh(a, -a);
}
static vector signed int _ATTRS_o_ai
vec_abs(vector signed int a)
{
return __builtin_altivec_vmaxsw(a, -a);
}
static vector