Unverified Commit 6b83fe55 authored by Philip Reames's avatar Philip Reames Committed by GitHub
Browse files

[RISCV] Strength reduce mul by 2^n + 2/4/8 + 1 (#88911)



With zba, we can expand this to (add (shl X, C1), (shXadd X, X)).

Note that this is our first expansion to a three instruction sequence. I
believe this to general be a reasonable tradeoff for most architectures,
but we may want to (someday) consider a tuning flag here.

I plan to support 2^n + (2/4/8 + 1) eventually as well, but that comes
behind 2^N - 2^M. Both are also three instruction sequences.

---------

Co-authored-by: default avatarMin-Yih Hsu <min@myhsu.dev>
parent aefff774
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment