Skip to content
Commit 4196ca32 authored by Noah Goldstein's avatar Noah Goldstein Committed by Phoebe Wang
Browse files

[X86] Improve mul x, 2^N +/- 2 pattern by making the +/- 2x compute independently to x << N

Previous pattern was omitting ops in sequence which just increases the
latency (to 3c, same as imul!) i.e:

`(add/sub (add/sub (shl x, N), x), x)`

Better is to compute 2x indepedently so x << N for better ULP i.e:
`(add/sub (shl x, N), (add x, x))`

Reviewed By: pengfei, RKSimon

Differential Revision: https://reviews.llvm.org/D141113
parent 49165230
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment