/** Various declarations and macros shared by several .c files, but useless to users of the library @file scs_private.h @author Defour David David.Defour@ens-lyon.fr @author Florent de Dinechin Florent.de.Dinechin@ens-lyon.fr */ /* Copyright (C) 2002 David Defour and Florent de Dinechin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef SCS_PRIVATE_H #define SCS_PRIVATE_H 1 #define SCS_RADIX ((unsigned int)(1<h_word #define R_SGN result->sign #define R_IND result->index #define R_EXP result->exception.d #define X_HW x->h_word #define X_SGN x->sign #define X_IND x->index #define X_EXP x->exception.d #define Y_HW y->h_word #define Y_SGN y->sign #define Y_IND y->index #define Y_EXP y->exception.d #define Z_HW z->h_word #define Z_SGN z->sign #define Z_IND z->index #define Z_EXP z->exception.d #define W_HW w->h_word #define W_SGN w->sign #define W_IND w->index #define W_EXP w->exception.d /* A few additional defines for the case when we use floating-point multiplier (OBSOLETE, NEVER USED ANYMORE but who knows, some day) */ #ifdef SCS_USE_FLT_MULT /* There is a "53" below, which means that these constants won't do what we expect from them on x86 because of the double extended precision. We could put more ifdefs, but why care, nobody wants to use the FP muls on the x86. */ #ifdef WORDS_BIGENDIAN static const db_number scs_flt_trunc_cst = {{ ((1023+SCS_NB_BITS-1)<<20) , 0x00000000 }}; static const db_number scs_flt_shift_cst = {{ ((1023+SCS_NB_BITS+53)<<20),0x00000000}}; #else static const db_number scs_flt_trunc_cst = {{ 0x00000000, ((1023+SCS_NB_BITS-1)<<20) }}; static const db_number scs_flt_shift_cst = {{ 0x00000000 ,((1023+SCS_NB_BITS+53)<<20)}}; #endif /*WORDS_BIGENDIAN*/ #define SCS_FLT_TRUNC_CST scs_flt_trunc_cst.d /* 2^(SCS_NB_BITS+53-1) */ #define SCS_FLT_SHIFT_CST scs_flt_shift_cst.d /* 2^(SCS_NB_BITS)(1+1/2) */ #endif /* SCS_USE_FLTMULT */ #endif /* SCS_PRIVATE_H */