OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [libc/] [machine/] [spu/] [vec_literal.h] - Diff between revs 207 and 345

Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/*
/*
  (C) Copyright 2001,2006,
  (C) Copyright 2001,2006,
  International Business Machines Corporation,
  International Business Machines Corporation,
  Sony Computer Entertainment, Incorporated,
  Sony Computer Entertainment, Incorporated,
  Toshiba Corporation,
  Toshiba Corporation,
 
 
  All rights reserved.
  All rights reserved.
 
 
  Redistribution and use in source and binary forms, with or without
  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:
  modification, are permitted provided that the following conditions are met:
 
 
    * Redistributions of source code must retain the above copyright notice,
    * Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.
  this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
    * Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
  documentation and/or other materials provided with the distribution.
    * Neither the names of the copyright holders nor the names of their
    * Neither the names of the copyright holders nor the names of their
  contributors may be used to endorse or promote products derived from this
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.
  software without specific prior written permission.
 
 
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.
  POSSIBILITY OF SUCH DAMAGE.
*/
*/
 
 
#ifndef _VEC_LITERAL_H_
#ifndef _VEC_LITERAL_H_
#define _VEC_LITERAL_H_
#define _VEC_LITERAL_H_
 
 
/* This header files provides an abstraction for the various implementations
/* This header files provides an abstraction for the various implementations
 * of vector literal construction. The two formats are:
 * of vector literal construction. The two formats are:
 *
 *
 * 1) Altivec styled using parenthesis
 * 1) Altivec styled using parenthesis
 * 2) C grammer friendly styled using curly braces
 * 2) C grammer friendly styled using curly braces
 *
 *
 * The macro, VEC_LITERAL has been developed to provide some portability
 * The macro, VEC_LITERAL has been developed to provide some portability
 * in these two styles. To achieve true portability, user must specify all
 * in these two styles. To achieve true portability, user must specify all
 * elements of the vector being initialized. A single element can be provided
 * elements of the vector being initialized. A single element can be provided
 * but only the first element guarenteed across both construction styles.
 * but only the first element guarenteed across both construction styles.
 *
 *
 * The VEC_SPLAT_* macros have been provided for portability of vector literal
 * The VEC_SPLAT_* macros have been provided for portability of vector literal
 * construction when all the elements of the vector contain the same value.
 * construction when all the elements of the vector contain the same value.
 */
 */
 
 
/* Use curly brace style.
/* Use curly brace style.
 */
 */
#define VEC_LITERAL(_type, ...) ((_type){__VA_ARGS__})
#define VEC_LITERAL(_type, ...) ((_type){__VA_ARGS__})
 
 
#define VEC_SPLAT_U8(_val)      ((__vector unsigned char){_val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_U8(_val)      ((__vector unsigned char){_val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_S8(_val)      ((__vector signed char){_val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_S8(_val)      ((__vector signed char){_val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val, _val})
 
 
#define VEC_SPLAT_U16(_val)     ((__vector unsigned short){_val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_U16(_val)     ((__vector unsigned short){_val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_S16(_val)     ((__vector signed short){_val, _val, _val, _val, _val, _val, _val, _val})
#define VEC_SPLAT_S16(_val)     ((__vector signed short){_val, _val, _val, _val, _val, _val, _val, _val})
 
 
#define VEC_SPLAT_U32(_val)     ((__vector unsigned int){_val, _val, _val, _val})
#define VEC_SPLAT_U32(_val)     ((__vector unsigned int){_val, _val, _val, _val})
#define VEC_SPLAT_S32(_val)     ((__vector signed int){_val, _val, _val, _val})
#define VEC_SPLAT_S32(_val)     ((__vector signed int){_val, _val, _val, _val})
#define VEC_SPLAT_F32(_val)     ((__vector float){_val, _val, _val, _val})
#define VEC_SPLAT_F32(_val)     ((__vector float){_val, _val, _val, _val})
 
 
#define VEC_SPLAT_U64(_val)     ((__vector unsigned long long){_val, _val})
#define VEC_SPLAT_U64(_val)     ((__vector unsigned long long){_val, _val})
#define VEC_SPLAT_S64(_val)     ((__vector signed long long){_val, _val})
#define VEC_SPLAT_S64(_val)     ((__vector signed long long){_val, _val})
#define VEC_SPLAT_F64(_val)     ((__vector double){_val, _val})
#define VEC_SPLAT_F64(_val)     ((__vector double){_val, _val})
 
 
#endif /* _VEC_LITERAL_H_ */
#endif /* _VEC_LITERAL_H_ */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.