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 @sub_i32(i32 %x, i32 %y) {
5 ; MIPS32-LABEL: sub_i32:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: subu $2, $4, $5
15 define signext i8 @sub_i8_sext(i8 signext %a, i8 signext %b) {
16 ; MIPS32-LABEL: sub_i8_sext:
17 ; MIPS32: # %bb.0: # %entry
18 ; MIPS32-NEXT: subu $1, $5, $4
19 ; MIPS32-NEXT: sll $1, $1, 24
20 ; MIPS32-NEXT: sra $2, $1, 24
28 define zeroext i8 @sub_i8_zext(i8 zeroext %a, i8 zeroext %b) {
29 ; MIPS32-LABEL: sub_i8_zext:
30 ; MIPS32: # %bb.0: # %entry
31 ; MIPS32-NEXT: subu $1, $5, $4
32 ; MIPS32-NEXT: andi $2, $1, 255
40 define i8 @sub_i8_aext(i8 %a, i8 %b) {
41 ; MIPS32-LABEL: sub_i8_aext:
42 ; MIPS32: # %bb.0: # %entry
43 ; MIPS32-NEXT: subu $2, $5, $4
51 define signext i16 @sub_i16_sext(i16 signext %a, i16 signext %b) {
52 ; MIPS32-LABEL: sub_i16_sext:
53 ; MIPS32: # %bb.0: # %entry
54 ; MIPS32-NEXT: subu $1, $5, $4
55 ; MIPS32-NEXT: sll $1, $1, 16
56 ; MIPS32-NEXT: sra $2, $1, 16
64 define zeroext i16 @sub_i16_zext(i16 zeroext %a, i16 zeroext %b) {
65 ; MIPS32-LABEL: sub_i16_zext:
66 ; MIPS32: # %bb.0: # %entry
67 ; MIPS32-NEXT: subu $1, $5, $4
68 ; MIPS32-NEXT: andi $2, $1, 65535
76 define i16 @sub_i16_aext(i16 %a, i16 %b) {
77 ; MIPS32-LABEL: sub_i16_aext:
78 ; MIPS32: # %bb.0: # %entry
79 ; MIPS32-NEXT: subu $2, $5, $4
87 define i64 @sub_i64(i64 %a, i64 %b) {
88 ; MIPS32-LABEL: sub_i64:
89 ; MIPS32: # %bb.0: # %entry
90 ; MIPS32-NEXT: subu $2, $6, $4
91 ; MIPS32-NEXT: sltu $3, $6, $4
92 ; MIPS32-NEXT: subu $1, $7, $5
93 ; MIPS32-NEXT: andi $3, $3, 1
94 ; MIPS32-NEXT: subu $3, $1, $3
102 define i128 @sub_i128(i128 %a, i128 %b) {
103 ; MIPS32-LABEL: sub_i128:
104 ; MIPS32: # %bb.0: # %entry
105 ; MIPS32-NEXT: move $9, $4
106 ; MIPS32-NEXT: addiu $1, $sp, 16
107 ; MIPS32-NEXT: lw $8, 0($1)
108 ; MIPS32-NEXT: addiu $1, $sp, 20
109 ; MIPS32-NEXT: lw $3, 0($1)
110 ; MIPS32-NEXT: addiu $1, $sp, 24
111 ; MIPS32-NEXT: lw $4, 0($1)
112 ; MIPS32-NEXT: addiu $1, $sp, 28
113 ; MIPS32-NEXT: lw $1, 0($1)
114 ; MIPS32-NEXT: subu $2, $8, $9
115 ; MIPS32-NEXT: sltu $9, $8, $9
116 ; MIPS32-NEXT: subu $8, $3, $5
117 ; MIPS32-NEXT: sltu $5, $3, $8
118 ; MIPS32-NEXT: andi $3, $9, 1
119 ; MIPS32-NEXT: subu $3, $8, $3
120 ; MIPS32-NEXT: sltiu $8, $8, 1
121 ; MIPS32-NEXT: and $8, $8, $9
122 ; MIPS32-NEXT: or $8, $5, $8
123 ; MIPS32-NEXT: subu $6, $4, $6
124 ; MIPS32-NEXT: sltu $5, $4, $6
125 ; MIPS32-NEXT: andi $4, $8, 1
126 ; MIPS32-NEXT: subu $4, $6, $4
127 ; MIPS32-NEXT: sltiu $6, $6, 1
128 ; MIPS32-NEXT: and $6, $6, $8
129 ; MIPS32-NEXT: or $5, $5, $6
130 ; MIPS32-NEXT: subu $1, $1, $7
131 ; MIPS32-NEXT: andi $5, $5, 1
132 ; MIPS32-NEXT: subu $5, $1, $5
133 ; MIPS32-NEXT: jr $ra
136 %sub = sub i128 %b, %a