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(i8* nocapture readonly %p) local_unnamed_addr #0 {
45 %0 = load i8, i8* %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(i16* nocapture readonly %p) local_unnamed_addr #0 {
53 %0 = load i16, i16* %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(i32* nocapture readonly %p) local_unnamed_addr #0 {
61 %0 = load i32, i32* %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(i64* nocapture readonly %p) local_unnamed_addr #0 {
69 %0 = load i64, i64* %p, align 8
70 ; CHECK: r{{[0-9]+}} = *(u64 *)(r{{[0-9]+}} + 0)
74 ; Function Attrs: norecurse nounwind
75 define dso_local void @storeu8(i8* nocapture %p, i64 %v) local_unnamed_addr #1 {
77 %conv = trunc i64 %v to i8
78 store i8 %conv, i8* %p, align 1
79 ; CHECK: *(u8 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
83 ; Function Attrs: norecurse nounwind
84 define dso_local void @storeu16(i16* nocapture %p, i64 %v) local_unnamed_addr #1 {
86 %conv = trunc i64 %v to i16
87 store i16 %conv, i16* %p, align 2
88 ; CHECK: *(u16 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
92 ; Function Attrs: norecurse nounwind
93 define dso_local void @storeu32(i32* nocapture %p, i64 %v) local_unnamed_addr #1 {
95 %conv = trunc i64 %v to i32
96 store i32 %conv, i32* %p, align 4
97 ; CHECK: *(u32 *)(r{{[0-9]+}} + 0) = w{{[0-9]+}}
101 ; Function Attrs: norecurse nounwind
102 define dso_local void @storeu64(i64* nocapture %p, i64 %v) local_unnamed_addr #1 {
104 store i64 %v, i64* %p, align 8
105 ; CHECK: *(u64 *)(r{{[0-9]+}} + 0) = r{{[0-9]+}}