1 ; RUN: llc < %s -mtriple=aarch64-none-eabi | FileCheck %s
3 define <4 x half> @add_h(<4 x half> %a, <4 x half> %b) {
6 ; CHECK-DAG: fcvtl [[OP1:v[0-9]+\.4s]], v0.4h
7 ; CHECK-DAG: fcvtl [[OP2:v[0-9]+\.4s]], v1.4h
8 ; CHECK: fadd [[RES:v[0-9]+.4s]], [[OP1]], [[OP2]]
9 ; CHECK: fcvtn v0.4h, [[RES]]
10 %0 = fadd <4 x half> %a, %b
15 define <4 x half> @build_h4(<4 x half> %a) {
17 ; CHECK-LABEL: build_h4:
18 ; CHECK: movz [[GPR:w[0-9]+]], #0x3ccd
19 ; CHECK: dup v0.4h, [[GPR]]
20 ret <4 x half> <half 0xH3CCD, half 0xH3CCD, half 0xH3CCD, half 0xH3CCD>
24 define <4 x half> @sub_h(<4 x half> %a, <4 x half> %b) {
27 ; CHECK-DAG: fcvtl [[OP1:v[0-9]+\.4s]], v0.4h
28 ; CHECK-DAG: fcvtl [[OP2:v[0-9]+\.4s]], v1.4h
29 ; CHECK: fsub [[RES:v[0-9]+.4s]], [[OP1]], [[OP2]]
30 ; CHECK: fcvtn v0.4h, [[RES]]
31 %0 = fsub <4 x half> %a, %b
36 define <4 x half> @mul_h(<4 x half> %a, <4 x half> %b) {
39 ; CHECK-DAG: fcvtl [[OP1:v[0-9]+\.4s]], v0.4h
40 ; CHECK-DAG: fcvtl [[OP2:v[0-9]+\.4s]], v1.4h
41 ; CHECK: fmul [[RES:v[0-9]+.4s]], [[OP1]], [[OP2]]
42 ; CHECK: fcvtn v0.4h, [[RES]]
43 %0 = fmul <4 x half> %a, %b
48 define <4 x half> @div_h(<4 x half> %a, <4 x half> %b) {
51 ; CHECK-DAG: fcvtl [[OP1:v[0-9]+\.4s]], v0.4h
52 ; CHECK-DAG: fcvtl [[OP2:v[0-9]+\.4s]], v1.4h
53 ; CHECK: fdiv [[RES:v[0-9]+.4s]], [[OP1]], [[OP2]]
54 ; CHECK: fcvtn v0.4h, [[RES]]
55 %0 = fdiv <4 x half> %a, %b
60 define <4 x half> @load_h(<4 x half>* %a) {
62 ; CHECK-LABEL: load_h:
64 %0 = load <4 x half>, <4 x half>* %a, align 4
69 define void @store_h(<4 x half>* %a, <4 x half> %b) {
71 ; CHECK-LABEL: store_h:
73 store <4 x half> %b, <4 x half>* %a, align 4
77 define <4 x half> @s_to_h(<4 x float> %a) {
78 ; CHECK-LABEL: s_to_h:
79 ; CHECK: fcvtn v0.4h, v0.4s
80 %1 = fptrunc <4 x float> %a to <4 x half>
84 define <4 x half> @d_to_h(<4 x double> %a) {
85 ; CHECK-LABEL: d_to_h:
94 %1 = fptrunc <4 x double> %a to <4 x half>
98 define <4 x float> @h_to_s(<4 x half> %a) {
99 ; CHECK-LABEL: h_to_s:
100 ; CHECK: fcvtl v0.4s, v0.4h
101 %1 = fpext <4 x half> %a to <4 x float>
105 define <4 x double> @h_to_d(<4 x half> %a) {
106 ; CHECK-LABEL: h_to_d:
115 %1 = fpext <4 x half> %a to <4 x double>
119 define <4 x half> @bitcast_i_to_h(float, <4 x i16> %a) {
120 ; CHECK-LABEL: bitcast_i_to_h:
121 ; CHECK: mov v0.16b, v1.16b
122 %2 = bitcast <4 x i16> %a to <4 x half>
126 define <4 x i16> @bitcast_h_to_i(float, <4 x half> %a) {
127 ; CHECK-LABEL: bitcast_h_to_i:
128 ; CHECK: mov v0.16b, v1.16b
129 %2 = bitcast <4 x half> %a to <4 x i16>