1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Regenerate FP_TO_INT tests.

Precursor to fix for PR17686

llvm-svn: 345453
This commit is contained in:
Simon Pilgrim 2018-10-27 15:00:38 +00:00
parent 80248f7405
commit 0fcb066294
4 changed files with 3016 additions and 581 deletions

View File

@ -1,17 +1,33 @@
; RUN: llc -march=mips < %s | FileCheck %s
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=mips-- | FileCheck %s
define i32 @fptoint(float %a) nounwind {
; CHECK-LABEL: fptoint:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: trunc.w.s $f0, $f12
; CHECK-NEXT: jr $ra
; CHECK-NEXT: mfc1 $2, $f0
entry:
; CHECK: trunc.w.s
fptosi float %a to i32 ; <i32>:0 [#uses=1]
ret i32 %0
}
define i32 @fptouint(float %a) nounwind {
; CHECK-LABEL: fptouint:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: lui $1, %hi($CPI1_0)
; CHECK-NEXT: lwc1 $f0, %lo($CPI1_0)($1)
; CHECK-NEXT: sub.s $f1, $f12, $f0
; CHECK-NEXT: trunc.w.s $f1, $f1
; CHECK-NEXT: mfc1 $1, $f1
; CHECK-NEXT: lui $2, 32768
; CHECK-NEXT: xor $2, $1, $2
; CHECK-NEXT: trunc.w.s $f1, $f12
; CHECK-NEXT: mfc1 $1, $f1
; CHECK-NEXT: c.olt.s $f12, $f0
; CHECK-NEXT: jr $ra
; CHECK-NEXT: movt $2, $1, $fcc0
entry:
; CHECK: fptouint
; CHECK: trunc.w.s
; CHECK: trunc.w.s
fptoui float %a to i32 ; <i32>:0 [#uses=1]
ret i32 %0
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; Test conversion of floating-point values to unsigned i32s (z10 only).
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
@ -10,11 +11,19 @@
; Test f32->i32.
define i32 @f1(float %f) {
; CHECK-LABEL: f1:
; CHECK: cebr
; CHECK: sebr
; CHECK: cfebr
; CHECK: xilf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: larl %r1, .LCPI0_0
; CHECK-NEXT: le %f1, 0(%r1)
; CHECK-NEXT: cebr %f0, %f1
; CHECK-NEXT: jnl .LBB0_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cfebr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB0_2:
; CHECK-NEXT: sebr %f0, %f1
; CHECK-NEXT: cfebr %r2, 5, %f0
; CHECK-NEXT: xilf %r2, 2147483648
; CHECK-NEXT: br %r14
%conv = fptoui float %f to i32
ret i32 %conv
}
@ -22,11 +31,19 @@ define i32 @f1(float %f) {
; Test f64->i32.
define i32 @f2(double %f) {
; CHECK-LABEL: f2:
; CHECK: cdbr
; CHECK: sdbr
; CHECK: cfdbr
; CHECK: xilf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: larl %r1, .LCPI1_0
; CHECK-NEXT: ldeb %f1, 0(%r1)
; CHECK-NEXT: cdbr %f0, %f1
; CHECK-NEXT: jnl .LBB1_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cfdbr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB1_2:
; CHECK-NEXT: sdbr %f0, %f1
; CHECK-NEXT: cfdbr %r2, 5, %f0
; CHECK-NEXT: xilf %r2, 2147483648
; CHECK-NEXT: br %r14
%conv = fptoui double %f to i32
ret i32 %conv
}
@ -34,11 +51,21 @@ define i32 @f2(double %f) {
; Test f128->i32.
define i32 @f3(fp128 *%src) {
; CHECK-LABEL: f3:
; CHECK: cxbr
; CHECK: sxbr
; CHECK: cfxbr
; CHECK: xilf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: ld %f0, 0(%r2)
; CHECK-NEXT: ld %f2, 8(%r2)
; CHECK-NEXT: larl %r1, .LCPI2_0
; CHECK-NEXT: lxeb %f1, 0(%r1)
; CHECK-NEXT: cxbr %f0, %f1
; CHECK-NEXT: jnl .LBB2_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cfxbr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB2_2:
; CHECK-NEXT: sxbr %f0, %f1
; CHECK-NEXT: cfxbr %r2, 5, %f0
; CHECK-NEXT: xilf %r2, 2147483648
; CHECK-NEXT: br %r14
%f = load fp128, fp128 *%src
%conv = fptoui fp128 %f to i32
ret i32 %conv

View File

@ -1,3 +1,4 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; Test conversion of floating-point values to unsigned i64s (z10 only).
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
@ -9,11 +10,19 @@
; Test f32->i64.
define i64 @f1(float %f) {
; CHECK-LABEL: f1:
; CHECK: cebr
; CHECK: sebr
; CHECK: cgebr
; CHECK: xihf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: larl %r1, .LCPI0_0
; CHECK-NEXT: le %f1, 0(%r1)
; CHECK-NEXT: cebr %f0, %f1
; CHECK-NEXT: jnl .LBB0_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cgebr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB0_2:
; CHECK-NEXT: sebr %f0, %f1
; CHECK-NEXT: cgebr %r2, 5, %f0
; CHECK-NEXT: xihf %r2, 2147483648
; CHECK-NEXT: br %r14
%conv = fptoui float %f to i64
ret i64 %conv
}
@ -21,11 +30,19 @@ define i64 @f1(float %f) {
; Test f64->i64.
define i64 @f2(double %f) {
; CHECK-LABEL: f2:
; CHECK: cdbr
; CHECK: sdbr
; CHECK: cgdbr
; CHECK: xihf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: larl %r1, .LCPI1_0
; CHECK-NEXT: ldeb %f1, 0(%r1)
; CHECK-NEXT: cdbr %f0, %f1
; CHECK-NEXT: jnl .LBB1_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cgdbr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB1_2:
; CHECK-NEXT: sdbr %f0, %f1
; CHECK-NEXT: cgdbr %r2, 5, %f0
; CHECK-NEXT: xihf %r2, 2147483648
; CHECK-NEXT: br %r14
%conv = fptoui double %f to i64
ret i64 %conv
}
@ -33,11 +50,21 @@ define i64 @f2(double %f) {
; Test f128->i64.
define i64 @f3(fp128 *%src) {
; CHECK-LABEL: f3:
; CHECK: cxbr
; CHECK: sxbr
; CHECK: cgxbr
; CHECK: xihf
; CHECK: br %r14
; CHECK: # %bb.0:
; CHECK-NEXT: ld %f0, 0(%r2)
; CHECK-NEXT: ld %f2, 8(%r2)
; CHECK-NEXT: larl %r1, .LCPI2_0
; CHECK-NEXT: lxeb %f1, 0(%r1)
; CHECK-NEXT: cxbr %f0, %f1
; CHECK-NEXT: jnl .LBB2_2
; CHECK-NEXT: # %bb.1:
; CHECK-NEXT: cgxbr %r2, 5, %f0
; CHECK-NEXT: br %r14
; CHECK-NEXT: .LBB2_2:
; CHECK-NEXT: sxbr %f0, %f1
; CHECK-NEXT: cgxbr %r2, 5, %f0
; CHECK-NEXT: xihf %r2, 2147483648
; CHECK-NEXT: br %r14
%f = load fp128, fp128 *%src
%conv = fptoui fp128 %f to i64
ret i64 %conv