1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | \
2 ; RUN: FileCheck %s -check-prefix=PPC32-LINUX
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu \
5 ; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC32-LINUX
7 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | \
8 ; RUN: FileCheck %s -check-prefixes=PPC64,PPC64-LINUX
10 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
11 ; RUN: -frame-pointer=all | FileCheck %s -check-prefixes=PPC64,PPC64-LINUX
13 ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
14 ; RUN: -mtriple=powerpc-ibm-aix-xcoff | FileCheck %s \
15 ; RUN: -check-prefix=PPC32-AIX
17 ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
18 ; RUN: -mtriple=powerpc-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
19 ; RUN: -check-prefix=PPC32-AIX
21 ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
22 ; RUN: -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s \
23 ; RUN: -check-prefixes=PPC64,PPC64-AIX
25 ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
26 ; RUN: -mtriple=powerpc64-ibm-aix-xcoff -frame-pointer=all | FileCheck %s \
27 ; RUN: -check-prefixes=PPC64,PPC64-AIX
29 define dso_local signext i32 @foo(i32 %n) {
32 %0 = alloca i32, i32 %n
33 store ptr %0, ptr %ptr0
34 %1 = alloca i32, i32 %n
35 %2 = alloca i32, i32 %n
36 %3 = alloca i32, i32 %n
37 %4 = alloca i32, i32 %n
38 %5 = alloca i32, i32 %n
39 %6 = alloca i32, i32 %n
40 %7 = alloca i32, i32 %n
41 %8 = alloca i32, i32 %n
42 %9 = load ptr, ptr %ptr0
44 %call = call i32 @bar(ptr %1, ptr %2, ptr %3, ptr %4, ptr %5, ptr %6, ptr %7, ptr %8, ptr %9)
48 declare i32 @bar(ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr)
50 ; PPC32-LINUX-LABEL: foo
52 ; PPC32-LINUX: stwu 1, -32(1)
53 ; PPC32-LINUX: stw 31, 28(1)
54 ; PPC32-LINUX: stw 0, 36(1)
55 ; PPC32-LINUX: mr 31, 1
56 ; PPC32-LINUX: addi 3, 31, 32
57 ; PPC32-LINUX: stwux 3, 1, 10
59 ; Allocated area is referred by stack pointer.
60 ; PPC32-LINUX: addi 11, 1, 16
62 ; Local variable area is referred by frame pointer.
63 ; PPC32-LINUX: stw 11, 24(31)
73 ; PPC32-LINUX-NOT: stuwux
75 ; Parameter save area is referred by stack pointer.
76 ; PPC32-LINUX: stw 11, 8(1)
79 ; PPC32-LINUX: lwz 31, 0(1)
80 ; PPC32-LINUX: lwz 0, -4(31)
81 ; PPC32-LINUX: mr 1, 31
82 ; PPC32-LINUX: mr 31, 0
83 ; PPC32-LINUX: lwz 0, 4(1)
89 ; PPC64: std 31, -8(1)
90 ; PPC64: stdu 1, -160(1)
92 ; PPC64-DAG: std 0, 176(1)
93 ; PPC64: addi 3, 31, 160
94 ; PPC64: stdux 3, 1, 10
96 ; Allocated area is referred by stack pointer.
97 ; PPC64: addi 11, 1, 128
99 ; Local variable area is referred by frame pointer.
100 ; PPC64: std 11, 144(31)
112 ; Parameter save area is referred by stack pointer.
113 ; PPC64: std 11, 112(1)
115 ; PPC64-LINUX: bl bar
119 ; PPC64-DAG: ld 31, -8(1)
124 ; PPC32-AIX: stw 31, -4(1)
125 ; PPC32-AIX: stwu 1, -80(1)
126 ; PPC32-AIX: mr 31, 1
127 ; PPC32-AIX: stw 0, 88(1)
128 ; PPC32-AIX: addi 3, 31, 80
129 ; PPC32-AIX: stwux 3, 1, 10
131 ; Allocated area is referred by stack pointer.
132 ; PPC32-AIX: addi 11, 1, 64
134 ; Local variable area is referred by frame pointer.
135 ; PPC32-AIX: stw 11, 72(31)
145 ; PPC32-AIX-NOT: stwux
147 ; Parameter save area is referred by stack pointer.
148 ; PPC32-AIX: stw 11, 56(1)
152 ; PPC32-AIX: lwz 1, 0(1)
153 ; PPC32-AIX: lwz 0, 8(1)
154 ; PPC32-AIX-DAG: mtlr 0
155 ; PPC32-AIX-DAG: lwz 31, -4(1)