summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/bswap-inline-asm.ll
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2010-11-13 19:54:30 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2010-11-13 19:54:30 +0000
commit948cf0289f8280f7e069603837d56c862515c6e1 (patch)
treef3490681cdb6b9ee3c28db0f7ab0b9cd74a48346 /test/CodeGen/X86/bswap-inline-asm.ll
parent983611836cd1edec8d1b8032e0539b6ed80461d6 (diff)
downloadllvm-948cf0289f8280f7e069603837d56c862515c6e1.tar.gz
llvm-948cf0289f8280f7e069603837d56c862515c6e1.tar.bz2
llvm-948cf0289f8280f7e069603837d56c862515c6e1.tar.xz
Recognise 32-bit ror-based bswap implementation used by uclibc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/bswap-inline-asm.ll')
-rw-r--r--test/CodeGen/X86/bswap-inline-asm.ll7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/CodeGen/X86/bswap-inline-asm.ll b/test/CodeGen/X86/bswap-inline-asm.ll
index 2b7019371a..ecb4cecf10 100644
--- a/test/CodeGen/X86/bswap-inline-asm.ll
+++ b/test/CodeGen/X86/bswap-inline-asm.ll
@@ -65,6 +65,13 @@ define i32 @t32(i32 %x) nounwind {
ret i32 %asmtmp
}
+; CHECK: u32:
+; CHECK: bswapl
+define i32 @u32(i32 %x) nounwind {
+ %asmtmp = tail call i32 asm "rorw $$8, ${0:w};rorl $$16, $0;rorw $$8, ${0:w}", "=r,0,~{cc},~{dirflag},~{flags},~{fpsr}"(i32 %x) nounwind
+ ret i32 %asmtmp
+}
+
; CHECK: s64:
; CHECK: bswapq
define i64 @s64(i64 %x) nounwind {