1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -verify-machineinstrs -mtriple aarch64-unknown-unknown -run-pass=legalizer -O0 -global-isel %s -o - | FileCheck %s
9 ; CHECK-LABEL: name: fptrunc_s16_s32
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
13 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s32)
14 ; CHECK-NEXT: $h0 = COPY [[FPTRUNC]](s16)
15 ; CHECK-NEXT: RET_ReallyLR implicit $h0
17 %1:_(s16) = G_FPTRUNC %0
19 RET_ReallyLR implicit $h0
27 ; CHECK-LABEL: name: fptrunc_s16_s64
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
31 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s64)
32 ; CHECK-NEXT: $h0 = COPY [[FPTRUNC]](s16)
33 ; CHECK-NEXT: RET_ReallyLR implicit $h0
35 %1:_(s16) = G_FPTRUNC %0
37 RET_ReallyLR implicit $h0
45 ; CHECK-LABEL: name: fptrunc_s32_s64
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
49 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(s32) = G_FPTRUNC [[COPY]](s64)
50 ; CHECK-NEXT: $s0 = COPY [[FPTRUNC]](s32)
51 ; CHECK-NEXT: RET_ReallyLR implicit $s0
53 %1:_(s32) = G_FPTRUNC %0
55 RET_ReallyLR implicit $s0
58 name: fptrunc_v4s16_v4s32
63 ; CHECK-LABEL: name: fptrunc_v4s16_v4s32
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
67 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[COPY]](<4 x s32>)
68 ; CHECK-NEXT: $d0 = COPY [[FPTRUNC]](<4 x s16>)
69 ; CHECK-NEXT: RET_ReallyLR implicit $d0
70 %0:_(<4 x s32>) = COPY $q0
71 %1:_(<4 x s16>) = G_FPTRUNC %0
72 $d0 = COPY %1(<4 x s16>)
73 RET_ReallyLR implicit $d0
76 name: fptrunc_v2s16_v2s32
81 ; CHECK-LABEL: name: fptrunc_v2s16_v2s32
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
85 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[COPY]](<2 x s32>)
86 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
87 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<4 x s32>) = G_BUILD_VECTOR [[UV]](s32), [[UV1]](s32), [[DEF]](s32), [[DEF]](s32)
88 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[BUILD_VECTOR]](<4 x s32>)
89 ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(<2 x s16>), [[UV3:%[0-9]+]]:_(<2 x s16>) = G_UNMERGE_VALUES [[FPTRUNC]](<4 x s16>)
90 ; CHECK-NEXT: $s0 = COPY [[UV2]](<2 x s16>)
91 ; CHECK-NEXT: RET_ReallyLR implicit $s0
92 %0:_(<2 x s32>) = COPY $d0
93 %1:_(<2 x s16>) = G_FPTRUNC %0
94 $s0 = COPY %1(<2 x s16>)
95 RET_ReallyLR implicit $s0
98 name: fptrunc_v4s32_v4s64
102 ; CHECK-LABEL: name: fptrunc_v4s32_v4s64
103 ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s64>) = G_IMPLICIT_DEF
104 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[DEF]](<2 x s64>)
105 ; CHECK-NEXT: [[FPTRUNC1:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[DEF]](<2 x s64>)
106 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC]](<2 x s32>), [[FPTRUNC1]](<2 x s32>)
107 ; CHECK-NEXT: $q0 = COPY [[CONCAT_VECTORS]](<4 x s32>)
108 ; CHECK-NEXT: RET_ReallyLR implicit $q0
109 %0:_(<4 x s64>) = G_IMPLICIT_DEF
110 %1:_(<4 x s32>) = G_FPTRUNC %0
111 $q0 = COPY %1(<4 x s32>)
112 RET_ReallyLR implicit $q0
115 name: fptrunc_v8s32_v8s64
119 liveins: $x0, $q0, $q1, $q2, $q3, $x0
121 ; CHECK-LABEL: name: fptrunc_v8s32_v8s64
122 ; CHECK: liveins: $x0, $q0, $q1, $q2, $q3, $x0
124 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
125 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
126 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
127 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
128 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
129 ; CHECK-NEXT: [[FPTRUNC:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY]](<2 x s64>)
130 ; CHECK-NEXT: [[FPTRUNC1:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY1]](<2 x s64>)
131 ; CHECK-NEXT: [[FPTRUNC2:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY2]](<2 x s64>)
132 ; CHECK-NEXT: [[FPTRUNC3:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY3]](<2 x s64>)
133 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(p0) = COPY $x0
134 ; CHECK-NEXT: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC]](<2 x s32>), [[FPTRUNC1]](<2 x s32>)
135 ; CHECK-NEXT: [[CONCAT_VECTORS1:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC2]](<2 x s32>), [[FPTRUNC3]](<2 x s32>)
136 ; CHECK-NEXT: G_STORE [[CONCAT_VECTORS]](<4 x s32>), [[COPY5]](p0) :: (store (<4 x s32>), align 32)
137 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
138 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY5]], [[C]](s64)
139 ; CHECK-NEXT: G_STORE [[CONCAT_VECTORS1]](<4 x s32>), [[PTR_ADD]](p0) :: (store (<4 x s32>) into unknown-address + 16)
140 ; CHECK-NEXT: RET_ReallyLR
141 %2:_(<2 x s64>) = COPY $q0
142 %3:_(<2 x s64>) = COPY $q1
143 %4:_(<2 x s64>) = COPY $q2
144 %5:_(<2 x s64>) = COPY $q3
145 %0:_(<8 x s64>) = G_CONCAT_VECTORS %2(<2 x s64>), %3(<2 x s64>), %4(<2 x s64>), %5(<2 x s64>)
147 %6:_(<8 x s32>) = G_FPTRUNC %0(<8 x s64>)
149 G_STORE %6(<8 x s32>), %7(p0) :: (store (<8 x s32>))