3 ms·
Pretty cool flashback :) But to nitpick a bit: the ternary operator doesn't instruct the compiler to use a conditional move instruction, from the compiler's poi
by flohofwoe 4y ago
Pretty cool flashback :) But to nitpick a bit: the ternary operator doesn't instruct the compiler to use a conditional move instruction, from the compiler's point of view, it's just a condition, no difference to a regular if statement.
E.g. see:
https://www.godbolt.org/z/sYPd4onfT https://www.godbolt.org/z/sYPd4onfT
...any reasonably "modern" C compiler should generate the same code for both functions.
(also I wonder if an even better image quality could be achieved by generating a copper list next to the image data which updates the color palette mid-image?)