1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-FP16
3 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-NOFP16
6 name: s16_legal_with_full_fp16
11 ; CHECK-FP16-LABEL: name: s16_legal_with_full_fp16
12 ; CHECK-FP16: liveins: $h0, $h1
13 ; CHECK-FP16-NEXT: {{ $}}
14 ; CHECK-FP16-NEXT: %a:_(s16) = COPY $h0
15 ; CHECK-FP16-NEXT: %b:_(s16) = COPY $h1
16 ; CHECK-FP16-NEXT: %minnum:_(s16) = G_FMINNUM %a, %b
17 ; CHECK-FP16-NEXT: $h0 = COPY %minnum(s16)
18 ; CHECK-FP16-NEXT: RET_ReallyLR implicit $h0
20 ; CHECK-NOFP16-LABEL: name: s16_legal_with_full_fp16
21 ; CHECK-NOFP16: liveins: $h0, $h1
22 ; CHECK-NOFP16-NEXT: {{ $}}
23 ; CHECK-NOFP16-NEXT: %a:_(s16) = COPY $h0
24 ; CHECK-NOFP16-NEXT: %b:_(s16) = COPY $h1
25 ; CHECK-NOFP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %a(s16)
26 ; CHECK-NOFP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %b(s16)
27 ; CHECK-NOFP16-NEXT: [[FMINNUM:%[0-9]+]]:_(s32) = G_FMINNUM [[FPEXT]], [[FPEXT1]]
28 ; CHECK-NOFP16-NEXT: %minnum:_(s16) = G_FPTRUNC [[FMINNUM]](s32)
29 ; CHECK-NOFP16-NEXT: $h0 = COPY %minnum(s16)
30 ; CHECK-NOFP16-NEXT: RET_ReallyLR implicit $h0
33 %minnum:_(s16) = G_FMINNUM %a, %b
34 $h0 = COPY %minnum(s16)
35 RET_ReallyLR implicit $h0
44 ; CHECK-LABEL: name: s32_legal
45 ; CHECK: liveins: $s0, $s1
47 ; CHECK-NEXT: %a:_(s32) = COPY $s0
48 ; CHECK-NEXT: %b:_(s32) = COPY $s1
49 ; CHECK-NEXT: %minnum:_(s32) = G_FMINNUM %a, %b
50 ; CHECK-NEXT: $s0 = COPY %minnum(s32)
51 ; CHECK-NEXT: RET_ReallyLR implicit $s0
54 %minnum:_(s32) = G_FMINNUM %a, %b
55 $s0 = COPY %minnum(s32)
56 RET_ReallyLR implicit $s0
65 ; CHECK-LABEL: name: s64_legal
66 ; CHECK: liveins: $d0, $d1
68 ; CHECK-NEXT: %a:_(s64) = COPY $d0
69 ; CHECK-NEXT: %b:_(s64) = COPY $d1
70 ; CHECK-NEXT: %minnum:_(s64) = G_FMINNUM %a, %b
71 ; CHECK-NEXT: $d0 = COPY %minnum(s64)
72 ; CHECK-NEXT: RET_ReallyLR implicit $d0
75 %minnum:_(s64) = G_FMINNUM %a, %b
76 $d0 = COPY %minnum(s64)
77 RET_ReallyLR implicit $d0
86 ; CHECK-LABEL: name: s128_libcall
87 ; CHECK: liveins: $q0, $q1
89 ; CHECK-NEXT: %a:_(s128) = COPY $q0
90 ; CHECK-NEXT: %b:_(s128) = COPY $q1
91 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
92 ; CHECK-NEXT: $q0 = COPY %a(s128)
93 ; CHECK-NEXT: $q1 = COPY %b(s128)
94 ; CHECK-NEXT: BL &fminl, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $q0, implicit $q1, implicit-def $q0
95 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
96 ; CHECK-NEXT: %minnum:_(s128) = COPY $q0
97 ; CHECK-NEXT: $q0 = COPY %minnum(s128)
98 ; CHECK-NEXT: RET_ReallyLR implicit $q0
100 %b:_(s128) = COPY $q1
101 %minnum:_(s128) = G_FMINNUM %a, %b
102 $q0 = COPY %minnum(s128)
103 RET_ReallyLR implicit $q0
112 ; CHECK-LABEL: name: v4s32_legal
113 ; CHECK: liveins: $q0, $q1
115 ; CHECK-NEXT: %a:_(<4 x s32>) = COPY $q0
116 ; CHECK-NEXT: %b:_(<4 x s32>) = COPY $q1
117 ; CHECK-NEXT: %minnum:_(<4 x s32>) = G_FMINNUM %a, %b
118 ; CHECK-NEXT: $q0 = COPY %minnum(<4 x s32>)
119 ; CHECK-NEXT: RET_ReallyLR implicit $q0
120 %a:_(<4 x s32>) = COPY $q0
121 %b:_(<4 x s32>) = COPY $q1
122 %minnum:_(<4 x s32>) = G_FMINNUM %a, %b
123 $q0 = COPY %minnum(<4 x s32>)
124 RET_ReallyLR implicit $q0
133 ; CHECK-LABEL: name: v3s32_widen
134 ; CHECK: liveins: $q0, $q1
136 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
137 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY]](<2 x s64>)
138 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
139 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:_(<4 x s32>) = G_BITCAST [[COPY1]](<2 x s64>)
140 ; CHECK-NEXT: [[FMINNUM:%[0-9]+]]:_(<4 x s32>) = G_FMINNUM [[BITCAST]], [[BITCAST1]]
141 ; CHECK-NEXT: $q0 = COPY [[FMINNUM]](<4 x s32>)
142 ; CHECK-NEXT: RET_ReallyLR implicit $q0
143 %2:_(<2 x s64>) = COPY $q0
144 %3:_(<4 x s32>) = G_BITCAST %2:_(<2 x s64>)
145 %4:_(s32), %5:_(s32), %6:_(s32), %7:_(s32) = G_UNMERGE_VALUES %3:_(<4 x s32>)
146 %0:_(<3 x s32>) = G_BUILD_VECTOR %4:_(s32), %5:_(s32), %6:_(s32)
147 %8:_(<2 x s64>) = COPY $q1
148 %9:_(<4 x s32>) = G_BITCAST %8:_(<2 x s64>)
149 %10:_(s32), %11:_(s32), %12:_(s32), %13:_(s32) = G_UNMERGE_VALUES %9:_(<4 x s32>)
150 %1:_(<3 x s32>) = G_BUILD_VECTOR %10:_(s32), %11:_(s32), %12:_(s32)
151 %14:_(<3 x s32>) = G_FMINNUM %0:_, %1:_
152 %15:_(s32), %16:_(s32), %17:_(s32) = G_UNMERGE_VALUES %14:_(<3 x s32>)
153 %18:_(s32) = G_IMPLICIT_DEF
154 %19:_(<4 x s32>) = G_BUILD_VECTOR %15:_(s32), %16:_(s32), %17:_(s32), %18:_(s32)
155 $q0 = COPY %19:_(<4 x s32>)
156 RET_ReallyLR implicit $q0