1 ; RUN: llc < %s -mtriple armv8a--none-eabi -mattr=+fullfp16 | FileCheck %s
3 define void @load_zero(half* %in, half* %out) {
5 ; CHECK-LABEL: load_zero:
6 ; CHECK: vldr.16 {{s[0-9]+}}, [r0]
7 %arrayidx = getelementptr inbounds half, half* %in, i32 0
8 %load = load half, half* %arrayidx, align 2
9 store half %load, half* %out
13 define void @load_255(half* %in, half* %out) {
15 ; CHECK-LABEL: load_255:
16 ; CHECK: vldr.16 {{s[0-9]+}}, [r0, #510]
17 %arrayidx = getelementptr inbounds half, half* %in, i32 255
18 %load = load half, half* %arrayidx, align 2
19 store half %load, half* %out
23 define void @load_256(half* %in, half* %out) {
25 ; CHECK-LABEL: load_256:
26 ; CHECK: add [[ADDR:r[0-9]+]], r0, #512
27 ; CHECK: vldr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
28 %arrayidx = getelementptr inbounds half, half* %in, i32 256
29 %load = load half, half* %arrayidx, align 2
30 store half %load, half* %out
34 define void @load_neg_255(half* %in, half* %out) {
36 ; CHECK-LABEL: load_neg_255:
37 ; CHECK: vldr.16 {{s[0-9]+}}, [r0, #-510]
38 %arrayidx = getelementptr inbounds half, half* %in, i32 -255
39 %load = load half, half* %arrayidx, align 2
40 store half %load, half* %out
44 define void @load_neg_256(half* %in, half* %out) {
46 ; CHECK-LABEL: load_neg_256:
47 ; CHECK: sub [[ADDR:r[0-9]+]], r0, #512
48 ; CHECK: vldr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
49 %arrayidx = getelementptr inbounds half, half* %in, i32 -256
50 %load = load half, half* %arrayidx, align 2
51 store half %load, half* %out
55 define void @store_zero(half* %in, half* %out) {
57 ; CHECK-LABEL: store_zero:
58 %load = load half, half* %in, align 2
59 ; CHECK: vstr.16 {{s[0-9]+}}, [r1]
60 %arrayidx = getelementptr inbounds half, half* %out, i32 0
61 store half %load, half* %arrayidx
65 define void @store_255(half* %in, half* %out) {
67 ; CHECK-LABEL: store_255:
68 %load = load half, half* %in, align 2
69 ; CHECK: vstr.16 {{s[0-9]+}}, [r1, #510]
70 %arrayidx = getelementptr inbounds half, half* %out, i32 255
71 store half %load, half* %arrayidx
75 define void @store_256(half* %in, half* %out) {
77 ; CHECK-LABEL: store_256:
78 %load = load half, half* %in, align 2
79 ; CHECK: add [[ADDR:r[0-9]+]], r1, #512
80 ; CHECK: vstr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
81 %arrayidx = getelementptr inbounds half, half* %out, i32 256
82 store half %load, half* %arrayidx
86 define void @store_neg_255(half* %in, half* %out) {
88 ; CHECK-LABEL: store_neg_255:
89 %load = load half, half* %in, align 2
90 ; CHECK: vstr.16 {{s[0-9]+}}, [r1, #-510]
91 %arrayidx = getelementptr inbounds half, half* %out, i32 -255
92 store half %load, half* %arrayidx
96 define void @store_neg_256(half* %in, half* %out) {
98 ; CHECK-LABEL: store_neg_256:
99 %load = load half, half* %in, align 2
100 ; CHECK: sub [[ADDR:r[0-9]+]], r1, #512
101 ; CHECK: vstr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
102 %arrayidx = getelementptr inbounds half, half* %out, i32 -256
103 store half %load, half* %arrayidx