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 i32 @load1_s8_to_zextLoad1_s32(i8* %px) {
5 ; MIPS32-LABEL: load1_s8_to_zextLoad1_s32:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: lbu $2, 0($4)
12 %conv = zext i8 %0 to i32
16 define i32 @load2_s16_to_zextLoad2_s32(i16* %px) {
17 ; MIPS32-LABEL: load2_s16_to_zextLoad2_s32:
18 ; MIPS32: # %bb.0: # %entry
19 ; MIPS32-NEXT: lhu $2, 0($4)
23 %0 = load i16, i16* %px
24 %conv = zext i16 %0 to i32
28 define i16 @load1_s8_to_zextLoad1_s16(i8* %px) {
29 ; MIPS32-LABEL: load1_s8_to_zextLoad1_s16:
30 ; MIPS32: # %bb.0: # %entry
31 ; MIPS32-NEXT: lbu $2, 0($4)
36 %conv = zext i8 %0 to i16
40 define zeroext i16 @load1_s8_to_zextLoad1_s16_to_zextLoad1_s32(i8* %px) {
41 ; MIPS32-LABEL: load1_s8_to_zextLoad1_s16_to_zextLoad1_s32:
42 ; MIPS32: # %bb.0: # %entry
43 ; MIPS32-NEXT: lbu $2, 0($4)
48 %conv = zext i8 %0 to i16
52 define i64 @load4_s32_to_zextLoad4_s64(i32* %px) {
53 ; MIPS32-LABEL: load4_s32_to_zextLoad4_s64:
54 ; MIPS32: # %bb.0: # %entry
55 ; MIPS32-NEXT: lw $2, 0($4)
56 ; MIPS32-NEXT: ori $3, $zero, 0
60 %0 = load i32, i32* %px
61 %conv = zext i32 %0 to i64
65 define i32 @load1_s8_to_sextLoad1_s32(i8* %px) {
66 ; MIPS32-LABEL: load1_s8_to_sextLoad1_s32:
67 ; MIPS32: # %bb.0: # %entry
68 ; MIPS32-NEXT: lb $2, 0($4)
73 %conv = sext i8 %0 to i32
77 define i32 @load2_s16_to_sextLoad2_s32(i16* %px) {
78 ; MIPS32-LABEL: load2_s16_to_sextLoad2_s32:
79 ; MIPS32: # %bb.0: # %entry
80 ; MIPS32-NEXT: lh $2, 0($4)
84 %0 = load i16, i16* %px
85 %conv = sext i16 %0 to i32
89 define i16 @load1_s8_to_sextLoad1_s16(i8* %px) {
90 ; MIPS32-LABEL: load1_s8_to_sextLoad1_s16:
91 ; MIPS32: # %bb.0: # %entry
92 ; MIPS32-NEXT: lb $2, 0($4)
97 %conv = sext i8 %0 to i16
101 define signext i16 @load1_s8_to_sextLoad1_s16_to_sextLoad1_s32(i8* %px) {
102 ; MIPS32-LABEL: load1_s8_to_sextLoad1_s16_to_sextLoad1_s32:
103 ; MIPS32: # %bb.0: # %entry
104 ; MIPS32-NEXT: lb $2, 0($4)
105 ; MIPS32-NEXT: jr $ra
108 %0 = load i8, i8* %px
109 %conv = sext i8 %0 to i16
113 define i64 @load4_s32_to_sextLoad4_s64(i32* %px) {
114 ; MIPS32-LABEL: load4_s32_to_sextLoad4_s64:
115 ; MIPS32: # %bb.0: # %entry
116 ; MIPS32-NEXT: lw $1, 0($4)
117 ; MIPS32-NEXT: ori $2, $zero, 31
118 ; MIPS32-NEXT: srav $3, $1, $2
119 ; MIPS32-NEXT: move $2, $1
120 ; MIPS32-NEXT: jr $ra
123 %0 = load i32, i32* %px
124 %conv = sext i32 %0 to i64