1 | /***************************************************************************
|
---|
2 | * blitz/tuning.h Platform-specific code tuning
|
---|
3 | *
|
---|
4 | * $Id: tuning.h,v 1.1.1.1 1999-04-09 17:58:59 ansari Exp $
|
---|
5 | *
|
---|
6 | * Copyright (C) 1997,1998 Todd Veldhuizen <tveldhui@seurat.uwaterloo.ca>
|
---|
7 | *
|
---|
8 | * This program is free software; you can redistribute it and/or
|
---|
9 | * modify it under the terms of the GNU General Public License
|
---|
10 | * as published by the Free Software Foundation; either version 2
|
---|
11 | * of the License, or (at your option) any later version.
|
---|
12 | *
|
---|
13 | * This program is distributed in the hope that it will be useful,
|
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | * GNU General Public License for more details.
|
---|
17 | *
|
---|
18 | * Suggestions: blitz-suggest@cybervision.com
|
---|
19 | * Bugs: blitz-bugs@cybervision.com
|
---|
20 | *
|
---|
21 | * For more information, please see the Blitz++ Home Page:
|
---|
22 | * http://seurat.uwaterloo.ca/blitz/
|
---|
23 | *
|
---|
24 | ***************************************************************************
|
---|
25 | * $Log: not supported by cvs2svn $
|
---|
26 | * Revision 1.6 1998/03/14 00:04:47 tveldhui
|
---|
27 | * 0.2-alpha-05
|
---|
28 | *
|
---|
29 | * Revision 1.5 1997/07/16 14:51:20 tveldhui
|
---|
30 | * Update: Alpha release 0.2 (Arrays)
|
---|
31 | *
|
---|
32 | * Revision 1.4 1997/01/24 14:42:00 tveldhui
|
---|
33 | * Periodic RCS update
|
---|
34 | *
|
---|
35 | * Revision 1.3 1997/01/23 03:28:28 tveldhui
|
---|
36 | * Periodic RCS update
|
---|
37 | *
|
---|
38 | * Revision 1.2 1997/01/13 22:19:58 tveldhui
|
---|
39 | * Periodic RCS update
|
---|
40 | *
|
---|
41 | * Revision 1.1 1996/11/11 17:29:13 tveldhui
|
---|
42 | * Initial revision
|
---|
43 | *
|
---|
44 | *
|
---|
45 | */
|
---|
46 |
|
---|
47 | #ifndef BZ_TUNING_H
|
---|
48 | #define BZ_TUNING_H
|
---|
49 |
|
---|
50 | // These estimates should be conservative (i.e. underestimate the
|
---|
51 | // cache sizes).
|
---|
52 | #define BZ_L1_CACHE_ESTIMATED_SIZE 8192
|
---|
53 | #define BZ_L2_CACHE_ESTIMATED_SIZE 65536
|
---|
54 |
|
---|
55 |
|
---|
56 | #undef BZ_PARTIAL_LOOP_UNROLL
|
---|
57 | #define BZ_PASS_EXPR_BY_VALUE
|
---|
58 | #undef BZ_PTR_INC_FASTER_THAN_INDIRECTION
|
---|
59 | #define BZ_MANUAL_VECEXPR_COPY_CONSTRUCTOR
|
---|
60 | #undef BZ_KCC_COPY_PROPAGATION_KLUDGE
|
---|
61 | #undef BZ_ALTERNATE_FORWARD_BACKWARD_TRAVERSALS
|
---|
62 | #undef BZ_ARRAY_EXPR_PASS_INDEX_BY_VALUE
|
---|
63 | #define BZ_INLINE_GROUP1
|
---|
64 | #define BZ_INLINE_GROUP2
|
---|
65 | #define BZ_COLLAPSE_LOOPS
|
---|
66 | #define BZ_USE_FAST_READ_ARRAY_EXPR
|
---|
67 | #define BZ_ARRAY_EXPR_USE_COMMON_STRIDE
|
---|
68 | #undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL
|
---|
69 | #undef BZ_ARRAY_STACK_TRAVERSAL_CSE_AND_ANTIALIAS
|
---|
70 | #undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL
|
---|
71 | #define BZ_ARRAY_2D_STENCIL_TILING
|
---|
72 | #define BZ_ARRAY_2D_STENCIL_TILE_SIZE 128
|
---|
73 | #undef BZ_INTERLACE_ARRAYS
|
---|
74 |
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Platform-specific tuning
|
---|
78 | */
|
---|
79 |
|
---|
80 | #ifdef _CRAYT3E
|
---|
81 | // The backend compiler on the T3E does a better job of
|
---|
82 | // loop unrolling.
|
---|
83 | #undef BZ_PARTIAL_LOOP_UNROLL
|
---|
84 | #undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL
|
---|
85 | #undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | #ifdef __GNUC__
|
---|
89 | // The egcs compiler does a good job of loop unrolling, if
|
---|
90 | // -funroll-loops is used.
|
---|
91 | #undef BZ_PARTIAL_LOOP_UNROLL
|
---|
92 | #undef BZ_ARRAY_FAST_TRAVERSAL_UNROLL
|
---|
93 | #undef BZ_ARRAY_STACK_TRAVERSAL_UNROLL
|
---|
94 | #endif
|
---|
95 |
|
---|
96 | #ifdef BZ_DISABLE_KCC_COPY_PROPAGATION_KLUDGE
|
---|
97 | #undef BZ_KCC_COPY_PROPAGATION_KLUDGE
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | #ifdef BZ_INLINE_GROUP1
|
---|
101 | #define _bz_inline1 inline
|
---|
102 | #else
|
---|
103 | #define _bz_inline1
|
---|
104 | #endif
|
---|
105 |
|
---|
106 | #ifdef BZ_INLINE_GROUP2
|
---|
107 | #define _bz_inline2 inline
|
---|
108 | #else
|
---|
109 | #define _bz_inline2
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | #ifdef __DECCXX
|
---|
113 | // The DEC cxx compiler has problems with loop unrolling
|
---|
114 | // because of aliasing. Loop unrolling and anti-aliasing
|
---|
115 | // is done by Blitz++.
|
---|
116 |
|
---|
117 | #define BZ_PARTIAL_LOOP_UNROLL
|
---|
118 | #define BZ_ARRAY_STACK_TRAVERSAL_CSE_AND_ANTIALIAS
|
---|
119 | #define BZ_ARRAY_STACK_TRAVERSAL_UNROLL
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | /*
|
---|
123 | * BZ_NO_PROPAGATE(X) prevents the compiler from performing
|
---|
124 | * copy propagation on a variable. This is used for loop
|
---|
125 | * unrolling to prevent KAI C++ from rearranging the
|
---|
126 | * ordering of memory accesses.
|
---|
127 | */
|
---|
128 |
|
---|
129 | #define BZ_NO_PROPAGATE(X) X
|
---|
130 |
|
---|
131 | #ifdef __KCC
|
---|
132 | #ifdef BZ_USE_NO_PROPAGATE
|
---|
133 | extern "C" int __kai_apply(const char*, ...);
|
---|
134 |
|
---|
135 | #undef BZ_NO_PROPAGATE(X)
|
---|
136 | #define BZ_NO_PROPAGATE(X) __kai_apply("(%a)",&X)
|
---|
137 | #endif
|
---|
138 | #endif
|
---|
139 |
|
---|
140 | #endif // BZ_TUNING_H
|
---|