CodeGen: soften f16 type by default instead of marking legal.
[oota-llvm.git] / test / CodeGen / AArch64 / half.ll
1 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 | FileCheck %s
2
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* %in
8   store half %val, half* %out
9   ret void
10 }
11
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
17   ret i16 %val_int
18 }
19
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
25   ret void
26 }