1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu -global-isel \
3 ; RUN: -verify-machineinstrs -stop-after=irtranslator < %s | FileCheck %s
5 ; Pass up to eight integer arguments in registers.
6 define void @test_scalar1(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, i32 %h) {
7 ; CHECK-LABEL: name: test_scalar1
9 ; CHECK-NEXT: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10
11 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x3
12 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
13 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4
14 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
15 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5
16 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)
17 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6
18 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY3]](s64)
19 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7
20 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)
21 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8
22 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s32) = G_TRUNC [[COPY5]](s64)
23 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9
24 ; CHECK-NEXT: [[TRUNC6:%[0-9]+]]:_(s32) = G_TRUNC [[COPY6]](s64)
25 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x10
26 ; CHECK-NEXT: [[TRUNC7:%[0-9]+]]:_(s32) = G_TRUNC [[COPY7]](s64)
27 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
32 define void @test_scalar2(i64 %a, i64 %b, i64 %c, i64 %d, i64 %e, i64 %f, i64 %g, i64 %h) {
33 ; CHECK-LABEL: name: test_scalar2
35 ; CHECK-NEXT: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10
37 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x3
38 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4
39 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5
40 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6
41 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7
42 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8
43 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9
44 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x10
45 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
50 define void @test_scalar3(i8 %a, i8 %b, i8 %c, i8 %d, i8 %e, i8 %f, i8 %g, i8 %h) {
51 ; CHECK-LABEL: name: test_scalar3
53 ; CHECK-NEXT: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10
55 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x3
56 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s64)
57 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4
58 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s64)
59 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5
60 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[COPY2]](s64)
61 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6
62 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s8) = G_TRUNC [[COPY3]](s64)
63 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7
64 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s8) = G_TRUNC [[COPY4]](s64)
65 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8
66 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s8) = G_TRUNC [[COPY5]](s64)
67 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9
68 ; CHECK-NEXT: [[TRUNC6:%[0-9]+]]:_(s8) = G_TRUNC [[COPY6]](s64)
69 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x10
70 ; CHECK-NEXT: [[TRUNC7:%[0-9]+]]:_(s8) = G_TRUNC [[COPY7]](s64)
71 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
76 define void @test_scalar4(i16 %a, i16 %b, i16 %c, i16 %d, i16 %e, i16 %f, i16 %g, i16 %h) {
77 ; CHECK-LABEL: name: test_scalar4
79 ; CHECK-NEXT: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10
81 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x3
82 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s64)
83 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4
84 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s64)
85 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5
86 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s64)
87 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6
88 ; CHECK-NEXT: [[TRUNC3:%[0-9]+]]:_(s16) = G_TRUNC [[COPY3]](s64)
89 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7
90 ; CHECK-NEXT: [[TRUNC4:%[0-9]+]]:_(s16) = G_TRUNC [[COPY4]](s64)
91 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8
92 ; CHECK-NEXT: [[TRUNC5:%[0-9]+]]:_(s16) = G_TRUNC [[COPY5]](s64)
93 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9
94 ; CHECK-NEXT: [[TRUNC6:%[0-9]+]]:_(s16) = G_TRUNC [[COPY6]](s64)
95 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x10
96 ; CHECK-NEXT: [[TRUNC7:%[0-9]+]]:_(s16) = G_TRUNC [[COPY7]](s64)
97 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
102 define void @test_scalar5(i128 %a, i128 %b, i128 %c, i128 %d) {
103 ; CHECK-LABEL: name: test_scalar5
105 ; CHECK-NEXT: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x3
108 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x4
109 ; CHECK-NEXT: [[MV:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY]](s64), [[COPY1]](s64)
110 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x5
111 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x6
112 ; CHECK-NEXT: [[MV1:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY2]](s64), [[COPY3]](s64)
113 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x7
114 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $x8
115 ; CHECK-NEXT: [[MV2:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY4]](s64), [[COPY5]](s64)
116 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $x9
117 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $x10
118 ; CHECK-NEXT: [[MV3:%[0-9]+]]:_(s128) = G_MERGE_VALUES [[COPY6]](s64), [[COPY7]](s64)
119 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
124 ; Pass up to thirteen fp arguments in registers.
125 define void @test_scalar6(float %a, float %b, float %c, float %d, float %e, float %f, float %g, float %h, float %i, float %j, float %k, float %l, float %m) {
126 ; CHECK-LABEL: name: test_scalar6
128 ; CHECK-NEXT: liveins: $f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f11, $f12, $f13
130 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f1
131 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $f2
132 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $f3
133 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $f4
134 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $f5
135 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $f6
136 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s32) = COPY $f7
137 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s32) = COPY $f8
138 ; CHECK-NEXT: [[COPY8:%[0-9]+]]:_(s32) = COPY $f9
139 ; CHECK-NEXT: [[COPY9:%[0-9]+]]:_(s32) = COPY $f10
140 ; CHECK-NEXT: [[COPY10:%[0-9]+]]:_(s32) = COPY $f11
141 ; CHECK-NEXT: [[COPY11:%[0-9]+]]:_(s32) = COPY $f12
142 ; CHECK-NEXT: [[COPY12:%[0-9]+]]:_(s32) = COPY $f13
143 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm
148 define void @test_scalar7(double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, double %i, double %j, double %k, double %l, double %m) {
149 ; CHECK-LABEL: name: test_scalar7
151 ; CHECK-NEXT: liveins: $f1, $f2, $f3, $f4, $f5, $f6, $f7, $f8, $f9, $f10, $f11, $f12, $f13
153 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f1
154 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $f2
155 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $f3
156 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $f4
157 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $f5
158 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(s64) = COPY $f6
159 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(s64) = COPY $f7
160 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(s64) = COPY $f8
161 ; CHECK-NEXT: [[COPY8:%[0-9]+]]:_(s64) = COPY $f9
162 ; CHECK-NEXT: [[COPY9:%[0-9]+]]:_(s64) = COPY $f10
163 ; CHECK-NEXT: [[COPY10:%[0-9]+]]:_(s64) = COPY $f11
164 ; CHECK-NEXT: [[COPY11:%[0-9]+]]:_(s64) = COPY $f12
165 ; CHECK-NEXT: [[COPY12:%[0-9]+]]:_(s64) = COPY $f13
166 ; CHECK-NEXT: BLR8 implicit $lr8, implicit $rm