First, thanks for answering.
Unfortunately, I'm even more confused now ;(
Now 2 things strike me as odd:
1.) targetH is passed as 0xffff0000 (BitcoinMiner.py around line 293). why not 0? doesn't H have to be 0 even for a difficulty 1 block?
2.) (parts) of the calculation of G is commented out in the kernel code (likely to save some cycles, assuming that G is not going to be needed)...
...but G is used in the solution condition. So since G is some intermediary value of sha256 and targetG is 0, why does this even work?
1.) Excuse me for this mildly obfuscated code. target[0] and [1] are actually A and B of original target - I'm using them just to pass a made up 32 bit target.
Why are you passing a made up 32 bit target (0x00000000ffff0000)?
If you look at kernel parameters you'll see that target[0] (0xFFFF0000) is passed as G.
It's passed as Parameter number 16, which is in BitcoinMiner.cl, "targetG", no?
Or what do you mean by "passed as G"?
2.) G is used in belowOrEquals because I didn't managed to understand why this leads to better/faster assembler
I left it there wondering when someone will ask this question.
So you're saying that "targetG" is in fact the 2nd-last value of the real target or is it 0xffff0000 or what is it and why does it work at all comparing that to some G that is not even the 2nd-last value of the hash?