1 ; RUN: llc < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=MIPS32
2 ; RUN: llc < %s -march=mips64el -mcpu=mips64r2 | FileCheck %s -check-prefix=MIPS64
3 ; RUN: llc < %s -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32r2 -mattr=+mips16 -soft-float -mips16-hard-float | FileCheck %s -check-prefix=mips16
5 define i32 @bswap32(i32 %x) nounwind readnone {
7 ; MIPS32-LABEL: bswap32:
8 ; MIPS32: wsbh $[[R0:[0-9]+]]
9 ; MIPS32: rotr ${{[0-9]+}}, $[[R0]], 16
10 ; mips16: .ent bswap32
11 %or.3 = call i32 @llvm.bswap.i32(i32 %x)
15 define i64 @bswap64(i64 %x) nounwind readnone {
17 ; MIPS64-LABEL: bswap64:
18 ; MIPS64: dsbh $[[R0:[0-9]+]]
19 ; MIPS64: dshd ${{[0-9]+}}, $[[R0]]
20 ; mips16: .ent bswap64
21 %or.7 = call i64 @llvm.bswap.i64(i64 %x)
25 declare i32 @llvm.bswap.i32(i32) nounwind readnone
27 declare i64 @llvm.bswap.i64(i64) nounwind readnone