Simplify int mul/udiv/urem of 2^N into shl/shr/and.
commit7a19de5cf49c9b48e7a675c6fb2e0bd373e073c2
authorRoland Paterson-Jones <rolandpj@gmail.com>
Thu, 13 Jun 2024 18:58:52 +0000 (13 20:58 +0200)
committerQuentin Carbonneaux <quentin@c9x.me>
Sun, 16 Jun 2024 19:42:17 +0000 (16 21:42 +0200)
treefadf2500e0facac47a635ed844518b1044848115
parentcf9f95f5212db901bdf09e95dae4647f17bfb1e5
Simplify int mul/udiv/urem of 2^N into shl/shr/and.

Passes the "standard" test suite.

(cproc bootstrap, hare[c] make test, roland units, linpack/coremark run)

However linpack benchmark is now notably slower. Coremark is ~2% faster.

As noticed before, linmark timing is dubious, and maybe my cheap (AMD) laptop
prefers mul to shl.
simpl.c