When creating function Symbols for functions that were defined in LLVM bitcode for the standard library, if any of the function parameters are integer types, create two ispc-side Symbols: one where the integer types are all signed and the other where they are all unsigned. This allows us to provide, for example, both store_to_int16(reference int a[], uniform int offset, int val) as well as store_to_int16(reference unsigned int a[], uniform int offset, unsigned int val). functions.
Added some additional tests to exercise the new variants of these.
Also fixed some cases where the __{load,store}_int{8,16} builtins would read from/write to memory even if the mask was all off (which could cause crashes in some cases.)
17 lines
458 B
Plaintext
17 lines
458 B
Plaintext
export uniform int width() { return programCount; }
|
|
|
|
export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
|
|
uniform int x[8];
|
|
for (uniform int i = 0; i < 8; ++i)
|
|
x[i] = 0xffffffff;
|
|
unsigned int val = aFOO[programIndex];
|
|
store_to_int8(x, 2, val);
|
|
int v = load_from_int8(x, 1);
|
|
RET[programIndex] = v;
|
|
}
|
|
|
|
export void result(uniform float RET[]) {
|
|
RET[programIndex] = programIndex;
|
|
RET[0] = -1.;
|
|
}
|