Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 501 lines (394 sloc) 17.427 kb
18af522 @mmp Initial commit.
mmp authored
1 /*
cb7edf2 Set version to 1.2.0 for release builds
Matt Pharr authored
2 Copyright (c) 2010-2012, Intel Corporation
18af522 @mmp Initial commit.
mmp authored
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
8
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11
12 * Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15
16 * Neither the name of Intel Corporation nor the names of its
17 contributors may be used to endorse or promote products derived from
18 this software without specific prior written permission.
19
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 /** @file ispc.h
35 @brief Main ispc.header file
36 */
37
38 #ifndef ISPC_H
39 #define ISPC_H
40
6aad4c7 Bump version number to 1.3.1dev
Matt Pharr authored
41 #define ISPC_VERSION "1.3.1dev"
7773433 Print numeric version number with --verison.
Matt Pharr authored
42
ee1fe3a Update build to handle existence of LLVM 3.2 dev branch.
Matt Pharr authored
43 #if !defined(LLVM_3_0) && !defined(LLVM_3_1) && !defined(LLVM_3_2)
44 #error "Only LLVM 3.0, 3.1, and the 3.2 development branch are supported"
e780662 Issue error if unsupported version of LLVM is used.
Matt Pharr authored
45 #endif
46
18af522 @mmp Initial commit.
mmp authored
47 #if defined(_WIN32) || defined(_WIN64)
48 #define ISPC_IS_WINDOWS
49 #elif defined(__linux__)
50 #define ISPC_IS_LINUX
51 #elif defined(__APPLE__)
52 #define ISPC_IS_APPLE
53 #endif
54
55 #include <stdint.h>
8d1b77b Have assertion macro and FATAL() text ask user to file a bug, provide…
Matt Pharr authored
56 #include <stdlib.h>
f30a5de Linux build fixes
Matt Pharr authored
57 #include <stdio.h>
18af522 @mmp Initial commit.
mmp authored
58 #include <vector>
59 #include <string>
60
61 /** @def ISPC_MAX_NVEC maximum vector size of any of the compliation
62 targets.
63 */
90db01d Represent MOVMSK'ed masks with int64s rather than int32s.
Matt Pharr authored
64 #define ISPC_MAX_NVEC 64
18af522 @mmp Initial commit.
mmp authored
65
66 // Forward declarations of a number of widely-used LLVM types
67 namespace llvm {
68 class BasicBlock;
69 class Constant;
70 class ConstantValue;
71 class DIBuilder;
72 class DIDescriptor;
73 class DIFile;
74 class DIType;
75 class Function;
76 class FunctionType;
77 class LLVMContext;
78 class Module;
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
79 class Target;
80 class TargetMachine;
18af522 @mmp Initial commit.
mmp authored
81 class Type;
82 class Value;
83 }
84
17e5c8b Fix LLVM 2.9 build.
Matt Pharr authored
85
18af522 @mmp Initial commit.
mmp authored
86 class ArrayType;
78c6d3c Add initial support for 'goto' statements.
Matt Pharr authored
87 class AST;
88 class ASTNode;
18af522 @mmp Initial commit.
mmp authored
89 class AtomicType;
90 class FunctionEmitContext;
91 class Expr;
92 class ExprList;
f9c67ff Explicit representation of ASTs for all the functions in a compile unit.
Matt Pharr authored
93 class Function;
18af522 @mmp Initial commit.
mmp authored
94 class FunctionType;
95 class Module;
db5db5a Add native support for (AO)SOA data layout.
Matt Pharr authored
96 class PointerType;
18af522 @mmp Initial commit.
mmp authored
97 class Stmt;
98 class Symbol;
99 class SymbolTable;
100 class Type;
f45ab07 Significantly reduce the tendrils of DeclSpecs/Declarator/Declaration…
Matt Pharr authored
101 struct VariableDeclaration;
18af522 @mmp Initial commit.
mmp authored
102
5ece6fe Substantial rewrite (again) of decl handling.
Matt Pharr authored
103 enum StorageClass {
104 SC_NONE,
105 SC_EXTERN,
106 SC_STATIC,
107 SC_TYPEDEF,
108 SC_EXTERN_C
109 };
110
111
18af522 @mmp Initial commit.
mmp authored
112 /** @brief Representation of a range of positions in a source file.
113
114 This class represents a range of characters in a source file
115 (e.g. those that span a token's definition), from starting line and
116 column to ending line and column. (These values are tracked by the
117 lexing code). Both lines and columns are counted starting from one.
118 */
119 struct SourcePos {
068ea3e Better SourcePos reporting for gathers/scatters
Matt Pharr authored
120 SourcePos(const char *n = NULL, int fl = 0, int fc = 0,
121 int ll = 0, int lc = 0);
18af522 @mmp Initial commit.
mmp authored
122
123 const char *name;
124 int first_line;
125 int first_column;
126 int last_line;
127 int last_column;
128
129 /** Prints the filename and line/column range to standard output. */
130 void Print() const;
131
132 /** Returns a LLVM DIFile object that represents the SourcePos's file */
133 llvm::DIFile GetDIFile() const;
f0f876c Add support for enums.
Matt Pharr authored
134
135 bool operator==(const SourcePos &p2) const;
18af522 @mmp Initial commit.
mmp authored
136 };
137
64807df Add AssertPos() macro that provides rough source location in error
Matt Pharr authored
138
7d6f89c Improvements to source file position tracking.
Matt Pharr authored
139 /** Returns a SourcePos that encompasses the extent of both of the given
140 extents. */
141 SourcePos Union(const SourcePos &p1, const SourcePos &p2);
142
18af522 @mmp Initial commit.
mmp authored
143
64807df Add AssertPos() macro that provides rough source location in error
Matt Pharr authored
144
145 // Assert
146
147 extern void DoAssert(const char *file, int line, const char *expr);
148 extern void DoAssertPos(SourcePos pos, const char *file, int line, const char *expr);
149
150 #define Assert(expr) \
151 ((void)((expr) ? 0 : ((void)DoAssert (__FILE__, __LINE__, #expr), 0)))
152
153 #define AssertPos(pos, expr) \
154 ((void)((expr) ? 0 : ((void)DoAssertPos (pos, __FILE__, __LINE__, #expr), 0)))
155
156
18af522 @mmp Initial commit.
mmp authored
157 /** @brief Structure that defines a compilation target
158
159 This structure defines a compilation target for the ispc compiler.
160 */
161 struct Target {
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
162 /** Initializes the given Target pointer for a target of the given
163 name, if the name is a known target. Returns true if the
164 target was initialized and false if the name is unknown. */
165 static bool GetTarget(const char *arch, const char *cpu, const char *isa,
c76ef7b Add command-line option to specify position-independent codegen
Matt Pharr authored
166 bool pic, Target *);
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
167
168 /** Returns a comma-delimited string giving the names of the currently
169 supported target ISAs. */
170 static const char *SupportedTargetISAs();
171
172 /** Returns a comma-delimited string giving the names of the currently
173 supported target CPUs. */
b813452 Don't issue a slew of warnings if a bogus cpu type is specified.
Matt Pharr authored
174 static std::string SupportedTargetCPUs();
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
175
176 /** Returns a comma-delimited string giving the names of the currently
177 supported target architectures. */
178 static const char *SupportedTargetArchs();
179
180 /** Returns a triple string specifying the target architecture, vendor,
181 and environment. */
182 std::string GetTripleString() const;
183
184 /** Returns the LLVM TargetMachine object corresponding to this
185 target. */
186 llvm::TargetMachine *GetTargetMachine() const;
06975bc Add support for compiling to multiple targets.
Matt Pharr authored
187
188 /** Returns a string like "avx" encoding the target. */
189 const char *GetISAString() const;
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
190
f8eb100 Use llvm TargetData to find object sizes, offsets.
Matt Pharr authored
191 /** Returns the size of the given type */
fefa86e Remove LLVM_TYPE_CONST #define / usage.
Matt Pharr authored
192 llvm::Value *SizeOf(llvm::Type *type,
4151778 Modify SizeOf() and StructOffset() to not compute value based on targ…
Matt Pharr authored
193 llvm::BasicBlock *insertAtEnd);
194
f8eb100 Use llvm TargetData to find object sizes, offsets.
Matt Pharr authored
195 /** Given a structure type and an element number in the structure,
196 returns a value corresponding to the number of bytes from the start
197 of the structure where the element is located. */
fefa86e Remove LLVM_TYPE_CONST #define / usage.
Matt Pharr authored
198 llvm::Value *StructOffset(llvm::Type *type,
4151778 Modify SizeOf() and StructOffset() to not compute value based on targ…
Matt Pharr authored
199 int element, llvm::BasicBlock *insertAtEnd);
f8eb100 Use llvm TargetData to find object sizes, offsets.
Matt Pharr authored
200
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
201 /** llvm Target object representing this target. */
202 const llvm::Target *target;
18af522 @mmp Initial commit.
mmp authored
203
f0f876c Add support for enums.
Matt Pharr authored
204 /** Enumerator giving the instruction sets that the compiler can
06975bc Add support for compiling to multiple targets.
Matt Pharr authored
205 target. These should be ordered from "worse" to "better" in that
206 if a processor supports multiple target ISAs, then the most
207 flexible/performant of them will apear last in the enumerant. Note
208 also that __best_available_isa() needs to be updated if ISAs are
209 added or the enumerant values are reordered. */
6c7df4c Add initial support for "avx1.1" targets for Ivy Bridge.
Matt Pharr authored
210 enum ISA { SSE2, SSE4, AVX, AVX11, AVX2, GENERIC, NUM_ISAS };
18af522 @mmp Initial commit.
mmp authored
211
212 /** Instruction set being compiled to. */
213 ISA isa;
214
215 /** Target system architecture. (e.g. "x86-64", "x86"). */
216 std::string arch;
217
04c9304 Target handling fixes.
Matt Pharr authored
218 /** Is the target architecture 32 or 64 bit */
975db80 Add support for pointers to the language.
Matt Pharr authored
219 bool is32Bit;
04c9304 Target handling fixes.
Matt Pharr authored
220
18af522 @mmp Initial commit.
mmp authored
221 /** Target CPU. (e.g. "corei7", "corei7-avx", ..) */
222 std::string cpu;
223
b674987 Big rewrite / improvement of target handling.
Matt Pharr authored
224 /** Target-specific attributes to pass along to the LLVM backend */
225 std::string attributes;
226
18af522 @mmp Initial commit.
mmp authored
227 /** Native vector width of the vector instruction set. Note that this
228 value is directly derived from the ISA Being used (e.g. it's 4 for
229 SSE, 8 for AVX, etc.) */
230 int nativeVectorWidth;
231
232 /** Actual vector width currently being compiled to. This may be an
233 integer multiple of the native vector width, for example if we're
234 "doubling up" and compiling 8-wide on a 4-wide SSE system. */
235 int vectorWidth;
c76ef7b Add command-line option to specify position-independent codegen
Matt Pharr authored
236
237 /** Indicates whether position independent code should be generated. */
238 bool generatePIC;
1d9201f Add "generic" 4, 8, and 16-wide targets.
Matt Pharr authored
239
240 /** Is there overhead associated with masking on the target
241 architecture; e.g. there is on SSE, due to extra blends and the
242 like, but there isn't with an ISA that supports masking
243 natively. */
244 bool maskingIsFree;
245
246 /** How many bits are used to store each element of the mask: e.g. this
247 is 32 on SSE/AVX, since that matches the HW better, but it's 1 for
248 the generic target. */
249 int maskBitCount;
0c1b206 Pass log/exp/pow transcendentals through to targets that support them.
Matt Pharr authored
250
251 /** Indicates whether the target has native support for float/half
252 conversions. */
253 bool hasHalf;
254
10b79fb Add support for non-factored variants of gather/scatter functions.
Matt Pharr authored
255 /** Indicates whether there is an ISA random number instruction. */
6c7df4c Add initial support for "avx1.1" targets for Ivy Bridge.
Matt Pharr authored
256 bool hasRand;
257
10b79fb Add support for non-factored variants of gather/scatter functions.
Matt Pharr authored
258 /** Indicates whether the target has a native gather instruction */
259 bool hasGather;
260
261 /** Indicates whether the target has a native scatter instruction */
262 bool hasScatter;
263
0c1b206 Pass log/exp/pow transcendentals through to targets that support them.
Matt Pharr authored
264 /** Indicates whether the target has support for transcendentals (beyond
265 sqrt, which we assume that all of them handle). */
266 bool hasTranscendentals;
18af522 @mmp Initial commit.
mmp authored
267 };
268
c76ef7b Add command-line option to specify position-independent codegen
Matt Pharr authored
269
18af522 @mmp Initial commit.
mmp authored
270 /** @brief Structure that collects optimization options
271
272 This structure collects all of the options related to optimization of
273 generated code.
274 */
275 struct Opt {
276 Opt();
277
278 /** Optimization level. Currently, the only valid values are 0,
279 indicating essentially no optimization, and 1, indicating as much
280 optimization as possible. */
281 int level;
282
283 /** Indicates whether "fast and loose" numerically unsafe optimizations
284 should be performed. This is false by default. */
285 bool fastMath;
286
83f22f1 Add experimental --fast-masked-vload flag for SSE.
Matt Pharr authored
287 /** Indicates whether an vector load should be issued for masked loads
288 on platforms that don't have a native masked vector load. (This may
289 lead to accessing memory up to programCount-1 elements past the end of
290 arrays, so is unsafe in general.) */
291 bool fastMaskedVload;
292
30f9dcd Unroll loops by default, add --opt=disable-loop-unroll to disable.
Matt Pharr authored
293 /** Indicates when loops should be unrolled (when doing so seems like
294 it will make sense. */
295 bool unrollLoops;
296
975db80 Add support for pointers to the language.
Matt Pharr authored
297 /** Indicates if addressing math will be done with 32-bit math, even on
298 64-bit systems. (This is generally noticably more efficient,
299 though at the cost of addressing >2GB).
300 */
301 bool force32BitAddressing;
302
8d1b77b Have assertion macro and FATAL() text ask user to file a bug, provide…
Matt Pharr authored
303 /** Indicates whether Assert() statements should be ignored (for
422b826 Add assert() statement support. Issue #106.
Matt Pharr authored
304 performance in the generated code). */
305 bool disableAsserts;
46bfef3 Add option to turn off codegen improvements when mask 'all on' is sta…
Matt Pharr authored
306
19d8f2e Generate FMA instructions with AVX2 (when possible).
Matt Pharr authored
307 /** Indicates whether FMA instructions should be disabled (on targets
308 that support them). */
309 bool disableFMA;
310
46bfef3 Add option to turn off codegen improvements when mask 'all on' is sta…
Matt Pharr authored
311 /** If enabled, disables the various optimizations that kick in when
312 the execution mask can be determined to be "all on" at compile
313 time. */
314 bool disableMaskAllOnOptimizations;
315
6084d6a Added disable-handle-pseudo-memory-ops option.
Matt Pharr authored
316 /** If enabled, the various __pseudo* memory ops (gather/scatter,
317 masked load/store) are left in their __pseudo* form, for better
318 understanding of the structure of generated code when reading
319 it. */
320 bool disableHandlePseudoMemoryOps;
422b826 Add assert() statement support. Issue #106.
Matt Pharr authored
321
18af522 @mmp Initial commit.
mmp authored
322 /** On targets that don't have a masked store instruction but do have a
323 blending instruction, by default, we simulate masked stores by
324 loading the old value, blending, and storing the result. This can
325 potentially be unsafe in multi-threaded code, in that it writes to
326 locations that aren't supposed to be written to. Setting this
327 value to true disables this work-around, and instead implements
328 masked stores by 'scalarizing' them, so that we iterate over the
329 ISIMD lanes and do a scalar write for the ones that are running. */
330 bool disableBlendedMaskedStores;
331
332 /** Disables the 'coherent control flow' constructs in the
333 language. (e.g. this causes "cif" statements to be demoted to "if"
334 statements.) This is likely only useful for measuring the impact
335 of coherent control flow. */
336 bool disableCoherentControlFlow;
337
338 /** Disables uniform control flow optimizations (e.g. this changes an
339 "if" statement with a uniform condition to have a varying
340 condition). This is likely only useful for measuring the impact of
341 uniform control flow. */
342 bool disableUniformControlFlow;
343
344 /** Disables the backend optimizations related to gather/scatter
345 (e.g. transforming gather from sequential locations to an unaligned
346 load, etc.) This is likely only useful for measuring the impact of
347 these optimizations. */
348 bool disableGatherScatterOptimizations;
349
350 /** Disables the optimization that demotes masked stores to regular
351 stores when the store is happening at the same control flow level
352 where the variable was declared. This is likely only useful for
353 measuring the impact of this optimization. */
354 bool disableMaskedStoreToStore;
355
356 /** Disables the optimization that detects when the execution mask is
357 all on and emits code for gathers and scatters that doesn't loop
358 over the SIMD lanes but just does the scalar loads and stores
359 directly. */
360 bool disableGatherScatterFlattening;
361
362 /** Disables the optimizations that detect when arrays are being
363 indexed with 'uniform' values and issue scalar loads/stores rather
364 than gathers/scatters. This is likely only useful for measuring
365 the impact of this optimization. */
366 bool disableUniformMemoryOptimizations;
73bf552 Add support for coalescing memory accesses from gathers.
Matt Pharr authored
367
368 /** Disables optimizations that coalesce incoherent scalar memory
369 access from gathers into wider vector operations, when possible. */
370 bool disableCoalescing;
18af522 @mmp Initial commit.
mmp authored
371 };
372
373 /** @brief This structure collects together a number of global variables.
374
375 This structure collects a number of global variables that mostly
376 represent parameter settings for this compilation run. In particular,
377 none of these values should change after compilation befins; their
378 values are all set during command-line argument processing or very
379 early during the compiler's execution, before any files are parsed.
380 */
381 struct Globals {
382 Globals();
383
384 /** Optimization option settings */
385 Opt opt;
386 /** Compilation target information */
387 Target target;
388
389 /** There are a number of math libraries that can be used for
390 transcendentals and the like during program compilation. */
391 enum MathLib { Math_ISPC, Math_ISPCFast, Math_SVML, Math_System };
392 MathLib mathLib;
393
394 /** Records whether the ispc standard library should be made available
395 to the program during compilations. (Default is true.) */
396 bool includeStdlib;
397
398 /** Indicates whether the C pre-processor should be run over the
399 program source before compiling it. (Default is true.) */
400 bool runCPP;
401
402 /** When \c true, voluminous debugging output will be printed during
403 ispc's execution. */
404 bool debugPrint;
405
406 /** Indicates whether all warning messages should be surpressed. */
407 bool disableWarnings;
408
c995902 Add --werror flag to treat warnings as errors.
Matt Pharr authored
409 /** Indicates whether warnings should be issued as errors. */
410 bool warningsAsErrors;
411
79684a0 Add support for running tests that are expected to fail
Matt Pharr authored
412 /** Indicates whether line wrapping of error messages to the terminal
413 width should be disabled. */
414 bool disableLineWrap;
415
18af522 @mmp Initial commit.
mmp authored
416 /** Indicates whether additional warnings should be issued about
417 possible performance pitfalls. */
418 bool emitPerfWarnings;
419
724a843 Add --quiet option to supress all diagnostic output
Matt Pharr authored
420 /** Indicates whether all printed output should be surpressed. */
421 bool quiet;
422
1397dbd Don't generate colorized output escapes when stderr isn't a TTY.
Matt Pharr authored
423 /** Always use ANSI escape sequences to colorize warning and error
424 messages, even if piping output to a file, etc. */
425 bool forceColoredOutput;
426
18af522 @mmp Initial commit.
mmp authored
427 /** Indicates whether calls should be emitted in the program to an
428 externally-defined program instrumentation function. (See the
429 "Instrumenting your ispc programs" section in the user's
430 manual.) */
431 bool emitInstrumentation;
432
433 /** Indicates whether ispc should generate debugging symbols for the
434 program in its output. */
435 bool generateDebuggingSymbols;
06975bc Add support for compiling to multiple targets.
Matt Pharr authored
436
437 /** If true, function names are mangled by appending the target ISA and
438 vector width to them. */
439 bool mangleFunctionsWithTarget;
18af522 @mmp Initial commit.
mmp authored
440
3efbc71 Add fuzz testing of input programs.
Matt Pharr authored
441 /** If enabled, the lexer will randomly replace some tokens returned
442 with other tokens, in order to test error condition handling in the
443 compiler. */
444 bool enableFuzzTest;
445
446 /** Seed for random number generator used for fuzz testing. */
447 int fuzzTestSeed;
448
18af522 @mmp Initial commit.
mmp authored
449 /** Global LLVMContext object */
450 llvm::LLVMContext *ctx;
451
452 /** Current working directory when the ispc compiler starts
453 execution. */
454 char currentDirectory[1024];
455
456 /** Arguments to pass along to the C pre-processor, if it is run on the
457 program before compilation. */
458 std::vector<std::string> cppArgs;
bb8e13e Add support for -I command-line argument to specify #include search d…
Matt Pharr authored
459
460 /** Additional user-provided directories to search when processing
461 #include directives in the preprocessor. */
462 std::vector<std::string> includePath;
18af522 @mmp Initial commit.
mmp authored
463 };
464
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
465 enum {
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
466 COST_ASSIGN = 1,
467 COST_COMPLEX_ARITH_OP = 4,
664dc3b Add support for "new" and "delete" to the language.
Matt Pharr authored
468 COST_DELETE = 32,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
469 COST_DEREF = 4,
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
470 COST_FUNCALL = 4,
afcd420 Add support for function pointers.
Matt Pharr authored
471 COST_FUNPTR_UNIFORM = 12,
472 COST_FUNPTR_VARYING = 24,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
473 COST_GATHER = 8,
78c6d3c Add initial support for 'goto' statements.
Matt Pharr authored
474 COST_GOTO = 4,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
475 COST_LOAD = 2,
664dc3b Add support for "new" and "delete" to the language.
Matt Pharr authored
476 COST_NEW = 32,
2d80266 Always check the execution mask after break/continue/return.
Matt Pharr authored
477 COST_BREAK_CONTINUE = 3,
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
478 COST_RETURN = 4,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
479 COST_SELECT = 4,
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
480 COST_SIMPLE_ARITH_LOGIC_OP = 1,
481 COST_SYNC = 32,
afcd420 Add support for function pointers.
Matt Pharr authored
482 COST_TASK_LAUNCH = 32,
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
483 COST_TYPECAST_COMPLEX = 4,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
484 COST_TYPECAST_SIMPLE = 1,
fc29544 Update cost model to include "if" overhead in "if" statement calculat…
Matt Pharr authored
485 COST_UNIFORM_IF = 2,
486 COST_VARYING_IF = 3,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
487 COST_UNIFORM_LOOP = 4,
488 COST_VARYING_LOOP = 6,
b67446d Add support for "switch" statements.
Matt Pharr authored
489 COST_UNIFORM_SWITCH = 4,
490 COST_VARYING_SWITCH = 12,
422b826 Add assert() statement support. Issue #106.
Matt Pharr authored
491 COST_ASSERT = 8,
9921b8e Predicated 'if' statement performance improvements.
Matt Pharr authored
492
493 CHECK_MASK_AT_FUNCTION_START_COST = 16,
494 PREDICATE_SAFE_IF_STATEMENT_COST = 6,
ca87579 Add a very simple cost model to estimate runtime cost of running code.
Matt Pharr authored
495 };
496
18af522 @mmp Initial commit.
mmp authored
497 extern Globals *g;
498 extern Module *m;
499
500 #endif // ISPC_H
Something went wrong with that request. Please try again.