1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu | \
2 ; RUN: FileCheck %s -check-prefix=PPC32-LINUX-NOFP
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc-unknown-linux-gnu \
5 ; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC32-LINUX-FP
7 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu | \
8 ; RUN: FileCheck %s -check-prefix=PPC64-LINUX-NOFP
10 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
11 ; RUN: -frame-pointer=all | FileCheck %s -check-prefix=PPC64-LINUX-FP
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-NOFP
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-FP
21 ; RUN: llc -verify-machineinstrs < %s -mcpu=pwr4 -mattr=-altivec \
22 ; RUN: -mtriple=powerpc64-ibm-aix-xcoff | FileCheck %s \
23 ; RUN: -check-prefix=PPC64-AIX-NOFP
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-prefix=PPC64-AIX-FP
29 define ptr @f1() nounwind {
30 %tmp = alloca i32, i32 8191 ; <ptr> [#uses=1]
34 ; - The stdux is used to update the back-chain link when allocated frame is large
35 ; that we can not address it by a 16-bit signed integer;
36 ; - The linkage area, if there is one, is still on the top of the stack after
39 ; PPC32-LINUX-NOFP-LABEL: f1
40 ; PPC32-LINUX-NOFP: lis 0, -1
41 ; PPC32-LINUX-NOFP-NEXT: ori 0, 0, 32752
42 ; PPC32-LINUX-NOFP-NEXT: stwux 1, 1, 0
43 ; PPC32-LINUX-NOFP-NOT: stwux
44 ; PPC32-LINUX-NOFP: mr 0, 31
45 ; PPC32-LINUX-NOFP-DAG: addi 3, 1, 20
46 ; PPC32-LINUX-NOFP-DAG: lwz 31, 0(1)
47 ; PPC32-LINUX-NOFP-NEXT: mr 1, 31
48 ; PPC32-LINUX-NOFP-NEXT: mr 31, 0
49 ; PPC32-LINUX-NOFP-NEXT: blr
51 ; PPC32-LINUX-FP-LABEL: f1
52 ; PPC32-LINUX-FP: lis 0, -1
53 ; PPC32-LINUX-FP-NEXT: ori 0, 0, 32752
54 ; PPC32-LINUX-FP-NEXT: stwux 1, 1, 0
55 ; PPC32-LINUX-FP-NOT: stwux
56 ; PPC32-LINUX-FP: mr 31, 1
57 ; PPC32-LINUX-FP-NEXT: addi 3, 31, 16
58 ; PPC32-LINUX-FP-NEXT: lwz 31, 0(1)
59 ; PPC32-LINUX-FP-NEXT: lwz 0, -4(31)
60 ; PPC32-LINUX-FP-NEXT: mr 1, 31
61 ; PPC32-LINUX-FP-NEXT: mr 31, 0
62 ; PPC32-LINUX-FP-NEXT: blr
64 ; PPC64-LINUX-NOFP-LABEL: f1:
65 ; PPC64-LINUX-NOFP: lis 0, -1
66 ; PPC64-LINUX-NOFP-NEXT: ori 0, 0, 32720
67 ; PPC64-LINUX-NOFP-NEXT: stdux 1, 1, 0
68 ; PPC64-LINUX-NOFP-NEXT: addi 3, 1, 52
69 ; PPC64-LINUX-NOFP-NEXT: ld 1, 0(1)
70 ; PPC64-LINUX-NOFP-NEXT: blr
72 ; PPC64-LINUX-FP-LABEL: f1:
73 ; PPC64-LINUX-FP: lis 0, -1
74 ; PPC64-LINUX-FP-NEXT: ori 0, 0, 32704
75 ; PPC64-LINUX-FP-NEXT: std 31, -8(1)
76 ; PPC64-LINUX-FP-NEXT: stdux 1, 1, 0
77 ; PPC64-LINUX-FP-NEXT: mr 31, 1
78 ; PPC64-LINUX-FP-NEXT: addi 3, 31, 60
79 ; PPC64-LINUX-FP-NEXT: ld 1, 0(1)
80 ; PPC64-LINUX-FP-NEXT: ld 31, -8(1)
81 ; PPC64-LINUX-FP-NEXT: blr
83 ; PPC32-AIX-NOFP-LABEL: f1
84 ; PPC32-AIX-NOFP: lis 0, -1
85 ; PPC32-AIX-NOFP-NEXT: ori 0, 0, 32736
86 ; PPC32-AIX-NOFP-NEXT: stwux 1, 1, 0
87 ; PPC32-AIX-NOFP-NEXT: addi 3, 1, 36
88 ; PPC32-AIX-NOFP-NEXT: lwz 1, 0(1)
89 ; PPC32-AIX-NOFP-NEXT: blr
91 ; PPC32-AIX-FP-LABEL: f1
92 ; PPC32-AIX-FP: lis 0, -1
93 ; PPC32-AIX-FP-NEXT: stw 31, -4(1)
94 ; PPC32-AIX-FP-NEXT: ori 0, 0, 32736
95 ; PPC32-AIX-FP-NEXT: stwux 1, 1, 0
96 ; PPC32-AIX-FP-NEXT: mr 31, 1
97 ; PPC32-AIX-FP-NEXT: addi 3, 31, 32
98 ; PPC32-AIX-FP-NEXT: lwz 1, 0(1)
99 ; PPC32-AIX-FP-NEXT: lwz 31, -4(1)
100 ; PPC32-AIX-FP-NEXT: blr
102 ; PPC64-AIX-NOFP-LABEL: f1
103 ; PPC64-AIX-NOFP: lis 0, -1
104 ; PPC64-AIX-NOFP-NEXT: ori 0, 0, 32720
105 ; PPC64-AIX-NOFP-NEXT: stdux 1, 1, 0
106 ; PPC64-AIX-NOFP-NEXT: addi 3, 1, 52
107 ; PPC64-AIX-NOFP-NEXT: ld 1, 0(1)
108 ; PPC64-AIX-NOFP-NEXT: blr
110 ; PPC64-AIX-FP-LABEL: f1
111 ; PPC64-AIX-FP: lis 0, -1
112 ; PPC64-AIX-FP-NEXT: std 31, -8(1)
113 ; PPC64-AIX-FP-NEXT: ori 0, 0, 32704
114 ; PPC64-AIX-FP-NEXT: stdux 1, 1, 0
115 ; PPC64-AIX-FP-NEXT: mr 31, 1
116 ; PPC64-AIX-FP-NEXT: addi 3, 31, 60
117 ; PPC64-AIX-FP-NEXT: ld 1, 0(1)
118 ; PPC64-AIX-FP-NEXT: ld 31, -8(1)
119 ; PPC64-AIX-FP-NEXT: blr