2014-10-20 04:48:47 +08:00
|
|
|
; FIXME: FastISel currently returns false if it hits code that uses VSX
|
2015-02-28 02:32:11 +08:00
|
|
|
; registers and with -fast-isel-abort=1 turned on the test case will then fail.
|
2014-10-20 04:48:47 +08:00
|
|
|
; When fastisel better supports VSX fix up this test case.
|
|
|
|
;
|
2015-02-28 02:32:11 +08:00
|
|
|
; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
|
2013-08-27 03:42:51 +08:00
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define zeroext i1 @rettrue() nounwind {
|
2014-09-18 07:25:06 +08:00
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: rettrue
|
|
|
|
; ELF64: li 3, 1
|
|
|
|
; ELF64: blr
|
|
|
|
ret i1 true
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define zeroext i1 @retfalse() nounwind {
|
2014-09-18 07:25:06 +08:00
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: retfalse
|
|
|
|
; ELF64: li 3, 0
|
|
|
|
; ELF64: blr
|
|
|
|
ret i1 false
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define signext i1 @retstrue() nounwind {
|
2014-09-18 07:25:06 +08:00
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: retstrue
|
|
|
|
; ELF64: li 3, -1
|
|
|
|
; ELF64: blr
|
|
|
|
ret i1 true
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define signext i1 @retsfalse() nounwind {
|
2014-09-18 07:25:06 +08:00
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: retsfalse
|
|
|
|
; ELF64: li 3, 0
|
|
|
|
; ELF64: blr
|
|
|
|
ret i1 false
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define signext i8 @ret2(i8 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret2
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: extsb
|
|
|
|
; ELF64: blr
|
|
|
|
ret i8 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define zeroext i8 @ret3(i8 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret3
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret i8 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define signext i16 @ret4(i16 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret4
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: extsh
|
|
|
|
; ELF64: blr
|
|
|
|
ret i16 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define zeroext i16 @ret5(i16 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret5
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret i16 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i16 @ret6(i16 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret6
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret i16 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define signext i32 @ret7(i32 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret7
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: extsw
|
|
|
|
; ELF64: blr
|
|
|
|
ret i32 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define zeroext i32 @ret8(i32 signext %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret8
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret i32 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @ret9(i32 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret9
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 32
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret i32 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @ret10(i64 %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret10
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64-NOT: exts
|
2017-09-23 17:50:12 +08:00
|
|
|
; ELF64-NOT: clrldi
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64-NOT: rldicl
|
|
|
|
; ELF64: blr
|
|
|
|
ret i64 %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define float @ret11(float %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret11
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret float %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define double @ret12(double %a) nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret12
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: blr
|
|
|
|
ret double %a
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i8 @ret13() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret13
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: li
|
|
|
|
; ELF64: blr
|
|
|
|
ret i8 15;
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i16 @ret14() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret14
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: li
|
|
|
|
; ELF64: blr
|
|
|
|
ret i16 -225;
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i32 @ret15() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret15
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: lis
|
|
|
|
; ELF64: ori
|
|
|
|
; ELF64: blr
|
|
|
|
ret i32 278135;
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define i64 @ret16() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret16
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: li
|
|
|
|
; ELF64: sldi
|
|
|
|
; ELF64: oris
|
|
|
|
; ELF64: ori
|
|
|
|
; ELF64: blr
|
|
|
|
ret i64 27813515225;
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define float @ret17() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret17
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: addis
|
|
|
|
; ELF64: lfs
|
|
|
|
; ELF64: blr
|
|
|
|
ret float 2.5;
|
|
|
|
}
|
|
|
|
|
2015-07-24 09:07:50 +08:00
|
|
|
define double @ret18() nounwind {
|
2013-08-27 03:42:51 +08:00
|
|
|
entry:
|
2014-09-18 07:25:06 +08:00
|
|
|
; ELF64-LABEL: ret18
|
2013-08-27 03:42:51 +08:00
|
|
|
; ELF64: addis
|
|
|
|
; ELF64: lfd
|
|
|
|
; ELF64: blr
|
|
|
|
ret double 2.5e-33;
|
|
|
|
}
|
2015-07-25 08:48:08 +08:00
|
|
|
|
|
|
|
define zeroext i32 @ret19() nounwind {
|
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: ret19
|
|
|
|
; ELF64: li
|
|
|
|
; ELF64: oris
|
|
|
|
; ELF64: ori
|
|
|
|
; ELF64: blr
|
|
|
|
ret i32 -1
|
|
|
|
}
|
2016-01-29 15:20:01 +08:00
|
|
|
|
|
|
|
define zeroext i16 @ret20() nounwind {
|
|
|
|
entry:
|
|
|
|
; ELF64-LABEL: ret20
|
|
|
|
; ELF64: lis{{.*}}0
|
|
|
|
; ELF64: ori{{.*}}32768
|
|
|
|
; ELF64: blr
|
|
|
|
ret i16 32768
|
|
|
|
}
|