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]
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* %addr
16 %val_int = bitcast half %val to i16
20 define void @test_bitcast_to_half(half* %addr, i16 %in) {
21 ; CHECK-LABEL: test_bitcast_to_half:
22 ; CHECK: strh w1, [x0]
23 %val_fp = bitcast i16 %in to half
24 store half %val_fp, half* %addr
28 define float @test_extend32(half* %addr) {
29 ; CHECK-LABEL: test_extend32:
30 ; CHECK: fcvt {{s[0-9]+}}, {{h[0-9]+}}
32 %val16 = load half* %addr
33 %val32 = fpext half %val16 to float
37 define double @test_extend64(half* %addr) {
38 ; CHECK-LABEL: test_extend64:
39 ; CHECK: fcvt {{d[0-9]+}}, {{h[0-9]+}}
41 %val16 = load half* %addr
42 %val32 = fpext half %val16 to double
46 define void @test_trunc32(float %in, half* %addr) {
47 ; CHECK-LABEL: test_trunc32:
48 ; CHECK: fcvt {{h[0-9]+}}, {{s[0-9]+}}
50 %val16 = fptrunc float %in to half
51 store half %val16, half* %addr
55 define void @test_trunc64(double %in, half* %addr) {
56 ; CHECK-LABEL: test_trunc64:
57 ; CHECK: fcvt {{h[0-9]+}}, {{d[0-9]+}}
59 %val16 = fptrunc double %in to half
60 store half %val16, half* %addr