source: git/misc/aux.h @ b669e0

spielwiese
Last change on this file since b669e0 was fa31d2, checked in by Christian Eder, 14 years ago
changed mappings in longrat*: added src & dst, assumes
  • Property mode set to 100644
File size: 1.7 KB
Line 
1/* -*-c++-*- */
2
3/*******************************************************************
4 *  File:    aux.h
5 *  Purpose:
6 *  Author: 
7 *  Created:
8 *  Version: $Id$
9 *******************************************************************/
10
11// BOOLEAN
12// max, min?
13
14
15#ifndef _MISC_AUX_H
16#define _MISC_AUX_H
17
18#define TRUE 1
19#define FALSE 0
20
21#ifndef NULL
22#define NULL        (0)
23#endif
24
25// #ifdef _TRY
26#ifndef ABS
27#define ABS(x) ((x)<0?(-(x)):(x))
28#endif
29// #endif
30
31static const int MAX_INT_LEN= 11;
32typedef void* ADDRESS;
33
34#if (SIZEOF_LONG == 8)
35typedef int BOOLEAN;
36/* testet on x86_64, gcc 3.4.6: 2 % */
37/* testet on IA64, gcc 3.4.6: 1 % */
38#else
39/* testet on athlon, gcc 2.95.4: 1 % */
40typedef short BOOLEAN;
41#endif
42#define loop for(;;)
43
44static inline int si_max(const int a, const int b)  { return (a>b) ? a : b; }
45
46
47#if defined(SI_CPU_I386) || defined(SI_CPU_X86_64)
48  // the following settings seems to be better on i386 and x86_64 processors
49  // define if a*b is with mod instead of tables
50#define HAVE_MULT_MOD
51  // #define HAVE_GENERIC_ADD
52  // #ifdef HAVE_MULT_MOD
53  // #define HAVE_DIV_MOD
54  // #endif
55#elif defined(SI_CPU_IA64)
56  // the following settings seems to be better on itanium processors
57  // #define HAVE_MULT_MOD
58#define HAVE_GENERIC_ADD
59  // #ifdef HAVE_MULT_MOD
60  // #define HAVE_DIV_MOD
61  // #endif
62#elif defined(SI_CPU_SPARC)
63  // #define HAVE_GENERIC_ADD
64#define HAVE_MULT_MOD
65#ifdef HAVE_MULT_MOD
66#define HAVE_DIV_MOD
67#endif
68#elif defined(SI_CPU_PPC)
69  // the following settings seems to be better on ppc processors
70  // testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
71#define HAVE_MULT_MOD
72  // #ifdef HAVE_MULT_MOD
73  // #define HAVE_DIV_MOD
74  // #endif
75#endif
76
77
78#endif /* _MISC_AUX_H */
79
Note: See TracBrowser for help on using the repository browser.