If constant for iadd == 0x80000000 then calCL just ignoring it. In compiled code there no ADD_INT instruction generated. When changing constant to anything else (like 0x7ffffff or 0x80000001) everything became OK.

I've started to think that I missed something in declaration of constant (signed/unsigned) but ixor r34.x,r34.x,r45.x working ok with correct XOR_INT instruction generated.

Is this calCL compiler/optimizer bug or am I missed something being not so familiar with AMD IL atm?

What are the range of values you're sampling? Also, what result is placed into the output stream o0? Is it just the value you sampled xord by INT_MIN+1? Finally, do you know the addition isn't taking place because your result isn't what you expected, or did you disassemble the kernel?

Originally posted by: rick.weber What are the range of values you're sampling? Also, what result is placed into the output stream o0? Is it just the value you sampled xord by INT_MIN+1? Finally, do you know the addition isn't taking place because your result isn't what you expected, or did you disassemble the kernel?

I've disassembled the kernel after i've got wrong results on several sample datas. Actually it's easy to see how this kernel will be compiled via Stream KernelAnalyzer -- just copy/paste kernel there, results (for RV770) will be:

As you see, no iadd for 0x80000000. I suspect the reason of this that (unsigned int)0x80000000 == -0.0f. And CAL CL decided to remove "unnecessary" addition with "zero" being wrong about int addition == float one.

I'm just realized that updating SDK means nothing as all compiler logic done by dlls which are only updating when Catalyst driver updating. So as long as Catalyst still 9.2 nothing will change.

And also as Stream doesn't looks like top priority for ATI/AMD, only CAL compiler bug fixes isn't enough to start process of Catalyst driver update. So we need to wait some other major Catalyst driver update to see any SDK change.

The SDK and CAL are no longer directly connected. This was done to make all graphic cards CAL ready so that people could develop applications and have them run on machines with Radeons without requiring the users to download the SDK.

The downside to this is that the SDK and CAL move at different speeds. Where the SDK is updated quarterly, the driver is update monthly but it follows the driver development cycle which used to be explained here: http://www.phoronix.com/vr.php?view=10083. The basics is that it takes three months for a feature/bug fix to go from implementation through testing and release. This bug was fixed last month, so it should be public in the next one or two driver releases.

I'll really prefer to have most updated compiler at all times rather than single driver distribution as I' not using runtime calcl* calls anyway -- all kernels precompiled to elf binaries. But it doesn't looks like there's an option.