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(ptr %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, ptr %a, i32 32767
12 %0 = load i8, ptr %arrayidx
16 define void @_16_bit_negative_offset(i8 %val, ptr %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, ptr %a, i32 -32768
24 store i8 %val, ptr %arrayidx
28 define void @_large_positive_offset(i8 %val, ptr %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, ptr %a, i32 32768
38 store i8 %val, ptr %arrayidx
42 define signext i8 @_large_negative_offset(ptr %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, ptr %a, i32 -32769
53 %0 = load i8, ptr %arrayidx
57 define float @fold_f32_load(ptr %a) {
58 ; MIPS32-LABEL: fold_f32_load:
59 ; MIPS32: # %bb.0: # %entry
60 ; MIPS32-NEXT: lwc1 $f0, 40($4)
64 %arrayidx = getelementptr inbounds float, ptr %a, i32 10
65 %0 = load float, ptr %arrayidx
69 define void @fold_f64_store(double %val, ptr %a) {
70 ; MIPS32-LABEL: fold_f64_store:
71 ; MIPS32: # %bb.0: # %entry
72 ; MIPS32-NEXT: sdc1 $f12, -80($6)
76 %arrayidx = getelementptr inbounds double, ptr %a, i32 -10
77 store double %val, ptr %arrayidx
81 define i16 @fold_i16_load(ptr %a) {
82 ; MIPS32-LABEL: fold_i16_load:
83 ; MIPS32: # %bb.0: # %entry
84 ; MIPS32-NEXT: lhu $2, -20($4)
88 %arrayidx = getelementptr inbounds i16, ptr %a, i32 -10
89 %0 = load i16, ptr %arrayidx
93 define void @fold_i32_store(i32 %val, ptr %a) {
94 ; MIPS32-LABEL: fold_i32_store:
95 ; MIPS32: # %bb.0: # %entry
96 ; MIPS32-NEXT: sw $4, 40($5)
100 %arrayidx = getelementptr inbounds i32, ptr %a, i32 10
101 store i32 %val, ptr %arrayidx