11; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2- ; RUN: llc < %s -mtriple=aarch64 -mattr=+v8.2a,+fullfp16 | FileCheck %s
2+ ; RUN: llc < %s -mtriple=aarch64 -global-isel=0 -mattr=+v8.2a,+fullfp16 | FileCheck %s --check-prefixes=CHECK,SDISEL
3+ ; RUN: llc < %s -mtriple=aarch64 -global-isel=1 -mattr=+v8.2a,+fullfp16 | FileCheck %s --check-prefixes=CHECK,GISEL
34
45declare i64 @llvm.aarch64.neon.fcvtpu.i64.f16 (half )
56declare i32 @llvm.aarch64.neon.fcvtpu.i32.f16 (half )
@@ -26,59 +27,94 @@ declare half @llvm.aarch64.neon.frecpx.f16(half)
2627declare half @llvm.aarch64.neon.frecpe.f16 (half )
2728
2829define dso_local i16 @t2 (half %a ) {
29- ; CHECK-LABEL: t2:
30- ; CHECK: // %bb.0: // %entry
31- ; CHECK-NEXT: fcmp h0, #0.0
32- ; CHECK-NEXT: csetm w0, eq
33- ; CHECK-NEXT: ret
30+ ; SDISEL-LABEL: t2:
31+ ; SDISEL: // %bb.0: // %entry
32+ ; SDISEL-NEXT: fcmp h0, #0.0
33+ ; SDISEL-NEXT: csetm w0, eq
34+ ; SDISEL-NEXT: ret
35+ ;
36+ ; GISEL-LABEL: t2:
37+ ; GISEL: // %bb.0: // %entry
38+ ; GISEL-NEXT: fcmp h0, #0.0
39+ ; GISEL-NEXT: cset w8, eq
40+ ; GISEL-NEXT: sbfx w0, w8, #0, #1
41+ ; GISEL-NEXT: ret
3442entry:
3543 %0 = fcmp oeq half %a , 0xH0000
3644 %vceqz = sext i1 %0 to i16
3745 ret i16 %vceqz
3846}
3947
4048define dso_local i16 @t3 (half %a ) {
41- ; CHECK-LABEL: t3:
42- ; CHECK: // %bb.0: // %entry
43- ; CHECK-NEXT: fcmp h0, #0.0
44- ; CHECK-NEXT: csetm w0, ge
45- ; CHECK-NEXT: ret
49+ ; SDISEL-LABEL: t3:
50+ ; SDISEL: // %bb.0: // %entry
51+ ; SDISEL-NEXT: fcmp h0, #0.0
52+ ; SDISEL-NEXT: csetm w0, ge
53+ ; SDISEL-NEXT: ret
54+ ;
55+ ; GISEL-LABEL: t3:
56+ ; GISEL: // %bb.0: // %entry
57+ ; GISEL-NEXT: fcmp h0, #0.0
58+ ; GISEL-NEXT: cset w8, ge
59+ ; GISEL-NEXT: sbfx w0, w8, #0, #1
60+ ; GISEL-NEXT: ret
4661entry:
4762 %0 = fcmp oge half %a , 0xH0000
4863 %vcgez = sext i1 %0 to i16
4964 ret i16 %vcgez
5065}
5166
5267define dso_local i16 @t4 (half %a ) {
53- ; CHECK-LABEL: t4:
54- ; CHECK: // %bb.0: // %entry
55- ; CHECK-NEXT: fcmp h0, #0.0
56- ; CHECK-NEXT: csetm w0, gt
57- ; CHECK-NEXT: ret
68+ ; SDISEL-LABEL: t4:
69+ ; SDISEL: // %bb.0: // %entry
70+ ; SDISEL-NEXT: fcmp h0, #0.0
71+ ; SDISEL-NEXT: csetm w0, gt
72+ ; SDISEL-NEXT: ret
73+ ;
74+ ; GISEL-LABEL: t4:
75+ ; GISEL: // %bb.0: // %entry
76+ ; GISEL-NEXT: fcmp h0, #0.0
77+ ; GISEL-NEXT: cset w8, gt
78+ ; GISEL-NEXT: sbfx w0, w8, #0, #1
79+ ; GISEL-NEXT: ret
5880entry:
5981 %0 = fcmp ogt half %a , 0xH0000
6082 %vcgtz = sext i1 %0 to i16
6183 ret i16 %vcgtz
6284}
6385
6486define dso_local i16 @t5 (half %a ) {
65- ; CHECK-LABEL: t5:
66- ; CHECK: // %bb.0: // %entry
67- ; CHECK-NEXT: fcmp h0, #0.0
68- ; CHECK-NEXT: csetm w0, ls
69- ; CHECK-NEXT: ret
87+ ; SDISEL-LABEL: t5:
88+ ; SDISEL: // %bb.0: // %entry
89+ ; SDISEL-NEXT: fcmp h0, #0.0
90+ ; SDISEL-NEXT: csetm w0, ls
91+ ; SDISEL-NEXT: ret
92+ ;
93+ ; GISEL-LABEL: t5:
94+ ; GISEL: // %bb.0: // %entry
95+ ; GISEL-NEXT: fcmp h0, #0.0
96+ ; GISEL-NEXT: cset w8, ls
97+ ; GISEL-NEXT: sbfx w0, w8, #0, #1
98+ ; GISEL-NEXT: ret
7099entry:
71100 %0 = fcmp ole half %a , 0xH0000
72101 %vclez = sext i1 %0 to i16
73102 ret i16 %vclez
74103}
75104
76105define dso_local i16 @t6 (half %a ) {
77- ; CHECK-LABEL: t6:
78- ; CHECK: // %bb.0: // %entry
79- ; CHECK-NEXT: fcmp h0, #0.0
80- ; CHECK-NEXT: csetm w0, mi
81- ; CHECK-NEXT: ret
106+ ; SDISEL-LABEL: t6:
107+ ; SDISEL: // %bb.0: // %entry
108+ ; SDISEL-NEXT: fcmp h0, #0.0
109+ ; SDISEL-NEXT: csetm w0, mi
110+ ; SDISEL-NEXT: ret
111+ ;
112+ ; GISEL-LABEL: t6:
113+ ; GISEL: // %bb.0: // %entry
114+ ; GISEL-NEXT: fcmp h0, #0.0
115+ ; GISEL-NEXT: cset w8, mi
116+ ; GISEL-NEXT: sbfx w0, w8, #0, #1
117+ ; GISEL-NEXT: ret
82118entry:
83119 %0 = fcmp olt half %a , 0xH0000
84120 %vcltz = sext i1 %0 to i16
@@ -136,10 +172,15 @@ entry:
136172}
137173
138174define dso_local i16 @t16 (half %a ) {
139- ; CHECK-LABEL: t16:
140- ; CHECK: // %bb.0: // %entry
141- ; CHECK-NEXT: fcvtzs w0, h0
142- ; CHECK-NEXT: ret
175+ ; SDISEL-LABEL: t16:
176+ ; SDISEL: // %bb.0: // %entry
177+ ; SDISEL-NEXT: fcvtzs w0, h0
178+ ; SDISEL-NEXT: ret
179+ ;
180+ ; GISEL-LABEL: t16:
181+ ; GISEL: // %bb.0: // %entry
182+ ; GISEL-NEXT: fcvtzu w0, h0
183+ ; GISEL-NEXT: ret
143184entry:
144185 %0 = fptoui half %a to i16
145186 ret i16 %0
0 commit comments