aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/bswap-inline-asm.ll
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-17 02:17:27 +0000
committerDan Gohman <gohman@apple.com>2009-03-17 02:17:27 +0000
commitd73566609ea050ab73e0a3cda1c3840fd1a3d8fb (patch)
treedd025b94952e654edc92ecfa9180f8e5d22befcc /test/CodeGen/X86/bswap-inline-asm.ll
parentc39b80fdfc606f5df118288f4fc6b5e9c0b5ee41 (diff)
downloadexternal_llvm-d73566609ea050ab73e0a3cda1c3840fd1a3d8fb.zip
external_llvm-d73566609ea050ab73e0a3cda1c3840fd1a3d8fb.tar.gz
external_llvm-d73566609ea050ab73e0a3cda1c3840fd1a3d8fb.tar.bz2
Recognize "bswapq" as an alternate spelling for the bswap instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/bswap-inline-asm.ll')
-rw-r--r--test/CodeGen/X86/bswap-inline-asm.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/X86/bswap-inline-asm.ll b/test/CodeGen/X86/bswap-inline-asm.ll
new file mode 100644
index 0000000..c44d845
--- /dev/null
+++ b/test/CodeGen/X86/bswap-inline-asm.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | llc -march=x86-64 > %t
+; RUN: not grep APP %t
+; RUN: grep bswapq %t | count 2
+
+define i64 @foo(i64 %x) nounwind {
+ %asmtmp = tail call i64 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %x) nounwind
+ ret i64 %asmtmp
+}
+define i64 @bar(i64 %x) nounwind {
+ %asmtmp = tail call i64 asm "bswapq ${0:q}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 %x) nounwind
+ ret i64 %asmtmp
+}