[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/bswap.ll

Nate Begeman natebegeman at mac.com
Fri Jan 13 19:14:27 PST 2006



Changes in directory llvm/test/Regression/CodeGen/X86:

bswap.ll added (r1.1)
---
Log message:

bswap implementation


---
Diffs of the changes:  (+23 -0)

 bswap.ll |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+)


Index: llvm/test/Regression/CodeGen/X86/bswap.ll
diff -c /dev/null llvm/test/Regression/CodeGen/X86/bswap.ll:1.1
*** /dev/null	Fri Jan 13 21:14:20 2006
--- llvm/test/Regression/CodeGen/X86/bswap.ll	Fri Jan 13 21:14:10 2006
***************
*** 0 ****
--- 1,23 ----
+ ; bswap should be constant folded when it is passed a constant argument
+ 
+ ; RUN: llvm-as < %s | llc -march=x86 -enable-x86-dag-isel | grep bswapl | wc -l | grep 3 &&
+ ; RUN: llvm-as < %s | llc -march=x86 -enable-x86-dag-isel | grep rolw | wc -l | grep 1
+ 
+ declare ushort %llvm.bswap.i16(ushort)
+ declare uint %llvm.bswap.i32(uint)
+ declare ulong %llvm.bswap.i64(ulong)
+ 
+ ushort %W(ushort %A) {
+ 	%Z = call ushort %llvm.bswap.i16(ushort %A)
+ 	ret ushort %Z
+ }
+ 
+ uint %X(uint %A) {
+ 	%Z = call uint %llvm.bswap.i32(uint %A)
+ 	ret uint %Z
+ }
+ 
+ ulong %Y(ulong %A) {
+ 	%Z = call ulong %llvm.bswap.i64(ulong %A)
+ 	ret ulong %Z
+ }






More information about the llvm-commits mailing list