Skip to content

Commit

Permalink
Pre-commit test (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rose committed Apr 23, 2024
1 parent b4a0fd4 commit 231beff
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions llvm/test/CodeGen/AArch64/GlobalISel/combine-udiv.ll
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,29 @@ define <8 x i16> @pr38477(<8 x i16> %a0) {
%1 = udiv <8 x i16> %a0, <i16 1, i16 119, i16 73, i16 -111, i16 -3, i16 118, i16 32, i16 31>
ret <8 x i16> %1
}

define i32 @udiv_div_by_180(i32 %x)
; SDAG-LABEL: udiv_div_by_180:
; SDAG: // %bb.0:
; SDAG-NEXT: mov w8, #5826 // =0x16c2
; SDAG-NEXT: and w9, w0, #0xff
; SDAG-NEXT: movk w8, #364, lsl #16
; SDAG-NEXT: umull x8, w9, w8
; SDAG-NEXT: lsr x0, x8, #32
; SDAG-NEXT: // kill: def $w0 killed $w0 killed $x0
; SDAG-NEXT: ret
;
; GISEL-LABEL: udiv_div_by_180:
; GISEL: // %bb.0:
; GISEL-NEXT: ubfx w8, w0, #2, #6
; GISEL-NEXT: mov w9, #27671 // =0x6c17
; GISEL-NEXT: movk w9, #5825, lsl #16
; GISEL-NEXT: umull x8, w8, w9
; GISEL-NEXT: lsr x8, x8, #32
; GISEL-NEXT: lsr w0, w8, #2
; GISEL-NEXT: ret
{
%truncate = and i32 %x, 255
%udiv = udiv i32 %truncate, 180
ret i32 %udiv
}

0 comments on commit 231beff

Please sign in to comment.