Debian Codegraph @

llvm/test/CodeGen/PowerPC/i64_fp_round.ll

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; Verify that we get the code sequence needed to avoid double-rounding.
3 ; Note that only parts of the sequence are checked for here, to allow
4 ; for minor code generation differences.
5 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-fpcvt < %s | FileCheck %s
6 ; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-fpcvt -mattr=-isel < %s | FileCheck %s --check-prefix=CHECK-NO-ISEL
7 ; Also check that with fpexcept.ignore we do not get that extra
8 ; code sequence. Simply verify that there is no "isel" present.
9
10 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
11 target triple = "powerpc64-unknown-linux-gnu"
12
13 define float @test(i64 %x) nounwind readnone {
14 ; Verify that we get the code sequence needed to avoid double-rounding.
15 ; Note that only parts of the sequence are checked for here, to allow
16 ; for minor code generation differences.
17 ; Also check that with fpexcept.ignore we do not get that extra
18 ; code sequence. Simply verify that there is no "isel" present.
19 ; CHECK-LABEL: test:
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: clrldi 4, 3, 53
22 ; CHECK-NEXT: sradi 5, 3, 53
23 ; CHECK-NEXT: addi 4, 4, 2047
24 ; CHECK-NEXT: addi 5, 5, 1
25 ; CHECK-NEXT: or 4, 4, 3
26 ; CHECK-NEXT: cmpldi 5, 1
27 ; CHECK-NEXT: rldicr 4, 4, 0, 52
28 ; CHECK-NEXT: iselgt 3, 4, 3
29 ; CHECK-NEXT: std 3, -8(1)
30 ; CHECK-NEXT: lfd 0, -8(1)
31 ; CHECK-NEXT: xscvsxddp 0, 0
32 ; CHECK-NEXT: frsp 1, 0
33 ; CHECK-NEXT: blr
34 ;
35 ; CHECK-NO-ISEL-LABEL: test:
36 ; CHECK-NO-ISEL: # %bb.0: # %entry
37 ; CHECK-NO-ISEL-NEXT: sradi 4, 3, 53
38 ; CHECK-NO-ISEL-NEXT: addi 4, 4, 1
39 ; CHECK-NO-ISEL-NEXT: cmpldi 4, 1
40 ; CHECK-NO-ISEL-NEXT: bc 4, 1, .LBB0_2
41 ; CHECK-NO-ISEL-NEXT: # %bb.1:
42 ; CHECK-NO-ISEL-NEXT: clrldi 4, 3, 53
43 ; CHECK-NO-ISEL-NEXT: addi 4, 4, 2047
44 ; CHECK-NO-ISEL-NEXT: or 3, 4, 3
45 ; CHECK-NO-ISEL-NEXT: rldicr 3, 3, 0, 52
46 ; CHECK-NO-ISEL-NEXT: .LBB0_2: # %entry
47 ; CHECK-NO-ISEL-NEXT: std 3, -8(1)
48 ; CHECK-NO-ISEL-NEXT: lfd 0, -8(1)
49 ; CHECK-NO-ISEL-NEXT: xscvsxddp 0, 0
50 ; CHECK-NO-ISEL-NEXT: frsp 1, 0
51 ; CHECK-NO-ISEL-NEXT: blr
52
53 entry:
54 %conv = sitofp i64 %x to float
55 ret float %conv
56 }
57
58 ; TODO: Add sitofp afn test.