File: fp16-load-store.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (105 lines) | stat: -rw-r--r-- 3,057 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
; RUN: llc < %s -mtriple armv8a--none-eabi -mattr=+fullfp16 | FileCheck %s

define void @load_zero(half* %in, half* %out) {
entry:
; CHECK-LABEL: load_zero:
; CHECK: vldr.16 {{s[0-9]+}}, [r0]
  %arrayidx = getelementptr inbounds half, half* %in, i32 0
  %load = load half, half* %arrayidx, align 2
  store half %load, half* %out
  ret void
}

define void @load_255(half* %in, half* %out) {
entry:
; CHECK-LABEL: load_255:
; CHECK: vldr.16 {{s[0-9]+}}, [r0, #510]
  %arrayidx = getelementptr inbounds half, half* %in, i32 255
  %load = load half, half* %arrayidx, align 2
  store half %load, half* %out
  ret void
}

define void @load_256(half* %in, half* %out) {
entry:
; CHECK-LABEL: load_256:
; CHECK: add     [[ADDR:r[0-9]+]], r0, #512
; CHECK: vldr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
  %arrayidx = getelementptr inbounds half, half* %in, i32 256
  %load = load half, half* %arrayidx, align 2
  store half %load, half* %out
  ret void
}

define void @load_neg_255(half* %in, half* %out) {
entry:
; CHECK-LABEL: load_neg_255:
; CHECK: vldr.16 {{s[0-9]+}}, [r0, #-510]
  %arrayidx = getelementptr inbounds half, half* %in, i32 -255
  %load = load half, half* %arrayidx, align 2
  store half %load, half* %out
  ret void
}

define void @load_neg_256(half* %in, half* %out) {
entry:
; CHECK-LABEL: load_neg_256:
; CHECK: sub     [[ADDR:r[0-9]+]], r0, #512
; CHECK: vldr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
  %arrayidx = getelementptr inbounds half, half* %in, i32 -256
  %load = load half, half* %arrayidx, align 2
  store half %load, half* %out
  ret void
}

define void @store_zero(half* %in, half* %out) {
entry:
; CHECK-LABEL: store_zero:
  %load = load half, half* %in, align 2
; CHECK: vstr.16 {{s[0-9]+}}, [r1]
  %arrayidx = getelementptr inbounds half, half* %out, i32 0
  store half %load, half* %arrayidx
  ret void
}

define void @store_255(half* %in, half* %out) {
entry:
; CHECK-LABEL: store_255:
  %load = load half, half* %in, align 2
; CHECK: vstr.16 {{s[0-9]+}}, [r1, #510]
  %arrayidx = getelementptr inbounds half, half* %out, i32 255
  store half %load, half* %arrayidx
  ret void
}

define void @store_256(half* %in, half* %out) {
entry:
; CHECK-LABEL: store_256:
  %load = load half, half* %in, align 2
; CHECK: add     [[ADDR:r[0-9]+]], r1, #512
; CHECK: vstr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
  %arrayidx = getelementptr inbounds half, half* %out, i32 256
  store half %load, half* %arrayidx
  ret void
}

define void @store_neg_255(half* %in, half* %out) {
entry:
; CHECK-LABEL: store_neg_255:
  %load = load half, half* %in, align 2
; CHECK: vstr.16 {{s[0-9]+}}, [r1, #-510]
  %arrayidx = getelementptr inbounds half, half* %out, i32 -255
  store half %load, half* %arrayidx
  ret void
}

define void @store_neg_256(half* %in, half* %out) {
entry:
; CHECK-LABEL: store_neg_256:
  %load = load half, half* %in, align 2
; CHECK: sub     [[ADDR:r[0-9]+]], r1, #512
; CHECK: vstr.16 {{s[0-9]+}}, {{\[}}[[ADDR]]{{\]}}
  %arrayidx = getelementptr inbounds half, half* %out, i32 -256
  store half %load, half* %arrayidx
  ret void
}