1 ; RUN: llc < %s -O0 -relocation-model=pic -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -ppc-late-peephole=true | FileCheck %s --check-prefix=ELF64
3 define i32 @t1(i8 signext %a) nounwind {
8 define i32 @t2(i8 zeroext %a) nounwind {
13 define i32 @t3(i16 signext %a) nounwind {
14 %1 = sext i16 %a to i32
18 define i32 @t4(i16 zeroext %a) nounwind {
19 %1 = zext i16 %a to i32
23 define void @foo(i8 %a, i16 %b) nounwind {
25 %1 = call i32 @t1(i8 signext %a)
27 %2 = call i32 @t2(i8 zeroext %a)
28 ; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 56
29 %3 = call i32 @t3(i16 signext %b)
31 %4 = call i32 @t4(i16 zeroext %b)
32 ; ELF64: clrldi {{[0-9]+}}, {{[0-9]+}}, 48
34 ;; A few test to check materialization
35 %5 = call i32 @t2(i8 zeroext 255)
38 %6 = call i32 @t4(i16 zeroext 65535)
40 ; ELF64: ori 3, 3, 65535
41 ; ELF64: clrldi 3, 3, 48
46 define void @foo2() nounwind {
47 %1 = call signext i16 @t5()
48 %2 = call zeroext i16 @t6()
49 %3 = call signext i8 @t7()
50 %4 = call zeroext i8 @t8()
54 declare signext i16 @t5();
55 declare zeroext i16 @t6();
56 declare signext i8 @t7();
57 declare zeroext i8 @t8();
59 define i32 @t10(i32 %argc, i8** nocapture %argv) nounwind {
62 %call = call i32 @bar(i8 zeroext 0, i8 zeroext -8, i8 zeroext -69, i8 zeroext 28, i8 zeroext 40, i8 zeroext -70)
74 declare i32 @bar(i8 zeroext, i8 zeroext, i8 zeroext, i8 zeroext, i8 zeroext, i8 zeroext)
76 define i32 @bar0(i32 %i) nounwind {
80 ; Function pointers are not yet implemented.
81 ;define void @foo3() uwtable {
82 ; %fptr = alloca i32 (i32)*, align 8
83 ; store i32 (i32)* @bar0, i32 (i32)** %fptr, align 8
84 ; %1 = load i32 (i32)*, i32 (i32)** %fptr, align 8
85 ; %call = call i32 %1(i32 0)
89 ; Intrinsic calls not yet implemented, and udiv isn't one for PPC anyway.
90 ;define i32 @LibCall(i32 %a, i32 %b) {
92 ; %tmp1 = udiv i32 %a, %b ; <i32> [#uses=1]
96 declare void @float_foo(float %f)
98 define void @float_const() nounwind {
101 call void @float_foo(float 0x401C666660000000)
102 ; ELF64: addis [[REG:[0-9]+]], 2, .LCPI[[SUF:[0-9_]+]]@toc@ha
103 ; ELF64: lfs 1, .LCPI[[SUF]]@toc@l([[REG]])
107 define void @float_reg(float %dummy, float %f) nounwind {
110 call void @float_foo(float %f)
115 declare void @double_foo(double %d)
117 define void @double_const() nounwind {
119 ; ELF64: double_const
120 call void @double_foo(double 0x1397723CCABD0000401C666660000000)
121 ; ELF64: addis [[REG2:[0-9]+]], 2, .LCPI[[SUF2:[0-9_]+]]@toc@ha
122 ; ELF64: lfd 1, .LCPI[[SUF2]]@toc@l([[REG2]])
126 define void @double_reg(double %dummy, double %d) nounwind {
129 call void @double_foo(double %d)