@@ -646,11 +646,11 @@ define i32 @test125_fast_shift(i32 %x) "target-features"="+alu-lsl-fast" {
646
646
; GISEL-NEXT: mul w0, w0, w8
647
647
; GISEL-NEXT: ret
648
648
649
- %mul = mul nsw i32 %x , 125 ; 63 = 1 - ((1-32) << 2)
649
+ %mul = mul nsw i32 %x , 125 ; 125 = 1 - ((1-32) << 2)
650
650
ret i32 %mul
651
651
}
652
652
653
- ; Negative test: The shift number 5 is out of bound
653
+ ; TODO: (1 - 2^M) * (1 - 2^N)
654
654
define i32 @test225_fast_shift (i32 %x ) "target-features" ="+alu-lsl-fast" {
655
655
; CHECK-LABEL: test225_fast_shift:
656
656
; CHECK: // %bb.0:
@@ -664,7 +664,7 @@ define i32 @test225_fast_shift(i32 %x) "target-features"="+alu-lsl-fast" {
664
664
; GISEL-NEXT: mul w0, w0, w8
665
665
; GISEL-NEXT: ret
666
666
667
- %mul = mul nsw i32 %x , 225 ; 225 = 1 - ((1-8) << 5 )
667
+ %mul = mul nsw i32 %x , 225 ; 225 = (1-16)*(1-16 )
668
668
ret i32 %mul
669
669
}
670
670
@@ -686,6 +686,24 @@ define i32 @test297_fast_shift(i32 %x) "target-features"="+alu-lsl-fast" {
686
686
ret i32 %mul
687
687
}
688
688
689
+ ; Negative test: The shift number 5 is out of bound
690
+ define i32 @test481_fast_shift (i32 %x ) "target-features" ="+alu-lsl-fast" {
691
+ ; CHECK-LABEL: test481_fast_shift:
692
+ ; CHECK: // %bb.0:
693
+ ; CHECK-NEXT: mov w8, #481 // =0x1e1
694
+ ; CHECK-NEXT: mul w0, w0, w8
695
+ ; CHECK-NEXT: ret
696
+ ;
697
+ ; GISEL-LABEL: test481_fast_shift:
698
+ ; GISEL: // %bb.0:
699
+ ; GISEL-NEXT: mov w8, #481 // =0x1e1
700
+ ; GISEL-NEXT: mul w0, w0, w8
701
+ ; GISEL-NEXT: ret
702
+
703
+ %mul = mul nsw i32 %x , 481 ; 481 = 1 - ((1-16) << 5)
704
+ ret i32 %mul
705
+ }
706
+
689
707
; Convert mul x, -pow2 to shift.
690
708
; Convert mul x, -(pow2 +/- 1) to shift + add/sub.
691
709
; Lowering other negative constants are not supported yet.
@@ -963,9 +981,9 @@ define <4 x i32> @muladd_demand_commute(<4 x i32> %x, <4 x i32> %y) {
963
981
;
964
982
; GISEL-LABEL: muladd_demand_commute:
965
983
; GISEL: // %bb.0:
966
- ; GISEL-NEXT: adrp x8, .LCPI55_0
984
+ ; GISEL-NEXT: adrp x8, .LCPI56_0
967
985
; GISEL-NEXT: movi v3.4s, #1, msl #16
968
- ; GISEL-NEXT: ldr q2, [x8, :lo12:.LCPI55_0 ]
986
+ ; GISEL-NEXT: ldr q2, [x8, :lo12:.LCPI56_0 ]
969
987
; GISEL-NEXT: mla v1.4s, v0.4s, v2.4s
970
988
; GISEL-NEXT: and v0.16b, v1.16b, v3.16b
971
989
; GISEL-NEXT: ret
0 commit comments