1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
3 define void @test_load_store(half* %in, half* %out) {
4 ; CHECK-LABEL: test_load_store:
5 ; CHECK: ldr [[TMP:h[0-9]+]], [x0]
6 ; CHECK: str [[TMP]], [x1]
7 %val = load half, half* %in
8 store half %val, half* %out
12 define i16 @test_bitcast_from_half(half* %addr) {
13 ; CHECK-LABEL: test_bitcast_from_half:
14 ; CHECK: ldrh w0, [x0]
15 %val = load half, half* %addr
16 %val_int = bitcast half %val to i16
20 define i16 @test_reg_bitcast_from_half(half %in) {
21 ; CHECK-LABEL: test_reg_bitcast_from_half:
24 ; CHECK-DAG: fmov w0, s0
26 %val = bitcast half %in to i16
30 define void @test_bitcast_to_half(half* %addr, i16 %in) {
31 ; CHECK-LABEL: test_bitcast_to_half:
32 ; CHECK: strh w1, [x0]
33 %val_fp = bitcast i16 %in to half
34 store half %val_fp, half* %addr
38 define half @test_reg_bitcast_to_half(i16 %in) {
39 ; CHECK-LABEL: test_reg_bitcast_to_half:
42 ; CHECK-DAG: fmov s0, w0
45 %val = bitcast i16 %in to half
49 define float @test_extend32(half* %addr) {
50 ; CHECK-LABEL: test_extend32:
51 ; CHECK: fcvt {{s[0-9]+}}, {{h[0-9]+}}
53 %val16 = load half, half* %addr
54 %val32 = fpext half %val16 to float
58 define double @test_extend64(half* %addr) {
59 ; CHECK-LABEL: test_extend64:
60 ; CHECK: fcvt {{d[0-9]+}}, {{h[0-9]+}}
62 %val16 = load half, half* %addr
63 %val32 = fpext half %val16 to double
67 define void @test_trunc32(float %in, half* %addr) {
68 ; CHECK-LABEL: test_trunc32:
69 ; CHECK: fcvt {{h[0-9]+}}, {{s[0-9]+}}
71 %val16 = fptrunc float %in to half
72 store half %val16, half* %addr
76 define void @test_trunc64(double %in, half* %addr) {
77 ; CHECK-LABEL: test_trunc64:
78 ; CHECK: fcvt {{h[0-9]+}}, {{d[0-9]+}}
80 %val16 = fptrunc double %in to half
81 store half %val16, half* %addr
85 define i16 @test_fccmp(i1 %a) {
86 ;CHECK-LABEL: test_fccmp:
88 %cmp0 = fcmp ogt half 0xH3333, undef
89 %cmp1 = fcmp ogt half 0xH2222, undef
90 %x = select i1 %cmp0, i16 0, i16 undef
91 %or = or i1 %cmp1, %cmp0
92 %y = select i1 %or, i16 4, i16 undef