Config.h

Go to the documentation of this file.
00001 /*
00002  * Expression Template Matrix Library
00003  *
00004  * Copyright (C) 2004 - 2006 Ricky Lung <mtlung@users.sourceforge.net>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 
00030 #ifdef _MSC_VER
00031 #   pragma once
00032 #endif  // _MSC_VER
00033 
00034 #include "PlatformSpec.h"
00035 
00036 #ifndef _EXMAT_CONFIG_H
00037 #define _EXMAT_CONFIG_H
00038 
00039 
00041 // User configurations
00042 
00043 
00047 #define EXMAT_STATIC_CHECK 0
00048 
00049 // SIMD related
00053 #define EXMAT_ENABLE_SIMD 1
00054 
00057 #define EXMAT_ENABLE_SSE 1
00058 
00061 #define EXMAT_ENABLE_SSE2 1
00062 
00063 #define EXMAT_SIMD_FLOAT 1
00064 #define EXMAT_SIMD_DOUBLE 1
00065 
00067 #define ENABLE_ALIGNMENT_CHECK 0
00068 
00070 #define SIMD_ALIGN_BYTE 16
00071 
00072 #define SIMD_ALIGNED_STACK_SIZE 8000
00073 
00075 #define EXMAT_ENABLE_AM_DISPATCH 1
00076 
00078 #define ENABLE_ALIAS_ANALYSIS 1
00079 
00081 #define ENABLE_TMP_ANALYSIS 1
00082 
00084 // ASSIGN_ANALYSIS::NONE
00085 // ASSIGN_ANALYSIS::ALIAS
00086 // ASSIGN_ANALYSIS::TEMPORARY
00087 #define EXMAT_DEFAULT_ANALYSIS ASSIGN_ANALYSIS::ALIAS|ASSIGN_ANALYSIS::TEMPORARY
00088 
00090 #define ENABLE_UNROLLING 1
00091 
00092 #if ENABLE_UNROLLING
00093 namespace exmat {
00095     enum {
00096         // Control the unroll conditions
00098         MAX_UROLLROW_NOP = 15,
00100         MAX_FULLUROLL_NOP = 200,
00104         MAX_MULDOTUROLL_ENOP = 12
00105     };
00106 }   // namespace exmat
00107 #endif
00108 
00109 // End of user configurations
00111 
00112 
00113 // Platform dependent configuration refinement
00114 
00116 #define EXMAT_VC6_DEFAULT_STL 1
00117 
00118 // GCC failed to use Loki::Tuple with Loki::Field before version 3.4.0
00119 #ifdef EXMAT_GNUC
00120 //  GCC older then 3.4.0 fail to compile with Loki's tuple
00121 #   if EXMAT_GNUC_VERSION < 30400
00122 #       undef ENABLE_TMP_ANALYSIS
00123 #       define ENABLE_TMP_ANALYSIS 0
00124 #   endif
00125 #endif  // EXMAT_GNUC
00126 
00127 // If SSE2 is enabled, SSE should also be enabled too.
00128 #if EXMAT_ENABLE_SSE2
00129 #   if !EXMAT_ENABLE_SSE
00130 #       undef EXMAT_ENABLE_SSE
00131 #       define EXMAT_ENABLE_SSE 1
00132 #   endif
00133 #endif  // EXMAT_ENABLE_SSE2
00134 
00135 // Disable EXMAT_SIMD_FLOAT and EXMAT_SIMD_DOUBLE if EXMAT_SIMD_DOUBLE=0
00136 #if !EXMAT_ENABLE_SIMD
00137 #       undef EXMAT_SIMD_FLOAT
00138 #       define EXMAT_SIMD_FLOAT 0
00139 #       undef EXMAT_SIMD_DOUBLE
00140 #       define EXMAT_SIMD_DOUBLE 0
00141 #endif  // EXMAT_ENABLE_SIMD
00142 
00143 // Check int, float, double SIMD options
00144 #if EXMAT_SIMD_FLOAT
00145 #   if !EXMAT_ENABLE_SSE
00146 #       error "SSE must be enabled for EXMAT_SIMD_FLOAT=1"
00147 #   endif
00148 #endif
00149 #if EXMAT_SIMD_DOUBLE
00150 #   if !EXMAT_ENABLE_SSE2
00151 #       error "SSE2 must be enabled for EXMAT_SIMD_DOUBLE=1"
00152 #   endif
00153 #endif
00154 
00155 // Check GNUC is enabled with SIMD: eg. -msse / -msse2
00156 #if (EXMAT_GNUC && EXMAT_ENABLE_SIMD)
00157 #   if EXMAT_ENABLE_SSE
00158 #       ifndef __SSE__
00159 #           error "Use compiler option: -msse to enable SSE!"
00160 #       endif   // __SSE__
00161 #   endif
00162 #   if EXMAT_ENABLE_SSE2
00163 #       ifndef __SSE2__
00164 #           error "Use compiler option: -msse2 to enable SSE2!"
00165 #       endif   // __SSE2__
00166 #   endif
00167 #   if !defined(__SSE__) && !defined(__SSE2__)
00168 #       error "Use your compiler options to enable SIMD!"
00169 #   endif
00170 #endif  // EXMAT_GNUC
00171 
00172 #endif  // _EXMAT_CONFIG_H

Generated on Sat May 6 23:11:55 2006 for Exmat by  doxygen 1.4.6-NO