3 ms·
Adding a single uint16_t cast like this: dest.r = uint16_t(dest.r * invAlpha + c.r * c.a) >> 8; Seems to get all of the benefit. The result is 34 instructio
by abainbridge 8y ago
Adding a single uint16_t cast like this:
dest.r = uint16_t(dest.r * invAlpha + c.r * c.a) >> 8;
Seems to get all of the benefit. The result is 34 instructions in the loop. (Was 38).
Amazingly, switching from gcc 8.2 to gcc trunk, reduces the instructions in the loop to 18. See https://godbolt.org/z/sEvz2w https://godbolt.org/z/sEvz2w