1 ; RUN: llc < %s -mtriple armv8a--none-eabi -mattr=+fullfp16 | FileCheck %s
3 define void @load_zero(ptr %in, ptr %out) {
5 ; CHECK-LABEL: load_zero:
6 ; CHECK: vldr.16 {{s[0-9]+}}, [r0]
7 %load = load half, ptr %in, align 2
8 store half %load, ptr %out
12 define void @load_255(ptr %in, ptr %out) {
14 ; CHECK-LABEL: load_255:
15 ; CHECK: vldr.16 {{s[0-9]+}}, [r0, #510]
16 %arrayidx = getelementptr inbounds half, ptr %in, i32 255
17 %load = load half, ptr %arrayidx, align 2
18 store half %load, ptr %out
22 define void @load_256(ptr %in, ptr %out) {
24 ; CHECK-LABEL: load_256:
25 ; CHECK: add [[ADDR:r[0-9]+]], r0, #512
26 ; CHECK: vldr.16 {{s[0-9]+}}, [[[ADDR]]]
27 %arrayidx = getelementptr inbounds half, ptr %in, i32 256
28 %load = load half, ptr %arrayidx, align 2
29 store half %load, ptr %out
33 define void @load_neg_255(ptr %in, ptr %out) {
35 ; CHECK-LABEL: load_neg_255:
36 ; CHECK: vldr.16 {{s[0-9]+}}, [r0, #-510]
37 %arrayidx = getelementptr inbounds half, ptr %in, i32 -255
38 %load = load half, ptr %arrayidx, align 2
39 store half %load, ptr %out
43 define void @load_neg_256(ptr %in, ptr %out) {
45 ; CHECK-LABEL: load_neg_256:
46 ; CHECK: sub [[ADDR:r[0-9]+]], r0, #512
47 ; CHECK: vldr.16 {{s[0-9]+}}, [[[ADDR]]]
48 %arrayidx = getelementptr inbounds half, ptr %in, i32 -256
49 %load = load half, ptr %arrayidx, align 2
50 store half %load, ptr %out
54 define void @store_zero(ptr %in, ptr %out) {
56 ; CHECK-LABEL: store_zero:
57 %load = load half, ptr %in, align 2
58 ; CHECK: vstr.16 {{s[0-9]+}}, [r1]
59 store half %load, ptr %out
63 define void @store_255(ptr %in, ptr %out) {
65 ; CHECK-LABEL: store_255:
66 %load = load half, ptr %in, align 2
67 ; CHECK: vstr.16 {{s[0-9]+}}, [r1, #510]
68 %arrayidx = getelementptr inbounds half, ptr %out, i32 255
69 store half %load, ptr %arrayidx
73 define void @store_256(ptr %in, ptr %out) {
75 ; CHECK-LABEL: store_256:
76 %load = load half, ptr %in, align 2
77 ; CHECK: add [[ADDR:r[0-9]+]], r1, #512
78 ; CHECK: vstr.16 {{s[0-9]+}}, [[[ADDR]]]
79 %arrayidx = getelementptr inbounds half, ptr %out, i32 256
80 store half %load, ptr %arrayidx
84 define void @store_neg_255(ptr %in, ptr %out) {
86 ; CHECK-LABEL: store_neg_255:
87 %load = load half, ptr %in, align 2
88 ; CHECK: vstr.16 {{s[0-9]+}}, [r1, #-510]
89 %arrayidx = getelementptr inbounds half, ptr %out, i32 -255
90 store half %load, ptr %arrayidx
94 define void @store_neg_256(ptr %in, ptr %out) {
96 ; CHECK-LABEL: store_neg_256:
97 %load = load half, ptr %in, align 2
98 ; CHECK: sub [[ADDR:r[0-9]+]], r1, #512
99 ; CHECK: vstr.16 {{s[0-9]+}}, [[[ADDR]]]
100 %arrayidx = getelementptr inbounds half, ptr %out, i32 -256
101 store half %load, ptr %arrayidx