1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
4 define zeroext i8 @_16_bit_positive_offset(i8* %a) {
5 ; MIPS32-LABEL: _16_bit_positive_offset:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: lbu $2, 32767($4)
11 %arrayidx = getelementptr inbounds i8, i8* %a, i32 32767
12 %0 = load i8, i8* %arrayidx
16 define void @_16_bit_negative_offset(i8 %val, i8* %a) {
17 ; MIPS32-LABEL: _16_bit_negative_offset:
18 ; MIPS32: # %bb.0: # %entry
19 ; MIPS32-NEXT: sb $4, -32768($5)
23 %arrayidx = getelementptr inbounds i8, i8* %a, i32 -32768
24 store i8 %val, i8* %arrayidx
28 define void @_large_positive_offset(i8 %val, i8* %a) {
29 ; MIPS32-LABEL: _large_positive_offset:
30 ; MIPS32: # %bb.0: # %entry
31 ; MIPS32-NEXT: ori $1, $zero, 32768
32 ; MIPS32-NEXT: addu $1, $5, $1
33 ; MIPS32-NEXT: sb $4, 0($1)
37 %arrayidx = getelementptr inbounds i8, i8* %a, i32 32768
38 store i8 %val, i8* %arrayidx
42 define signext i8 @_large_negative_offset(i8* %a) {
43 ; MIPS32-LABEL: _large_negative_offset:
44 ; MIPS32: # %bb.0: # %entry
45 ; MIPS32-NEXT: lui $1, 65535
46 ; MIPS32-NEXT: ori $1, $1, 32767
47 ; MIPS32-NEXT: addu $1, $4, $1
48 ; MIPS32-NEXT: lb $2, 0($1)
52 %arrayidx = getelementptr inbounds i8, i8* %a, i32 -32769
53 %0 = load i8, i8* %arrayidx
57 define float @fold_f32_load(float* %a) {
58 ; MIPS32-LABEL: fold_f32_load:
59 ; MIPS32: # %bb.0: # %entry
60 ; MIPS32-NEXT: lwc1 $f0, 40($4)
64 %arrayidx = getelementptr inbounds float, float* %a, i32 10
65 %0 = load float, float* %arrayidx
69 define void @fold_f64_store(double %val, double* %a) {
70 ; MIPS32-LABEL: fold_f64_store:
71 ; MIPS32: # %bb.0: # %entry
72 ; MIPS32-NEXT: sdc1 $f12, -80($6)
76 %arrayidx = getelementptr inbounds double, double* %a, i32 -10
77 store double %val, double* %arrayidx
81 define i16 @fold_i16_load(i16* %a) {
82 ; MIPS32-LABEL: fold_i16_load:
83 ; MIPS32: # %bb.0: # %entry
84 ; MIPS32-NEXT: lhu $2, -20($4)
88 %arrayidx = getelementptr inbounds i16, i16* %a, i32 -10
89 %0 = load i16, i16* %arrayidx
93 define void @fold_i32_store(i32 %val, i32* %a) {
94 ; MIPS32-LABEL: fold_i32_store:
95 ; MIPS32: # %bb.0: # %entry
96 ; MIPS32-NEXT: sw $4, 40($5)
100 %arrayidx = getelementptr inbounds i32, i32* %a, i32 10
101 store i32 %val, i32* %arrayidx