2010-04-23 22:12:57 +00:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=+mmx,+sse2 | FileCheck %s
|
2010-09-30 23:57:10 +00:00
|
|
|
; There are no MMX operations here, so we use XMM or i64.
|
2010-04-23 22:12:57 +00:00
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti8
|
2010-04-23 22:12:57 +00:00
|
|
|
define void @ti8(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to <8 x i8>
|
|
|
|
%tmp2 = bitcast double %b to <8 x i8>
|
|
|
|
%tmp3 = add <8 x i8> %tmp1, %tmp2
|
2014-07-24 22:15:28 +00:00
|
|
|
; CHECK: paddb
|
2010-04-23 22:12:57 +00:00
|
|
|
store <8 x i8> %tmp3, <8 x i8>* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti16
|
2010-04-23 22:12:57 +00:00
|
|
|
define void @ti16(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to <4 x i16>
|
|
|
|
%tmp2 = bitcast double %b to <4 x i16>
|
|
|
|
%tmp3 = add <4 x i16> %tmp1, %tmp2
|
2014-07-24 22:15:28 +00:00
|
|
|
; CHECK: paddw
|
2010-04-23 22:12:57 +00:00
|
|
|
store <4 x i16> %tmp3, <4 x i16>* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti32
|
2010-04-23 22:12:57 +00:00
|
|
|
define void @ti32(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to <2 x i32>
|
|
|
|
%tmp2 = bitcast double %b to <2 x i32>
|
|
|
|
%tmp3 = add <2 x i32> %tmp1, %tmp2
|
2014-07-24 22:15:28 +00:00
|
|
|
; CHECK: paddd
|
2010-04-23 22:12:57 +00:00
|
|
|
store <2 x i32> %tmp3, <2 x i32>* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-04-05 20:20:30 +00:00
|
|
|
; CHECK: ti64
|
2010-04-23 22:12:57 +00:00
|
|
|
define void @ti64(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to <1 x i64>
|
|
|
|
%tmp2 = bitcast double %b to <1 x i64>
|
|
|
|
%tmp3 = add <1 x i64> %tmp1, %tmp2
|
2011-04-05 20:20:30 +00:00
|
|
|
; CHECK: addq
|
2010-04-23 22:12:57 +00:00
|
|
|
store <1 x i64> %tmp3, <1 x i64>* null
|
|
|
|
ret void
|
|
|
|
}
|
2010-09-30 23:57:10 +00:00
|
|
|
|
|
|
|
; MMX intrinsics calls get us MMX instructions.
|
2011-04-05 20:20:30 +00:00
|
|
|
; CHECK: ti8a
|
2010-09-30 23:57:10 +00:00
|
|
|
define void @ti8a(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp2 = bitcast double %b to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.b(x86_mmx %tmp1, x86_mmx %tmp2)
|
|
|
|
store x86_mmx %tmp3, x86_mmx* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti16a
|
2010-09-30 23:57:10 +00:00
|
|
|
define void @ti16a(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp2 = bitcast double %b to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.w(x86_mmx %tmp1, x86_mmx %tmp2)
|
|
|
|
store x86_mmx %tmp3, x86_mmx* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti32a
|
2010-09-30 23:57:10 +00:00
|
|
|
define void @ti32a(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp2 = bitcast double %b to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.d(x86_mmx %tmp1, x86_mmx %tmp2)
|
|
|
|
store x86_mmx %tmp3, x86_mmx* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-10-16 20:31:33 +00:00
|
|
|
; CHECK: ti64a
|
2010-09-30 23:57:10 +00:00
|
|
|
define void @ti64a(double %a, double %b) nounwind {
|
|
|
|
entry:
|
|
|
|
%tmp1 = bitcast double %a to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp2 = bitcast double %b to x86_mmx
|
|
|
|
; CHECK: movdq2q
|
|
|
|
%tmp3 = tail call x86_mmx @llvm.x86.mmx.padd.q(x86_mmx %tmp1, x86_mmx %tmp2)
|
|
|
|
store x86_mmx %tmp3, x86_mmx* null
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.b(x86_mmx, x86_mmx)
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.w(x86_mmx, x86_mmx)
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.d(x86_mmx, x86_mmx)
|
|
|
|
declare x86_mmx @llvm.x86.mmx.padd.q(x86_mmx, x86_mmx)
|