1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=aarch64-linux-gnu -O0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s
4 define i32 @call_nneg(i16 %a) {
5 ; CHECK-LABEL: name: call_nneg
7 ; CHECK-NEXT: liveins: $w0
9 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
10 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
11 ; CHECK-NEXT: %2:_(s32) = nneg G_ZEXT [[TRUNC]](s16)
12 ; CHECK-NEXT: $w0 = COPY %2(s32)
13 ; CHECK-NEXT: RET_ReallyLR implicit $w0
15 %result = zext nneg i16 %a to i32
19 define i32 @call_not_nneg(i16 %a) {
20 ; CHECK-LABEL: name: call_not_nneg
22 ; CHECK-NEXT: liveins: $w0
24 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
25 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32)
26 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s32) = G_ZEXT [[TRUNC]](s16)
27 ; CHECK-NEXT: $w0 = COPY [[ZEXT]](s32)
28 ; CHECK-NEXT: RET_ReallyLR implicit $w0
30 %result = zext i16 %a to i32
34 define i32 @call_disjoint(i32 %a, i32 %b) {
35 ; CHECK-LABEL: name: call_disjoint
37 ; CHECK-NEXT: liveins: $w0, $w1
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
40 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
41 ; CHECK-NEXT: %2:_(s32) = disjoint G_OR [[COPY]], [[COPY1]]
42 ; CHECK-NEXT: $w0 = COPY %2(s32)
43 ; CHECK-NEXT: RET_ReallyLR implicit $w0
45 %result = or disjoint i32 %a, %b
49 define i32 @call_add(i32 %a, i32 %b) {
50 ; CHECK-LABEL: name: call_add
52 ; CHECK-NEXT: liveins: $w0, $w1
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
55 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
56 ; CHECK-NEXT: [[ADD:%[0-9]+]]:_(s32) = nsw G_ADD [[COPY]], [[COPY1]]
57 ; CHECK-NEXT: $w0 = COPY [[ADD]](s32)
58 ; CHECK-NEXT: RET_ReallyLR implicit $w0
60 %result = add nsw i32 %a, %b
64 define i32 @call_not_disjoint(i32 %a, i32 %b) {
65 ; CHECK-LABEL: name: call_not_disjoint
67 ; CHECK-NEXT: liveins: $w0, $w1
69 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
70 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
71 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]]
72 ; CHECK-NEXT: $w0 = COPY [[OR]](s32)
73 ; CHECK-NEXT: RET_ReallyLR implicit $w0
75 %result = or i32 %a, %b
79 define <2 x i64> @call_not_disjoint_vector(<2 x i64> %a, <2 x i64> %b) {
80 ; CHECK-LABEL: name: call_not_disjoint_vector
82 ; CHECK-NEXT: liveins: $q0, $q1
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
85 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
86 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(<2 x s64>) = G_OR [[COPY]], [[COPY1]]
87 ; CHECK-NEXT: $q0 = COPY [[OR]](<2 x s64>)
88 ; CHECK-NEXT: RET_ReallyLR implicit $q0
90 %result = or <2 x i64> %a, %b
94 define <2 x i64> @call_disjoint_vector(<2 x i64> %a, <2 x i64> %b) {
95 ; CHECK-LABEL: name: call_disjoint_vector
97 ; CHECK-NEXT: liveins: $q0, $q1
99 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
100 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
101 ; CHECK-NEXT: %2:_(<2 x s64>) = disjoint G_OR [[COPY]], [[COPY1]]
102 ; CHECK-NEXT: $q0 = COPY %2(<2 x s64>)
103 ; CHECK-NEXT: RET_ReallyLR implicit $q0
105 %result = or disjoint <2 x i64> %a, %b
106 ret <2 x i64> %result
109 define <2 x i64> @call_nneg_vector(<2 x i32> %a) {
110 ; CHECK-LABEL: name: call_nneg_vector
112 ; CHECK-NEXT: liveins: $d0
114 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
115 ; CHECK-NEXT: %1:_(<2 x s64>) = nneg G_ZEXT [[COPY]](<2 x s32>)
116 ; CHECK-NEXT: $q0 = COPY %1(<2 x s64>)
117 ; CHECK-NEXT: RET_ReallyLR implicit $q0
119 %result = zext nneg <2 x i32> %a to <2 x i64>
120 ret <2 x i64> %result
123 define <2 x i64> @call_not_nneg_vector(<2 x i32> %a) {
124 ; CHECK-LABEL: name: call_not_nneg_vector
126 ; CHECK-NEXT: liveins: $d0
128 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
129 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(<2 x s64>) = G_ZEXT [[COPY]](<2 x s32>)
130 ; CHECK-NEXT: $q0 = COPY [[ZEXT]](<2 x s64>)
131 ; CHECK-NEXT: RET_ReallyLR implicit $q0
133 %result = zext <2 x i32> %a to <2 x i64>
134 ret <2 x i64> %result