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
10 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $s0
11 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s32)
12 ; CHECK: $h0 = COPY [[FPTRUNC]](s16)
13 ; CHECK: RET_ReallyLR implicit $h0
15 %1:_(s16) = G_FPTRUNC %0
17 RET_ReallyLR implicit $h0
25 ; CHECK-LABEL: name: fptrunc_s16_s64
26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
27 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s16) = G_FPTRUNC [[COPY]](s64)
28 ; CHECK: $h0 = COPY [[FPTRUNC]](s16)
29 ; CHECK: RET_ReallyLR implicit $h0
31 %1:_(s16) = G_FPTRUNC %0
33 RET_ReallyLR implicit $h0
41 ; CHECK-LABEL: name: fptrunc_s32_s64
42 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
43 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(s32) = G_FPTRUNC [[COPY]](s64)
44 ; CHECK: $s0 = COPY [[FPTRUNC]](s32)
45 ; CHECK: RET_ReallyLR implicit $s0
47 %1:_(s32) = G_FPTRUNC %0
49 RET_ReallyLR implicit $s0
52 name: fptrunc_v4s16_v4s32
57 ; CHECK-LABEL: name: fptrunc_v4s16_v4s32
58 ; CHECK: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
59 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(<4 x s16>) = G_FPTRUNC [[COPY]](<4 x s32>)
60 ; CHECK: $d0 = COPY [[FPTRUNC]](<4 x s16>)
61 ; CHECK: RET_ReallyLR implicit $d0
62 %0:_(<4 x s32>) = COPY $q0
63 %1:_(<4 x s16>) = G_FPTRUNC %0
64 $d0 = COPY %1(<4 x s16>)
65 RET_ReallyLR implicit $d0
68 name: fptrunc_v2s16_v2s32
73 ; CHECK-LABEL: name: fptrunc_v2s16_v2s32
74 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0
75 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(<2 x s16>) = G_FPTRUNC [[COPY]](<2 x s32>)
76 ; CHECK: $s0 = COPY [[FPTRUNC]](<2 x s16>)
77 ; CHECK: RET_ReallyLR implicit $s0
78 %0:_(<2 x s32>) = COPY $d0
79 %1:_(<2 x s16>) = G_FPTRUNC %0
80 $s0 = COPY %1(<2 x s16>)
81 RET_ReallyLR implicit $s0
84 name: fptrunc_v4s32_v4s64
88 ; CHECK-LABEL: name: fptrunc_v4s32_v4s64
89 ; CHECK: [[DEF:%[0-9]+]]:_(<2 x s64>) = G_IMPLICIT_DEF
90 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[DEF]](<2 x s64>)
91 ; CHECK: [[FPTRUNC1:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[DEF]](<2 x s64>)
92 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC]](<2 x s32>), [[FPTRUNC1]](<2 x s32>)
93 ; CHECK: $q0 = COPY [[CONCAT_VECTORS]](<4 x s32>)
94 ; CHECK: RET_ReallyLR implicit $q0
95 %0:_(<4 x s64>) = G_IMPLICIT_DEF
96 %1:_(<4 x s32>) = G_FPTRUNC %0
97 $q0 = COPY %1(<4 x s32>)
98 RET_ReallyLR implicit $q0
101 name: fptrunc_v8s32_v8s64
105 liveins: $x0, $q0, $q1, $q2, $q3, $x0
107 ; CHECK-LABEL: name: fptrunc_v8s32_v8s64
108 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
109 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
110 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
111 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
112 ; CHECK: [[COPY4:%[0-9]+]]:_(p0) = COPY $x0
113 ; CHECK: [[FPTRUNC:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY]](<2 x s64>)
114 ; CHECK: [[FPTRUNC1:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY1]](<2 x s64>)
115 ; CHECK: [[FPTRUNC2:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY2]](<2 x s64>)
116 ; CHECK: [[FPTRUNC3:%[0-9]+]]:_(<2 x s32>) = G_FPTRUNC [[COPY3]](<2 x s64>)
117 ; CHECK: [[COPY5:%[0-9]+]]:_(p0) = COPY $x0
118 ; CHECK: [[CONCAT_VECTORS:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC]](<2 x s32>), [[FPTRUNC1]](<2 x s32>)
119 ; CHECK: [[CONCAT_VECTORS1:%[0-9]+]]:_(<4 x s32>) = G_CONCAT_VECTORS [[FPTRUNC2]](<2 x s32>), [[FPTRUNC3]](<2 x s32>)
120 ; CHECK: G_STORE [[CONCAT_VECTORS]](<4 x s32>), [[COPY5]](p0) :: (store (<4 x s32>), align 32)
121 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
122 ; CHECK: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY5]], [[C]](s64)
123 ; CHECK: G_STORE [[CONCAT_VECTORS1]](<4 x s32>), [[PTR_ADD]](p0) :: (store (<4 x s32>) into unknown-address + 16)
124 ; CHECK: RET_ReallyLR
125 %2:_(<2 x s64>) = COPY $q0
126 %3:_(<2 x s64>) = COPY $q1
127 %4:_(<2 x s64>) = COPY $q2
128 %5:_(<2 x s64>) = COPY $q3
129 %0:_(<8 x s64>) = G_CONCAT_VECTORS %2(<2 x s64>), %3(<2 x s64>), %4(<2 x s64>), %5(<2 x s64>)
131 %6:_(<8 x s32>) = G_FPTRUNC %0(<8 x s64>)
133 G_STORE %6(<8 x s32>), %7(p0) :: (store (<8 x s32>))