85 lines · plain
1; RUN: llc < %s -mtriple=mipsel-unknown-linux-gnu | FileCheck %s --check-prefixes=MIPS322; RUN: llc < %s -mtriple=mips64el-unknown-linux-gnuabi64 | FileCheck %s --check-prefixes=MIPS643; RUN: llc < %s -mtriple=mips64el-unknown-linux-gnuabi64 | FileCheck %s --check-prefixes=MIPS644 5define i32 @shl_32(i32 %a, i32 %b) {6; MIPS32-LABLE: shl_32:7; MIPS32: # %bb.0:8; MIPS32-NEXT: jr $ra9; MIPS32-NEXT: sllv $2, $4, $510; MIPS64-LABLE: shl_32:11; MIPS64: # %bb.0:12; MIPS64-NEXT: sll $1, $5, 013; MIPS64-NEXT: sll $2, $4, 014; MIPS64-NEXT: jr $ra15; MIPS64-NEXT: sllv $2, $2, $116 %_1 = and i32 %b, 3117 %_0 = shl i32 %a, %_118 ret i32 %_019}20 21define i32 @lshr_32(i32 %a, i32 %b) {22; MIPS32-LABLE: lshr_32:23; MIPS32: # %bb.0:24; MIPS32-NEXT: jr $ra25; MIPS32-NEXT: srlv $2, $4, $526; MIPS64-LABLE: lshr_32:27; MIPS64: # %bb.0:28; MIPS64-NEXT: sll $1, $5, 029; MIPS64-NEXT: sll $2, $4, 030; MIPS64-NEXT: jr $ra31; MIPS64-NEXT: srlv $2, $2, $132 %_1 = and i32 %b, 3133 %_0 = lshr i32 %a, %_134 ret i32 %_035}36 37define i32 @ashr_32(i32 %a, i32 %b) {38; MIPS32-LABLE: ashr_32:39; MIPS32: # %bb.0:40; MIPS32-NEXT: jr $ra41; MIPS32-NEXT: srav $2, $4, $542; MIPS64-LABLE: ashr_32:43; MIPS64: # %bb.0:44; MIPS64-NEXT: sll $1, $5, 045; MIPS64-NEXT: sll $2, $4, 046; MIPS64-NEXT: jr $ra47; MIPS64-NEXT: srav $2, $2, $148 %_1 = and i32 %b, 3149 %_0 = ashr i32 %a, %_150 ret i32 %_051}52 53define i64 @shl_64(i64 %a, i64 %b) {54; MIPS64-LABLE: shl_64:55; MIPS64: # %bb.0:56; MIPS64-NEXT: sll $1, $5, 057; MIPS64-NEXT: jr $ra58; MIPS64-NEXT: dsllv $2, $4, $159 %_1 = and i64 %b, 6360 %_0 = shl i64 %a, %_161 ret i64 %_062}63 64define i64 @lshr_64(i64 %a, i64 %b) {65; MIPS64-LABLE: lshr_64:66; MIPS64: # %bb.0:67; MIPS64-NEXT: sll $1, $5, 068; MIPS64-NEXT: jr $ra69; MIPS64-NEXT: dsrlv $2, $4, $170 %_1 = and i64 %b, 6371 %_0 = lshr i64 %a, %_172 ret i64 %_073}74 75define i64 @ashr_64(i64 %a, i64 %b) {76; MIPS64-LABLE: ashr_64:77; MIPS64: # %bb.0:78; MIPS64-NEXT: sll $1, $5, 079; MIPS64-NEXT: jr $ra80; MIPS64-NEXT: dsrav $2, $4, $181 %_1 = and i64 %b, 6382 %_0 = ashr i64 %a, %_183 ret i64 %_084}85