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
| ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
define zeroext i8 @_16_bit_positive_offset(i8* %a) {
; MIPS32-LABEL: _16_bit_positive_offset:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: lbu $2, 32767($4)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i8, i8* %a, i32 32767
%0 = load i8, i8* %arrayidx
ret i8 %0
}
define void @_16_bit_negative_offset(i8 %val, i8* %a) {
; MIPS32-LABEL: _16_bit_negative_offset:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: sb $4, -32768($5)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i8, i8* %a, i32 -32768
store i8 %val, i8* %arrayidx
ret void
}
define void @_large_positive_offset(i8 %val, i8* %a) {
; MIPS32-LABEL: _large_positive_offset:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: ori $1, $zero, 32768
; MIPS32-NEXT: addu $1, $5, $1
; MIPS32-NEXT: sb $4, 0($1)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i8, i8* %a, i32 32768
store i8 %val, i8* %arrayidx
ret void
}
define signext i8 @_large_negative_offset(i8* %a) {
; MIPS32-LABEL: _large_negative_offset:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: lui $1, 65535
; MIPS32-NEXT: ori $1, $1, 32767
; MIPS32-NEXT: addu $1, $4, $1
; MIPS32-NEXT: lb $2, 0($1)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i8, i8* %a, i32 -32769
%0 = load i8, i8* %arrayidx
ret i8 %0
}
define float @fold_f32_load(float* %a) {
; MIPS32-LABEL: fold_f32_load:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: lwc1 $f0, 40($4)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds float, float* %a, i32 10
%0 = load float, float* %arrayidx
ret float %0
}
define void @fold_f64_store(double %val, double* %a) {
; MIPS32-LABEL: fold_f64_store:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: sdc1 $f12, -80($6)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds double, double* %a, i32 -10
store double %val, double* %arrayidx
ret void
}
define i16 @fold_i16_load(i16* %a) {
; MIPS32-LABEL: fold_i16_load:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: lhu $2, -20($4)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i16, i16* %a, i32 -10
%0 = load i16, i16* %arrayidx
ret i16 %0
}
define void @fold_i32_store(i32 %val, i32* %a) {
; MIPS32-LABEL: fold_i32_store:
; MIPS32: # %bb.0: # %entry
; MIPS32-NEXT: sw $4, 40($5)
; MIPS32-NEXT: jr $ra
; MIPS32-NEXT: nop
entry:
%arrayidx = getelementptr inbounds i32, i32* %a, i32 10
store i32 %val, i32* %arrayidx
ret void
}
|