1 ; RUN: llc -O2 -march=bpfel -mattr=+alu32 < %s | FileCheck %s
3 ; unsigned char loadu8(unsigned char *p)
8 ; unsigned short loadu16(unsigned short *p)
13 ; unsigned loadu32(unsigned *p)
18 ; unsigned long long loadu64(unsigned long long *p)
23 ; void storeu8(unsigned char *p, unsigned long long v)
25 ; *p = (unsigned char)v;
28 ; void storeu16(unsigned short *p, unsigned long long v)
30 ; *p = (unsigned short)v;
33 ; void storeu32(unsigned *p, unsigned long long v)
38 ; void storeu64(unsigned long long *p, unsigned long long v)
42 ; Function Attrs: norecurse nounwind readonly
43 define dso_local zeroext i8 @loadu8(ptr nocapture readonly %p) local_unnamed_addr #0 {
45 %0 = load i8, ptr %p, align 1
46 ; CHECK: w{{[0-9]+}} = *(u8 *)(r{{[0-9]+}} + 0)
50 ; Function Attrs: norecurse nounwind readonly
51 define dso_local zeroext i16 @loadu16(ptr nocapture readonly %p) local_unnamed_addr #0 {
53 %0 = load i16, ptr %p, align 2
54 ; CHECK: w{{[0-9]+}} = *(u16 *)(r{{[0-9]+}} + 0)
58 ; Function Attrs: norecurse nounwind readonly
59 define dso_local i32 @loadu32(ptr nocapture readonly %p) local_unnamed_addr #0 {
61 %0 = load i32, ptr %p, align 4
62 ; CHECK: w{{[0-9]+}} = *(u32 *)(r{{[0-9]+}} + 0)
66 ; Function Attrs: norecurse nounwind readonly
67 define dso_local i64 @loadu64(ptr nocapture readonly %p) local_unnamed_addr #0 {
69 %0 = load i64, ptr %p, align 8
70 ; CHECK: r{{[0-9]+}} = *(u64 *)(r{{[0-9]+}} + 0)
74 ; Function Attrs: norecurse nounwind
75 define dso_local void @storeu8(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
77 %conv = trunc i64 %v to i8
78 store i8 %conv, ptr %p, align 1
79 ; CHECK: *(u8 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
83 ; Function Attrs: norecurse nounwind
84 define dso_local void @storeu16(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
86 %conv = trunc i64 %v to i16
87 store i16 %conv, ptr %p, align 2
88 ; CHECK: *(u16 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
92 ; Function Attrs: norecurse nounwind
93 define dso_local void @storeu32(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
95 %conv = trunc i64 %v to i32
96 store i32 %conv, ptr %p, align 4
97 ; CHECK: *(u32 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
101 ; Function Attrs: norecurse nounwind
102 define dso_local void @storeu64(ptr nocapture %p, i64 %v) local_unnamed_addr #1 {
104 store i64 %v, ptr %p, align 8
105 ; CHECK: *(u64 *)(r{{[0-9]+}} + 0) = r{{[0-9]+}}