Skip to content

Commit

Permalink
[X86] Pre-commit tests (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
AZero13 authored and tstellar committed Apr 24, 2024
1 parent e7c816b commit 76cbd41
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions llvm/test/CodeGen/X86/sar_fold.ll
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,44 @@ define i32 @shl24sar25(i32 %a) #0 {
%2 = ashr exact i32 %1, 25
ret i32 %2
}

define void @shl144sar48(ptr %p) #0 {
; CHECK-LABEL: shl144sar48:
; CHECK: # %bb.0:
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movswl (%eax), %ecx
; CHECK-NEXT: movl %ecx, %edx
; CHECK-NEXT: sarl $31, %edx
; CHECK-NEXT: shldl $2, %ecx, %edx
; CHECK-NEXT: shll $2, %ecx
; CHECK-NEXT: movl %ecx, 12(%eax)
; CHECK-NEXT: movl %edx, 16(%eax)
; CHECK-NEXT: movl $0, 8(%eax)
; CHECK-NEXT: movl $0, 4(%eax)
; CHECK-NEXT: movl $0, (%eax)
; CHECK-NEXT: retl
%a = load i160, ptr %p
%1 = shl i160 %a, 144
%2 = ashr exact i160 %1, 46
store i160 %2, ptr %p
ret void
}

define void @shl144sar2(ptr %p) #0 {
; CHECK-LABEL: shl144sar2:
; CHECK: # %bb.0:
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
; CHECK-NEXT: movswl (%eax), %ecx
; CHECK-NEXT: sarl $31, %ecx
; CHECK-NEXT: movl %ecx, 16(%eax)
; CHECK-NEXT: movl %ecx, 8(%eax)
; CHECK-NEXT: movl %ecx, 12(%eax)
; CHECK-NEXT: movl %ecx, 4(%eax)
; CHECK-NEXT: movl %ecx, (%eax)
; CHECK-NEXT: retl
%a = load i160, ptr %p
%1 = shl i160 %a, 144
%2 = ashr exact i160 %1, 2
store i160 %2, ptr %p
ret void
}

0 comments on commit 76cbd41

Please sign in to comment.