[llvm] [AArch64][SelectionDAG] Lower multiplication by a constant to shl+add+shl+add (PR #89532)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 00:09:51 PDT 2024


================
@@ -510,6 +527,24 @@ define i32 @test25_fast_shift(i32 %x) "target-features"="+alu-lsl-fast" {
   ret i32 %mul
 }
 
+; Negative: 35 = (((1<<4) + 1) << 1) + 1, the shift number 4 is out of bound
----------------
vfdff wrote:

the `(2^N - 1)` can't be execused via a single instruction, so we need 2 instrunction to support the `7` ?

https://github.com/llvm/llvm-project/pull/89532


More information about the llvm-commits mailing list