[llvm-commits] CVS: llvm/test/CodeGen/X86/mmx-arith.ll
Bill Wendling
isanbard at gmail.com
Thu Mar 8 14:15:10 PST 2007
Changes in directory llvm/test/CodeGen/X86:
mmx-arith.ll added (r1.1)
---
Log message:
Add MMX arithmetic testcase.
---
Diffs of the changes: (+35 -0)
mmx-arith.ll | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+)
Index: llvm/test/CodeGen/X86/mmx-arith.ll
diff -c /dev/null llvm/test/CodeGen/X86/mmx-arith.ll:1.1
*** /dev/null Thu Mar 8 16:15:01 2007
--- llvm/test/CodeGen/X86/mmx-arith.ll Thu Mar 8 16:14:51 2007
***************
*** 0 ****
--- 1,35 ----
+ ; RUN: llvm-as < %s | llc -march=x86 -mattr=+mmx
+
+ ;; A basic sanity check to make sure that MMX arithmetic actually compiles.
+
+ define void @foo(<2 x i32>* %A, <2 x i32>* %B) {
+ entry:
+ %tmp1 = load <2 x i32>* %A ; <<2 x i32>> [#uses=1]
+ %tmp3 = load <2 x i32>* %B ; <<2 x i32>> [#uses=1]
+ %tmp4 = add <2 x i32> %tmp1, %tmp3 ; <<2 x i32>> [#uses=1]
+ store <2 x i32> %tmp4, <2 x i32>* %A
+ tail call void @llvm.x86.mmx.emms( )
+ ret void
+ }
+
+ define void @bar(<4 x i16>* %A, <4 x i16>* %B) {
+ entry:
+ %tmp1 = load <4 x i16>* %A ; <<4 x i16>> [#uses=1]
+ %tmp3 = load <4 x i16>* %B ; <<4 x i16>> [#uses=1]
+ %tmp4 = add <4 x i16> %tmp1, %tmp3 ; <<4 x i16>> [#uses=1]
+ store <4 x i16> %tmp4, <4 x i16>* %A
+ tail call void @llvm.x86.mmx.emms( )
+ ret void
+ }
+
+ define void @baz(<8 x i8>* %A, <8 x i8>* %B) {
+ entry:
+ %tmp1 = load <8 x i8>* %A ; <<8 x i8>> [#uses=1]
+ %tmp3 = load <8 x i8>* %B ; <<8 x i8>> [#uses=1]
+ %tmp4 = add <8 x i8> %tmp1, %tmp3 ; <<8 x i8>> [#uses=1]
+ store <8 x i8> %tmp4, <8 x i8>* %A
+ tail call void @llvm.x86.mmx.emms( )
+ ret void
+ }
+
+ declare void @llvm.x86.mmx.emms()
More information about the llvm-commits
mailing list