3 ms·
Funnily enough this is the code I was reading today https://github.com/constructor-igor/cudafy/blob/11cdd4def4e7cc349d9771e8251327d771a481c1/Cudafy/Cudafy.Tran
by majke 6y ago
Funnily enough this is the code I was reading today
https://github.com/constructor-igor/cudafy/blob/11cdd4def4e7cc349d9771e8251327d771a481c1/Cudafy/Cudafy.Translator/Resources/simd_functions.h#L1178-L1193 https://github.com/constructor-igor/cudafy/blob/11cdd4def4e7...
s = a ^ b; // sum bits
r = a & 0x7f7f7f7f; // clear msbs
t = b & 0x7f7f7f7f; // clear msbs
s = s & 0x80808080; // msb sum bits
r = r + t; // add without msbs, record carry-out in msbs
r = r ^ s; // sum of msb sum and carry-in bits, w/o carry-out