59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 42; 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 allow4; for minor code generation differences.5; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-fpcvt < %s | FileCheck %s6; RUN: llc -verify-machineinstrs -mcpu=pwr7 -mattr=-fpcvt -mattr=-isel < %s | FileCheck %s --check-prefix=CHECK-NO-ISEL7; Also check that with fpexcept.ignore we do not get that extra8; code sequence. Simply verify that there is no "isel" present.9 10target 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"11target triple = "powerpc64-unknown-linux-gnu"12 13define 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 allow16; for minor code generation differences.17; Also check that with fpexcept.ignore we do not get that extra18; code sequence. Simply verify that there is no "isel" present.19; CHECK-LABEL: test:20; CHECK: # %bb.0: # %entry21; CHECK-NEXT: clrldi 4, 3, 5322; CHECK-NEXT: sradi 5, 3, 5323; CHECK-NEXT: addi 4, 4, 204724; CHECK-NEXT: addi 5, 5, 125; CHECK-NEXT: or 4, 4, 326; CHECK-NEXT: cmpldi 5, 127; CHECK-NEXT: rldicr 4, 4, 0, 5228; CHECK-NEXT: iselgt 3, 4, 329; CHECK-NEXT: std 3, -8(1)30; CHECK-NEXT: lfd 0, -8(1)31; CHECK-NEXT: xscvsxddp 0, 032; CHECK-NEXT: frsp 1, 033; CHECK-NEXT: blr34;35; CHECK-NO-ISEL-LABEL: test:36; CHECK-NO-ISEL: # %bb.0: # %entry37; CHECK-NO-ISEL-NEXT: sradi 4, 3, 5338; CHECK-NO-ISEL-NEXT: addi 4, 4, 139; CHECK-NO-ISEL-NEXT: cmpldi 4, 140; CHECK-NO-ISEL-NEXT: bc 4, 1, .LBB0_241; CHECK-NO-ISEL-NEXT: # %bb.1:42; CHECK-NO-ISEL-NEXT: clrldi 4, 3, 5343; CHECK-NO-ISEL-NEXT: addi 4, 4, 204744; CHECK-NO-ISEL-NEXT: or 3, 4, 345; CHECK-NO-ISEL-NEXT: rldicr 3, 3, 0, 5246; CHECK-NO-ISEL-NEXT: .LBB0_2: # %entry47; CHECK-NO-ISEL-NEXT: std 3, -8(1)48; CHECK-NO-ISEL-NEXT: lfd 0, -8(1)49; CHECK-NO-ISEL-NEXT: xscvsxddp 0, 050; CHECK-NO-ISEL-NEXT: frsp 1, 051; CHECK-NO-ISEL-NEXT: blr52 53entry:54 %conv = sitofp i64 %x to float55 ret float %conv56}57 58; TODO: Add sitofp afn test.59