Fixes issue #73. Previously, if we had e.g. an int16 type that was being shifted
left by 1, then the constant integer 1 would come in as an int32, we'd convert
the int16 to an int32, and then we'd do the shift. Now, for shifts, the type
of the expression is always the same as the type of the value being shifted.
Add optimization patterns to detect and simplify masked loads and stores
with the mask all on / all off.
Enable AVX for LLVM 3.0 builds (still generally hits bugs / unimplemented
stuff on the LLVM side, but it's getting there).
(The string for which c_str() was called was just a temporary, so its destructor ran after funcName was initialized, leading funcName to point at freed memory.)
This commit adds support for swizzles like "foo.zy" (if "foo" is,
for example, a float<3> type) as rvalues. (Still need support for
swizzles as lvalues.)
Don't create ispc-callable symbols for other functions that we find in the LLVM
bitcode files that are loaded up and linked into the module so that they can be
called from ispc stdlib functions. This fixes an issue where we had a clash
between the declared versions of double sin(double) and the corresponding
ispc stdlib routines for uniform doubles, which in turn led to bogus code
being generated for calls to those ispc stdlib functions.
- In the ispc-generated header files, a #define now indicates which compilation target
was used.
- The examples use utility routines from the new file examples/cpuid.h to check the
system's CPU's capabilities to see if it supports the ISA that was used for
compiling the example code and print error messages if things aren't going to
work...
This way, we match C/C++ in that casting a bool to an int gives either the value
zero or the value one. There is a new stdlib function int sign_extend(bool)
that does sign extension for cases where that's desired.
MSVC 2010 issues an error if given a string larger than 64k characters
long. To work around this, the pre-processed stdlib.ispc code is now
stored as an array of characters terminated with a NUL (i.e. the same thing
in the end); MSVC is fine with arrays larger than 64k characters.
Fixed the implementations of these builtin functions for targets that don't have native masked load instructions so that they do no loads if the vector mask is all off, and only do an (unaligned) vector load if both the first and last element of the mask are on. Otherwise they serialize and do scalar loads for only the active lanes. This fixes a number of potential sources of crashes due to accessing invalid memory.
lex.ll(397): warning C4244: '=' : conversion from 'long' to 'char', possible loss of data
lex.ll(402): warning C4244: '=' : conversion from 'long' to 'char', possible loss of data
by explicit cast to 'char'.
See: http://msdn.microsoft.com/en-us/library/w4z2wdyc(v=vs.80).aspx
long strtol(
const char *nptr,
char **endptr,
int base
);
Add much more suppport for doubles and in64 types in the standard library, basically supporting everything for them that are supported for floats and int32s. (The notable exceptions being the approximate rcp() and rsqrt() functions, which don't really have sensible analogs for doubles (or at least not built-in instructions).)
Fixes bug #55. A number of tests were crashing on Windows due to the task
launch code using alloca to allocate space for the tasks' parameters. On
Windows, the stack isn't generally big enough for this to be a good idea.
Also added an alignment parmaeter to ISPCMalloc() to pass the alignment
requirement along.
A few more productions to recover from parse errors (in function parameter lists and in statement lists). These eliminate some of the massive cascading error messages from a single parse error that the previous error recovery strategy would sometimes cause. Fixes issue #44.