1 ; RUN: llc < %s -mtriple=aarch64 -mattr=+v8.2a,+fullfp16 | FileCheck %s
3 declare <4 x half> @llvm.aarch64.neon.fmulx.v4f16(<4 x half>, <4 x half>)
4 declare <8 x half> @llvm.aarch64.neon.fmulx.v8f16(<8 x half>, <8 x half>)
5 declare <4 x half> @llvm.aarch64.neon.fminnmp.v4f16(<4 x half>, <4 x half>)
6 declare <8 x half> @llvm.aarch64.neon.fminnmp.v8f16(<8 x half>, <8 x half>)
7 declare <4 x half> @llvm.aarch64.neon.fmaxnmp.v4f16(<4 x half>, <4 x half>)
8 declare <8 x half> @llvm.aarch64.neon.fmaxnmp.v8f16(<8 x half>, <8 x half>)
9 declare <4 x half> @llvm.aarch64.neon.fabd.v4f16(<4 x half>, <4 x half>)
10 declare <8 x half> @llvm.aarch64.neon.fabd.v8f16(<8 x half>, <8 x half>)
11 declare <4 x half> @llvm.fabs.v4f16(<4 x half>)
12 declare <8 x half> @llvm.fabs.v8f16(<8 x half>)
14 define dso_local <4 x half> @t_vdiv_f16(<4 x half> %a, <4 x half> %b) {
15 ; CHECK-LABEL: t_vdiv_f16:
16 ; CHECK: fdiv v0.4h, v0.4h, v1.4h
19 %div.i = fdiv <4 x half> %a, %b
23 define dso_local <8 x half> @t_vdivq_f16(<8 x half> %a, <8 x half> %b) {
24 ; CHECK-LABEL: t_vdivq_f16:
25 ; CHECK: fdiv v0.8h, v0.8h, v1.8h
28 %div.i = fdiv <8 x half> %a, %b
32 define dso_local <4 x half> @t_vmulx_f16(<4 x half> %a, <4 x half> %b) {
33 ; CHECK-LABEL: t_vmulx_f16:
34 ; CHECK: fmulx v0.4h, v0.4h, v1.4h
37 %vmulx2.i = tail call <4 x half> @llvm.aarch64.neon.fmulx.v4f16(<4 x half> %a, <4 x half> %b)
38 ret <4 x half> %vmulx2.i
41 define dso_local <8 x half> @t_vmulxq_f16(<8 x half> %a, <8 x half> %b) {
42 ; CHECK-LABEL: t_vmulxq_f16:
43 ; CHECK: fmulx v0.8h, v0.8h, v1.8h
46 %vmulx2.i = tail call <8 x half> @llvm.aarch64.neon.fmulx.v8f16(<8 x half> %a, <8 x half> %b)
47 ret <8 x half> %vmulx2.i
50 define dso_local <4 x half> @t_vpminnm_f16(<4 x half> %a, <4 x half> %b) {
51 ; CHECK-LABEL: t_vpminnm_f16:
52 ; CHECK: fminnmp v0.4h, v0.4h, v1.4h
55 %vpminnm2.i = tail call <4 x half> @llvm.aarch64.neon.fminnmp.v4f16(<4 x half> %a, <4 x half> %b)
56 ret <4 x half> %vpminnm2.i
59 define dso_local <8 x half> @t_vpminnmq_f16(<8 x half> %a, <8 x half> %b) {
60 ; CHECK-LABEL: t_vpminnmq_f16:
61 ; CHECK: fminnmp v0.8h, v0.8h, v1.8h
64 %vpminnm2.i = tail call <8 x half> @llvm.aarch64.neon.fminnmp.v8f16(<8 x half> %a, <8 x half> %b)
65 ret <8 x half> %vpminnm2.i
68 define dso_local <4 x half> @t_vpmaxnm_f16(<4 x half> %a, <4 x half> %b) {
69 ; CHECK-LABEL: t_vpmaxnm_f16:
70 ; CHECK: fmaxnmp v0.4h, v0.4h, v1.4h
73 %vpmaxnm2.i = tail call <4 x half> @llvm.aarch64.neon.fmaxnmp.v4f16(<4 x half> %a, <4 x half> %b)
74 ret <4 x half> %vpmaxnm2.i
77 define dso_local <8 x half> @t_vpmaxnmq_f16(<8 x half> %a, <8 x half> %b) {
78 ; CHECK-LABEL: t_vpmaxnmq_f16:
79 ; CHECK: fmaxnmp v0.8h, v0.8h, v1.8h
82 %vpmaxnm2.i = tail call <8 x half> @llvm.aarch64.neon.fmaxnmp.v8f16(<8 x half> %a, <8 x half> %b)
83 ret <8 x half> %vpmaxnm2.i
86 define dso_local <4 x half> @t_vabd_f16(<4 x half> %a, <4 x half> %b) {
87 ; CHECK-LABEL: t_vabd_f16:
88 ; CHECK: fabd v0.4h, v0.4h, v1.4h
91 %vabdh_f16 = tail call <4 x half> @llvm.aarch64.neon.fabd.v4f16(<4 x half> %a, <4 x half> %b)
92 ret <4 x half> %vabdh_f16
95 define dso_local <8 x half> @t_vabdq_f16(<8 x half> %a, <8 x half> %b) {
96 ; CHECK-LABEL: t_vabdq_f16:
97 ; CHECK: fabd v0.8h, v0.8h, v1.8h
100 %vabdh_f16 = tail call <8 x half> @llvm.aarch64.neon.fabd.v8f16(<8 x half> %a, <8 x half> %b)
101 ret <8 x half> %vabdh_f16
104 define dso_local <4 x half> @t_vabd_f16_from_fsub_fabs(<4 x half> %a, <4 x half> %b) {
105 ; CHECK-LABEL: t_vabd_f16_from_fsub_fabs:
106 ; CHECK: fabd v0.4h, v0.4h, v1.4h
109 %sub = fsub <4 x half> %a, %b
110 %abs = tail call <4 x half> @llvm.fabs.v4f16(<4 x half> %sub)
114 define dso_local <8 x half> @t_vabdq_f16_from_fsub_fabs(<8 x half> %a, <8 x half> %b) {
115 ; CHECK-LABEL: t_vabdq_f16_from_fsub_fabs:
116 ; CHECK: fabd v0.8h, v0.8h, v1.8h
119 %sub = fsub <8 x half> %a, %b
120 %abs = tail call <8 x half> @llvm.fabs.v8f16(<8 x half> %sub)