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-prefix=FP16
3 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s --check-prefix=NO-FP16
6 name: s16_legal_with_full_fp16
11 ; FP16-LABEL: name: s16_legal_with_full_fp16
12 ; FP16: liveins: $h0, $h1
14 ; FP16-NEXT: %a:_(s16) = COPY $h0
15 ; FP16-NEXT: %b:_(s16) = COPY $h1
16 ; FP16-NEXT: %legalize_me:_(s16) = G_FMINIMUM %a, %b
17 ; FP16-NEXT: $h0 = COPY %legalize_me(s16)
18 ; FP16-NEXT: RET_ReallyLR implicit $h0
19 ; NO-FP16-LABEL: name: s16_legal_with_full_fp16
20 ; NO-FP16: liveins: $h0, $h1
21 ; NO-FP16-NEXT: {{ $}}
22 ; NO-FP16-NEXT: %a:_(s16) = COPY $h0
23 ; NO-FP16-NEXT: %b:_(s16) = COPY $h1
24 ; NO-FP16-NEXT: [[FPEXT:%[0-9]+]]:_(s32) = G_FPEXT %a(s16)
25 ; NO-FP16-NEXT: [[FPEXT1:%[0-9]+]]:_(s32) = G_FPEXT %b(s16)
26 ; NO-FP16-NEXT: [[FMINIMUM:%[0-9]+]]:_(s32) = G_FMINIMUM [[FPEXT]], [[FPEXT1]]
27 ; NO-FP16-NEXT: %legalize_me:_(s16) = G_FPTRUNC [[FMINIMUM]](s32)
28 ; NO-FP16-NEXT: $h0 = COPY %legalize_me(s16)
29 ; NO-FP16-NEXT: RET_ReallyLR implicit $h0
32 %legalize_me:_(s16) = G_FMINIMUM %a, %b
33 $h0 = COPY %legalize_me(s16)
34 RET_ReallyLR implicit $h0
43 ; FP16-LABEL: name: s32_legal
44 ; FP16: liveins: $s0, $s1
46 ; FP16-NEXT: %a:_(s32) = COPY $s0
47 ; FP16-NEXT: %b:_(s32) = COPY $s1
48 ; FP16-NEXT: %legalize_me:_(s32) = G_FMINIMUM %a, %b
49 ; FP16-NEXT: $s0 = COPY %legalize_me(s32)
50 ; FP16-NEXT: RET_ReallyLR implicit $s0
51 ; NO-FP16-LABEL: name: s32_legal
52 ; NO-FP16: liveins: $s0, $s1
53 ; NO-FP16-NEXT: {{ $}}
54 ; NO-FP16-NEXT: %a:_(s32) = COPY $s0
55 ; NO-FP16-NEXT: %b:_(s32) = COPY $s1
56 ; NO-FP16-NEXT: %legalize_me:_(s32) = G_FMINIMUM %a, %b
57 ; NO-FP16-NEXT: $s0 = COPY %legalize_me(s32)
58 ; NO-FP16-NEXT: RET_ReallyLR implicit $s0
61 %legalize_me:_(s32) = G_FMINIMUM %a, %b
62 $s0 = COPY %legalize_me(s32)
63 RET_ReallyLR implicit $s0
72 ; FP16-LABEL: name: s64_legal
73 ; FP16: liveins: $d0, $d1
75 ; FP16-NEXT: %a:_(s64) = COPY $d0
76 ; FP16-NEXT: %b:_(s64) = COPY $d1
77 ; FP16-NEXT: %legalize_me:_(s64) = G_FMINIMUM %a, %b
78 ; FP16-NEXT: $d0 = COPY %legalize_me(s64)
79 ; FP16-NEXT: RET_ReallyLR implicit $d0
80 ; NO-FP16-LABEL: name: s64_legal
81 ; NO-FP16: liveins: $d0, $d1
82 ; NO-FP16-NEXT: {{ $}}
83 ; NO-FP16-NEXT: %a:_(s64) = COPY $d0
84 ; NO-FP16-NEXT: %b:_(s64) = COPY $d1
85 ; NO-FP16-NEXT: %legalize_me:_(s64) = G_FMINIMUM %a, %b
86 ; NO-FP16-NEXT: $d0 = COPY %legalize_me(s64)
87 ; NO-FP16-NEXT: RET_ReallyLR implicit $d0
90 %legalize_me:_(s64) = G_FMINIMUM %a, %b
91 $d0 = COPY %legalize_me(s64)
92 RET_ReallyLR implicit $d0
100 ; FP16-LABEL: name: v4s32
101 ; FP16: liveins: $q0, $q1
103 ; FP16-NEXT: %a:_(<4 x s32>) = COPY $q0
104 ; FP16-NEXT: %b:_(<4 x s32>) = COPY $q1
105 ; FP16-NEXT: %minimum:_(<4 x s32>) = G_FMINIMUM %a, %b
106 ; FP16-NEXT: $q0 = COPY %minimum(<4 x s32>)
107 ; FP16-NEXT: RET_ReallyLR implicit $q0
108 ; NO-FP16-LABEL: name: v4s32
109 ; NO-FP16: liveins: $q0, $q1
110 ; NO-FP16-NEXT: {{ $}}
111 ; NO-FP16-NEXT: %a:_(<4 x s32>) = COPY $q0
112 ; NO-FP16-NEXT: %b:_(<4 x s32>) = COPY $q1
113 ; NO-FP16-NEXT: %minimum:_(<4 x s32>) = G_FMINIMUM %a, %b
114 ; NO-FP16-NEXT: $q0 = COPY %minimum(<4 x s32>)
115 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
116 %a:_(<4 x s32>) = COPY $q0
117 %b:_(<4 x s32>) = COPY $q1
118 %minimum:_(<4 x s32>) = G_FMINIMUM %a, %b
119 $q0 = COPY %minimum(<4 x s32>)
120 RET_ReallyLR implicit $q0
129 liveins: $q0, $q1, $q2, $q3
130 ; FP16-LABEL: name: v8s32
131 ; FP16: liveins: $q0, $q1, $q2, $q3
133 ; FP16-NEXT: %a:_(<4 x s32>) = COPY $q0
134 ; FP16-NEXT: %b:_(<4 x s32>) = COPY $q1
135 ; FP16-NEXT: %c:_(<4 x s32>) = COPY $q2
136 ; FP16-NEXT: %d:_(<4 x s32>) = COPY $q3
137 ; FP16-NEXT: [[FMINIMUM:%[0-9]+]]:_(<4 x s32>) = G_FMINIMUM %a, %c
138 ; FP16-NEXT: [[FMINIMUM1:%[0-9]+]]:_(<4 x s32>) = G_FMINIMUM %b, %d
139 ; FP16-NEXT: $q0 = COPY [[FMINIMUM]](<4 x s32>)
140 ; FP16-NEXT: $q1 = COPY [[FMINIMUM1]](<4 x s32>)
141 ; FP16-NEXT: RET_ReallyLR implicit $q0
142 ; NO-FP16-LABEL: name: v8s32
143 ; NO-FP16: liveins: $q0, $q1, $q2, $q3
144 ; NO-FP16-NEXT: {{ $}}
145 ; NO-FP16-NEXT: %a:_(<4 x s32>) = COPY $q0
146 ; NO-FP16-NEXT: %b:_(<4 x s32>) = COPY $q1
147 ; NO-FP16-NEXT: %c:_(<4 x s32>) = COPY $q2
148 ; NO-FP16-NEXT: %d:_(<4 x s32>) = COPY $q3
149 ; NO-FP16-NEXT: [[FMINIMUM:%[0-9]+]]:_(<4 x s32>) = G_FMINIMUM %a, %c
150 ; NO-FP16-NEXT: [[FMINIMUM1:%[0-9]+]]:_(<4 x s32>) = G_FMINIMUM %b, %d
151 ; NO-FP16-NEXT: $q0 = COPY [[FMINIMUM]](<4 x s32>)
152 ; NO-FP16-NEXT: $q1 = COPY [[FMINIMUM1]](<4 x s32>)
153 ; NO-FP16-NEXT: RET_ReallyLR implicit $q0
154 %a:_(<4 x s32>) = COPY $q0
155 %b:_(<4 x s32>) = COPY $q1
156 %c:_(<4 x s32>) = COPY $q2
157 %d:_(<4 x s32>) = COPY $q3
158 %v1:_(<8 x s32>) = G_CONCAT_VECTORS %a, %b
159 %v2:_(<8 x s32>) = G_CONCAT_VECTORS %c, %d
160 %minimum:_(<8 x s32>) = G_FMINIMUM %v1, %v2
161 %uv1:_(<4 x s32>), %uv2:_(<4 x s32>) = G_UNMERGE_VALUES %minimum
162 $q0 = COPY %uv1(<4 x s32>)
163 $q1 = COPY %uv2(<4 x s32>)
164 RET_ReallyLR implicit $q0