source: git/misc/aux.h @ e6262c

spielwiese
Last change on this file since e6262c was e6262c, checked in by Oleksandr Motsak <motsak@…>, 14 years ago
minor changes
  • Property mode set to 100644
File size: 1.5 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
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
31
32#if (SIZEOF_LONG == 8)
33typedef int BOOLEAN;
34/* testet on x86_64, gcc 3.4.6: 2 % */
35/* testet on IA64, gcc 3.4.6: 1 % */
36#else
37/* testet on athlon, gcc 2.95.4: 1 % */
38typedef short BOOLEAN;
39#endif
40#define loop for(;;)
41
42#if defined(SI_CPU_I386) || defined(SI_CPU_X86_64)
43  // the following settings seems to be better on i386 and x86_64 processors
44  // define if a*b is with mod instead of tables
45#define HAVE_MULT_MOD
46  // #define HAVE_GENERIC_ADD
47  // #ifdef HAVE_MULT_MOD
48  // #define HAVE_DIV_MOD
49  // #endif
50#elif defined(SI_CPU_IA64)
51  // the following settings seems to be better on itanium processors
52  // #define HAVE_MULT_MOD
53#define HAVE_GENERIC_ADD
54  // #ifdef HAVE_MULT_MOD
55  // #define HAVE_DIV_MOD
56  // #endif
57#elif defined(SI_CPU_SPARC)
58  // #define HAVE_GENERIC_ADD
59#define HAVE_MULT_MOD
60#ifdef HAVE_MULT_MOD
61#define HAVE_DIV_MOD
62#endif
63#elif defined(SI_CPU_PPC)
64  // the following settings seems to be better on ppc processors
65  // testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
66#define HAVE_MULT_MOD
67  // #ifdef HAVE_MULT_MOD
68  // #define HAVE_DIV_MOD
69  // #endif
70#endif
71
72#endif /* _MISC_AUX_H */
73
Note: See TracBrowser for help on using the repository browser.