1 ; RUN: llc < %s -mtriple=aarch64-none-eabi -mattr=+fullfp16 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-ILLEGAL
2 ; RUN: llc < %s -mtriple=aarch64-none-eabi -mattr=+fullfp16,+zcz | FileCheck %s --check-prefix=CHECK-ZCZ
3 ; RUN: llc < %s -mtriple=aarch64-none-eabi -mattr=-fullfp16 | FileCheck %s --check-prefix=CHECK-NOFP16 --check-prefix=CHECK-ILLEGAL
5 define half @Const0() {
9 ; CHECK-DAG-ILLEGAL-LABEL: Const0:
10 ; CHECK-DAG-ILLEGAL-NEXT: fmov h0, wzr
11 ; CHECK-DAG-ILLEGAL-NEXT: ret
13 ; CHECK-ZCZ-LABEL: Const0:
14 ; CHECK-ZCZ: movi v0.2d, #0000000000000000
17 define half @Const1() {
21 ; CHECK-DAG-LABEL: Const1:
22 ; CHECK-DAG-NEXT: fmov h0, #1.00000000
25 ; CHECK-NOFP16: .[[LBL1:LCPI1_[0-9]]]:
26 ; CHECK-NOFP16-NEXT: .hword 15360 // half 1
27 ; CHECK-NOFP16-LABEL: Const1:
28 ; CHECK-NOFP16: adrp x[[NUM:[0-9]+]], .[[LBL1]]
29 ; CHECK-NOFP16-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL1]]]
31 define half @Const2() {
35 ; CHECK-DAG-LABEL: Const2:
36 ; CHECK-DAG-NEXT: fmov h0, #0.12500000
39 ; CHECK-NOFP16: .[[LBL2:LCPI2_[0-9]]]:
40 ; CHECK-NOFP16-NEXT: .hword 12288 // half 0.125
41 ; CHECK-NOFP16-LABEL: Const2:
42 ; CHECK-NOFP16: adrp x[[NUM:[0-9]+]], .[[LBL2]]
43 ; CHECK-NOFP16-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL2]]]
45 define half @Const3() {
49 ; CHECK-DAG-LABEL: Const3:
50 ; CHECK-DAG-NEXT: fmov h0, #30.00000000
53 ; CHECK-NOFP16: .[[LBL3:LCPI3_[0-9]]]:
54 ; CHECK-NOFP16-NEXT: .hword 20352 // half 30
55 ; CHECK-NOFP16-LABEL: Const3:
56 ; CHECK-NOFP16: adrp x[[NUM:[0-9]+]], .[[LBL3]]
57 ; CHECK-NOFP16-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL3]]]
60 define half @Const4() {
64 ; CHECK-DAG-LABEL: Const4:
65 ; CHECK-DAG-NEXT: fmov h0, #31.00000000
68 ; CHECK-NOFP16: .[[LBL4:LCPI4_[0-9]]]:
69 ; CHECK-NOFP16-NEXT: .hword 20416 // half 31
70 ; CHECK-NOFP16-LABEL: Const4:
71 ; CHECK-NOFP16: adrp x[[NUM:[0-9]+]], .[[LBL4]]
72 ; CHECK-NOFP16-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL4]]]
74 define half @Const5() {
78 ; CHECK-ILLEGAL: .[[LBL5:LCPI5_[0-9]]]:
79 ; CHECK-ILLEGAL-NEXT: .hword 12272 // half 0.12402
80 ; CHECK-ILLEGAL-LABEL: Const5:
81 ; CHECK-ILLEGAL: adrp x[[NUM:[0-9]+]], .[[LBL5]]
82 ; CHECK-ILLEGAL-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL5]]]
84 define half @Const6() {
88 ; CHECK-ILLEGAL: .[[LBL6:LCPI6_[0-9]]]:
89 ; CHECK-ILLEGAL-NEXT: .hword 20417 // half 31.016
90 ; CHECK-ILLEGAL-LABEL: Const6:
91 ; CHECK-ILLEGAL: adrp x[[NUM:[0-9]+]], .[[LBL6]]
92 ; CHECK-ILLEGAL-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL6]]]
95 define half @Const7() {
99 ; CHECK-ILLEGAL: .[[LBL7:LCPI7_[0-9]]]:
100 ; CHECK-ILLEGAL-NEXT: .hword 20480 // half 32
101 ; CHECK-ILLEGAL-LABEL: Const7:
102 ; CHECK-ILLEGAL: adrp x[[NUM:[0-9]+]], .[[LBL7]]
103 ; CHECK-ILLEGAL-NEXT: ldr h0, [x[[NUM]], :lo12:.[[LBL7]]]