#define D(c) x = (x & ((1<<c)-1)) + (x >> c);
unsigned mod5(unsigned x) {D(16) D(8) D(4) D(4) D(4) x = (x&3)-(x>>2); return (x>3) * 5 + x;}
-
-
@RichFelker@ch3root Hardware implementation (much lower latency, lower die area), CPU/MCU archs without a widening MUL instruction. -
-
@RichFelker@ch3root Of course, we don't mean this for actual use in C on today's typical CPU archs. We merely express it in C. -
-
@RichFelker@solardiz Yeah, I don't like it too. But it saves some chars in a tweet. Perhaps it's better to leave some spaces out instead. -
New conversation -
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@RichFelker Also bitslice implementations (if bitslicing is used anyway for other reasons), and constant-time implementations (if MUL isn't)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.