rc_platform.h

Go to the documentation of this file.
00001 /*  Copyright (C) 2005-2016, Axis Communications AB, LUND, SWEDEN
00002  *
00003  *  This file is part of RAPP.
00004  *
00005  *  RAPP is free software: you can redistribute it and/or modify
00006  *  it under the terms of the GNU Lesser General Public License as published
00007  *  by the Free Software Foundation, either version 3 of the License, or
00008  *  (at your option) any later version.
00009  *  You can use the comments under either the terms of the GNU Lesser General
00010  *  Public License version 3 as published by the Free Software Foundation,
00011  *  either version 3 of the License or (at your option) any later version, or
00012  *  the GNU Free Documentation License version 1.3 or any later version
00013  *  published by the Free Software Foundation; with no Invariant Sections, no
00014  *  Front-Cover Texts, and no Back-Cover Texts.
00015  *  A copy of the license is included in the documentation section entitled
00016  *  "GNU Free Documentation License".
00017  *
00018  *  RAPP is distributed in the hope that it will be useful,
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00021  *  GNU Lesser General Public License for more details.
00022  *
00023  *  You should have received a copy of the GNU Lesser General Public
00024  *  License and a copy of the GNU Free Documentation License along
00025  *  with RAPP. If not, see <http://www.gnu.org/licenses/>.
00026  */
00027 
00033 #ifndef RC_PLATFORM_H
00034 #define RC_PLATFORM_H
00035 
00036 /* Include config.h generated by configure */
00037 #if HAVE_CONFIG_H
00038 #include <config.h>
00039 #endif
00040 
00041 #include <stdint.h>  /* Fixed-size integers     */
00042 #include <limits.h>  /* UINTPTR_MAX, USHORT_MAX */
00043 
00044 
00045 /*
00046  * -------------------------------------------------------------
00047  *  Constants
00048  * -------------------------------------------------------------
00049  */
00050 
00054 #define RC_GCC_VERSION (1000*__GNUC__ + __GNUC_MINOR__)
00055 
00059 #ifdef WORDS_BIGENDIAN
00060 #define RC_BIG_ENDIAN 1
00061 #else
00062 #define RC_LITTLE_ENDIAN 1
00063 #endif
00064 
00069 #ifdef  RAPP_FORCE_SIZE
00070 #define RC_NATIVE_SIZE RAPP_FORCE_SIZE
00071 
00072 #else
00073 
00074 /* See configure.ac; it's trivial but better have it in one place only. */
00075 #define RC_NATIVE_SIZE RC_COMPUTED_NATIVE_SIZE
00076 
00077 #endif
00078 
00084 #if defined __SSE2__ || defined __VEC__ || defined __ALTIVEC__ || \
00085     defined __SSSE3__ || defined __VADMX2__
00086 #define RC_ALIGNMENT 16
00087 
00088 #elif defined __MMX__ || defined __SSE__ || defined __VADMX__ || \
00089       defined __mips_loongson_vector_rev || defined __ARM_NEON__ || \
00090       defined RC_VEC_BACKEND_VIS || \
00091       RC_NATIVE_SIZE == 8
00092 #define RC_ALIGNMENT 8
00093 
00094 #else
00095 #define RC_ALIGNMENT 4
00096 #endif
00097 
00101 #if defined __GNUC__ && RC_GCC_VERSION > 3001
00102 #define RC_NOINLINE __attribute__((noinline))
00103 #else
00104 #define RC_NOINLINE
00105 #endif
00106 
00107 
00108 /*
00109  * -------------------------------------------------------------
00110  *  Macros
00111  * -------------------------------------------------------------
00112  */
00113 
00118 #if defined __GNUC__ && RC_GCC_VERSION > 2095
00119 #define RC_LIKELY(expr)   __builtin_expect((expr) != 0, 1)
00120 #define RC_UNLIKELY(expr) __builtin_expect((expr), 0)
00121 #else
00122 #define RC_LIKELY(expr)   (expr)
00123 #define RC_UNLIKELY(expr) (expr)
00124 #endif
00125 
00126 #endif /* RC_PLATFORM_H */

Generated on 1 Jun 2016 for RAPP Compute by  doxygen 1.6.1