2014-10-19 22:48:47 +02:00
|
|
|
; FIXME: FastISel currently returns false if it hits code that uses VSX
|
2015-02-27 19:32:11 +01:00
|
|
|
; registers and with -fast-isel-abort=1 turned on the test case will then fail.
|
2014-10-19 22:48:47 +02:00
|
|
|
; When fastisel better supports VSX fix up this test case.
|
|
|
|
;
|
2017-10-11 22:20:58 +02:00
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s
|
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx | FileCheck %s
|
2014-10-19 22:48:47 +02:00
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=970 -mattr=-vsx | FileCheck %s --check-prefix=PPC970
|
2014-06-24 22:05:18 +02:00
|
|
|
|
2015-02-27 19:32:11 +01:00
|
|
|
;; Tests for 970 don't use -fast-isel-abort=1 because we intentionally punt
|
2014-06-24 22:05:18 +02:00
|
|
|
;; to SelectionDAG in some cases.
|
2013-08-30 17:18:11 +02:00
|
|
|
|
|
|
|
; Test sitofp
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_single_i64(i64 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_single_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_single_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = sitofp i64 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfids
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_single_i32(i32 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_single_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_single_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = sitofp i32 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK-NEXT: li
|
|
|
|
; CHECK-NEXT: lfiwax
|
|
|
|
; CHECK-NEXT: fcfids
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_single_i16(i16 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_single_i16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_single_i16
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = sitofp i16 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: extsh
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfids
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: extsh
|
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_single_i8(i8 %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_single_i8
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_single_i8
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = sitofp i8 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: extsb
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfids
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: extsb
|
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_double_i32(i32 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_double_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_double_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = sitofp i32 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK-NOT: ori
|
|
|
|
; CHECK: li
|
|
|
|
; CHECK-NOT: ori
|
|
|
|
; CHECK: lfiwax
|
|
|
|
; CHECK: fcfid
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_double_i64(i64 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_double_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_double_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = sitofp i64 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfid
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_double_i16(i16 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_double_i16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_double_i16
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = sitofp i16 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: extsh
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfid
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: extsh
|
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @sitofp_double_i8(i8 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: sitofp_double_i8
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: sitofp_double_i8
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = sitofp i8 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: extsb
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfid
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: extsb
|
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Test uitofp
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_single_i64(i64 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_single_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_single_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = uitofp i64 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidus
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: fcfidus
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_single_i32(i32 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_single_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_single_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = uitofp i32 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK-NOT: ori
|
|
|
|
; CHECK: li
|
|
|
|
; CHECK-NOT: ori
|
|
|
|
; CHECK: lfiwzx
|
|
|
|
; CHECK: fcfidus
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: lfiwzx
|
|
|
|
; PPC970-NOT: fcfidus
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_single_i16(i16 %a, float %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_single_i16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_single_i16
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = uitofp i16 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidus
|
2015-04-23 20:30:38 +02:00
|
|
|
; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_single_i8(i8 %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_single_i8
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_single_i8
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca float, align 4
|
|
|
|
%conv = uitofp i8 %a to float
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidus
|
2015-04-23 20:30:38 +02:00
|
|
|
; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
|
|
|
; PPC970: frsp
|
2013-08-30 17:18:11 +02:00
|
|
|
store float %conv, float* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_double_i64(i64 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_double_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_double_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = uitofp i64 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidu
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: fcfidu
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_double_i32(i32 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_double_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_double_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = uitofp i32 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: std
|
|
|
|
; CHECK-NEXT: li
|
|
|
|
; CHECK-NEXT: lfiwzx
|
|
|
|
; CHECK-NEXT: fcfidu
|
|
|
|
; CHECKLE: fcfidu
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: lfiwzx
|
|
|
|
; PPC970-NOT: fcfidu
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_double_i16(i16 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_double_i16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_double_i16
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = uitofp i16 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidu
|
2015-04-23 20:30:38 +02:00
|
|
|
; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @uitofp_double_i8(i8 %a, double %b) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: uitofp_double_i8
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: uitofp_double_i8
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca double, align 8
|
|
|
|
%conv = uitofp i8 %a to double
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
|
|
|
|
; CHECK: std
|
|
|
|
; CHECK: lfd
|
|
|
|
; CHECK: fcfidu
|
2015-04-23 20:30:38 +02:00
|
|
|
; PPC970: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: std
|
|
|
|
; PPC970: lfd
|
|
|
|
; PPC970: fcfid
|
2013-08-30 17:18:11 +02:00
|
|
|
store double %conv, double* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Test fptosi
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptosi_float_i32(float %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptosi_float_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptosi_float_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i32, align 4
|
|
|
|
%conv = fptosi float %a to i32
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiwz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: lwa
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctiwz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: lwa
|
2013-08-30 17:18:11 +02:00
|
|
|
store i32 %conv, i32* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptosi_float_i64(float %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptosi_float_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptosi_float_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i64, align 4
|
|
|
|
%conv = fptosi float %a to i64
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctidz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: ld
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctidz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: ld
|
2013-08-30 17:18:11 +02:00
|
|
|
store i64 %conv, i64* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptosi_double_i32(double %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptosi_double_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptosi_double_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i32, align 8
|
|
|
|
%conv = fptosi double %a to i32
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiwz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: lwa
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctiwz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: lwa
|
2013-08-30 17:18:11 +02:00
|
|
|
store i32 %conv, i32* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptosi_double_i64(double %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptosi_double_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptosi_double_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i64, align 8
|
|
|
|
%conv = fptosi double %a to i64
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctidz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: ld
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctidz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: ld
|
2013-08-30 17:18:11 +02:00
|
|
|
store i64 %conv, i64* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Test fptoui
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptoui_float_i32(float %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptoui_float_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptoui_float_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i32, align 4
|
|
|
|
%conv = fptoui float %a to i32
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiwuz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: lwz
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctidz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: lwz
|
2013-08-30 17:18:11 +02:00
|
|
|
store i32 %conv, i32* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptoui_float_i64(float %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptoui_float_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptoui_float_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i64, align 4
|
|
|
|
%conv = fptoui float %a to i64
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiduz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: ld
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: fctiduz
|
2013-08-30 17:18:11 +02:00
|
|
|
store i64 %conv, i64* %b.addr, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptoui_double_i32(double %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptoui_double_i32
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptoui_double_i32
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i32, align 8
|
|
|
|
%conv = fptoui double %a to i32
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiwuz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: lwz
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fctidz
|
|
|
|
; PPC970: stfd
|
|
|
|
; PPC970: lwz
|
2013-08-30 17:18:11 +02:00
|
|
|
store i32 %conv, i32* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2015-07-24 03:07:50 +02:00
|
|
|
define void @fptoui_double_i64(double %a) nounwind {
|
2013-08-30 17:18:11 +02:00
|
|
|
entry:
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fptoui_double_i64
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970: fptoui_double_i64
|
2013-08-30 17:18:11 +02:00
|
|
|
%b.addr = alloca i64, align 8
|
|
|
|
%conv = fptoui double %a to i64
|
2017-10-11 22:20:58 +02:00
|
|
|
; CHECK: fctiduz
|
|
|
|
; CHECK: stfd
|
|
|
|
; CHECK: ld
|
2014-06-24 22:05:18 +02:00
|
|
|
; PPC970-NOT: fctiduz
|
2013-08-30 17:18:11 +02:00
|
|
|
store i64 %conv, i64* %b.addr, align 8
|
|
|
|
ret void
|
|
|
|
}
|