1 ; RUN: llc < %s -mtriple=aarch64-none-eabi | FileCheck %s
3 define half @add_h(half %a, half %b) {
6 ; CHECK-DAG: fcvt [[OP1:s[0-9]+]], h0
7 ; CHECK-DAG: fcvt [[OP2:s[0-9]+]], h1
8 ; CHECK: fadd [[RES:s[0-9]+]], [[OP1]], [[OP2]]
9 ; CHECK: fcvt h0, [[RES]]
15 define half @sub_h(half %a, half %b) {
18 ; CHECK-DAG: fcvt [[OP1:s[0-9]+]], h0
19 ; CHECK-DAG: fcvt [[OP2:s[0-9]+]], h1
20 ; CHECK: fsub [[RES:s[0-9]+]], [[OP1]], [[OP2]]
21 ; CHECK: fcvt h0, [[RES]]
27 define half @mul_h(half %a, half %b) {
30 ; CHECK-DAG: fcvt [[OP1:s[0-9]+]], h0
31 ; CHECK-DAG: fcvt [[OP2:s[0-9]+]], h1
32 ; CHECK: fmul [[RES:s[0-9]+]], [[OP1]], [[OP2]]
33 ; CHECK: fcvt h0, [[RES]]
39 define half @div_h(half %a, half %b) {
42 ; CHECK-DAG: fcvt [[OP1:s[0-9]+]], h0
43 ; CHECK-DAG: fcvt [[OP2:s[0-9]+]], h1
44 ; CHECK: fdiv [[RES:s[0-9]+]], [[OP1]], [[OP2]]
45 ; CHECK: fcvt h0, [[RES]]
51 define half @load_h(half* %a) {
53 ; CHECK-LABEL: load_h:
55 %0 = load half* %a, align 4
60 define void @store_h(half* %a, half %b) {
62 ; CHECK-LABEL: store_h:
64 store half %b, half* %a, align 4
68 define half @s_to_h(float %a) {
69 ; CHECK-LABEL: s_to_h:
71 %1 = fptrunc float %a to half
75 define half @d_to_h(double %a) {
76 ; CHECK-LABEL: d_to_h:
78 %1 = fptrunc double %a to half
82 define float @h_to_s(half %a) {
83 ; CHECK-LABEL: h_to_s:
85 %1 = fpext half %a to float
89 define double @h_to_d(half %a) {
90 ; CHECK-LABEL: h_to_d:
92 %1 = fpext half %a to double
96 define half @bitcast_i_to_h(i16 %a) {
97 ; CHECK-LABEL: bitcast_i_to_h:
99 %1 = bitcast i16 %a to half
104 define i16 @bitcast_h_to_i(half %a) {
105 ; CHECK-LABEL: bitcast_h_to_i:
107 %1 = bitcast half %a to i16