summaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips/bswap.ll
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-10-08 17:32:33 +0000
committerReed Kotler <rkotler@mips.com>2013-10-08 17:32:33 +0000
commitb359bda93d410623bbbc96dc9968d94447169a79 (patch)
tree45a3f3958c647f75dab897bc55e4a7f646cb4946 /test/CodeGen/Mips/bswap.ll
parenteb59e4d5ac15604643540b3aa1e5628d2d440dfc (diff)
downloadllvm-b359bda93d410623bbbc96dc9968d94447169a79.tar.gz
llvm-b359bda93d410623bbbc96dc9968d94447169a79.tar.bz2
llvm-b359bda93d410623bbbc96dc9968d94447169a79.tar.xz
Let rotr and bswap be handled by expansion for Mips16 since we don't
have native instructions for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips/bswap.ll')
-rw-r--r--test/CodeGen/Mips/bswap.ll3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/CodeGen/Mips/bswap.ll b/test/CodeGen/Mips/bswap.ll
index 0da2d2b7c2..f17b91aab8 100644
--- a/test/CodeGen/Mips/bswap.ll
+++ b/test/CodeGen/Mips/bswap.ll
@@ -1,11 +1,13 @@
; RUN: llc < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=MIPS32
; RUN: llc < %s -march=mips64el -mcpu=mips64r2 | FileCheck %s -check-prefix=MIPS64
+; RUN: llc < %s -mtriple=mipsel-linux-gnu -march=mipsel -mcpu=mips32r2 -mattr=+mips16 -soft-float -mips16-hard-float | FileCheck %s -check-prefix=mips16
define i32 @bswap32(i32 %x) nounwind readnone {
entry:
; MIPS32-LABEL: bswap32:
; MIPS32: wsbh $[[R0:[0-9]+]]
; MIPS32: rotr ${{[0-9]+}}, $[[R0]], 16
+; mips16: .ent bswap32
%or.3 = call i32 @llvm.bswap.i32(i32 %x)
ret i32 %or.3
}
@@ -15,6 +17,7 @@ entry:
; MIPS64-LABEL: bswap64:
; MIPS64: dsbh $[[R0:[0-9]+]]
; MIPS64: dshd ${{[0-9]+}}, $[[R0]]
+; mips16: .ent bswap64
%or.7 = call i64 @llvm.bswap.i64(i64 %x)
ret i64 %or.7
}