-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automerge: [X86][GlobalISel] Enable G_LROUND/G_LLROUND with libcall m…
…apping (#125096)
- Loading branch information
Showing
5 changed files
with
340 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,100 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s | ||
; RUN: llc < %s -mtriple=i686-unknown -mattr=sse2 | FileCheck %s | ||
; RUN: llc < %s -mtriple=i686-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X86 | ||
; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64 | ||
; RUN: llc < %s -mtriple=x86_64-linux-gnu -global-isel -global-isel-abort=1 | FileCheck %s --check-prefixes=GISEL-X64 | ||
|
||
define i32 @testmsws(float %x) { | ||
define i32 @testmsws(float %x) nounwind { | ||
; CHECK-LABEL: testmsws: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: jmp lroundf # TAILCALL | ||
; | ||
; GISEL-X86-LABEL: testmsws: | ||
; GISEL-X86: # %bb.0: # %entry | ||
; GISEL-X86-NEXT: subl $12, %esp | ||
; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax | ||
; GISEL-X86-NEXT: movl %eax, (%esp) | ||
; GISEL-X86-NEXT: calll lroundf | ||
; GISEL-X86-NEXT: addl $12, %esp | ||
; GISEL-X86-NEXT: retl | ||
; | ||
; X64-LABEL: testmsws: | ||
; X64: # %bb.0: # %entry | ||
; X64-NEXT: jmp lroundf@PLT # TAILCALL | ||
; | ||
; GISEL-X64-LABEL: testmsws: | ||
; GISEL-X64: # %bb.0: # %entry | ||
; GISEL-X64-NEXT: pushq %rax | ||
; GISEL-X64-NEXT: callq lroundf | ||
; GISEL-X64-NEXT: popq %rcx | ||
; GISEL-X64-NEXT: retq | ||
entry: | ||
%0 = tail call i32 @llvm.lround.i32.f32(float %x) | ||
ret i32 %0 | ||
} | ||
|
||
define i32 @testmswd(double %x) { | ||
define i32 @testmswd(double %x) nounwind { | ||
; CHECK-LABEL: testmswd: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: jmp lround # TAILCALL | ||
; | ||
; GISEL-X86-LABEL: testmswd: | ||
; GISEL-X86: # %bb.0: # %entry | ||
; GISEL-X86-NEXT: subl $12, %esp | ||
; GISEL-X86-NEXT: leal {{[0-9]+}}(%esp), %eax | ||
; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx | ||
; GISEL-X86-NEXT: movl 4(%eax), %eax | ||
; GISEL-X86-NEXT: xorl %edx, %edx | ||
; GISEL-X86-NEXT: addl %esp, %edx | ||
; GISEL-X86-NEXT: movl %ecx, (%esp) | ||
; GISEL-X86-NEXT: movl %eax, 4(%edx) | ||
; GISEL-X86-NEXT: calll lround | ||
; GISEL-X86-NEXT: addl $12, %esp | ||
; GISEL-X86-NEXT: retl | ||
; | ||
; X64-LABEL: testmswd: | ||
; X64: # %bb.0: # %entry | ||
; X64-NEXT: jmp lround@PLT # TAILCALL | ||
; | ||
; GISEL-X64-LABEL: testmswd: | ||
; GISEL-X64: # %bb.0: # %entry | ||
; GISEL-X64-NEXT: pushq %rax | ||
; GISEL-X64-NEXT: callq lround | ||
; GISEL-X64-NEXT: popq %rcx | ||
; GISEL-X64-NEXT: retq | ||
entry: | ||
%0 = tail call i32 @llvm.lround.i32.f64(double %x) | ||
ret i32 %0 | ||
} | ||
|
||
define i32 @testmsll(x86_fp80 %x) { | ||
define i32 @testmsll(x86_fp80 %x) nounwind { | ||
; CHECK-LABEL: testmsll: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: jmp lroundl # TAILCALL | ||
; | ||
; GISEL-X86-LABEL: testmsll: | ||
; GISEL-X86: # %bb.0: # %entry | ||
; GISEL-X86-NEXT: subl $12, %esp | ||
; GISEL-X86-NEXT: fldt {{[0-9]+}}(%esp) | ||
; GISEL-X86-NEXT: fstpt (%esp) | ||
; GISEL-X86-NEXT: calll lroundl | ||
; GISEL-X86-NEXT: addl $12, %esp | ||
; GISEL-X86-NEXT: retl | ||
; | ||
; X64-LABEL: testmsll: | ||
; X64: # %bb.0: # %entry | ||
; X64-NEXT: jmp lroundl@PLT # TAILCALL | ||
; | ||
; GISEL-X64-LABEL: testmsll: | ||
; GISEL-X64: # %bb.0: # %entry | ||
; GISEL-X64-NEXT: subq $24, %rsp | ||
; GISEL-X64-NEXT: fldt {{[0-9]+}}(%rsp) | ||
; GISEL-X64-NEXT: fstpt (%rsp) | ||
; GISEL-X64-NEXT: callq lroundl | ||
; GISEL-X64-NEXT: addq $24, %rsp | ||
; GISEL-X64-NEXT: retq | ||
entry: | ||
%0 = tail call i32 @llvm.lround.i32.f80(x86_fp80 %x) | ||
ret i32 %0 | ||
} | ||
|
||
declare i32 @llvm.lround.i32.f32(float) nounwind readnone | ||
declare i32 @llvm.lround.i32.f64(double) nounwind readnone | ||
declare i32 @llvm.lround.i32.f80(x86_fp80) nounwind readnone |
Oops, something went wrong.