blob: 7a42c27d2b4aebbb4e4f1926baf4c34dcacf3988 [file] [log] [blame]
Tanya Lattnercfab3da2008-02-19 08:07:33 +00001; This should fold the "vcmpbfp." and "vcmpbfp" instructions into a single
Chris Lattner2a8fd4a2006-03-31 06:01:48 +00002; "vcmpbfp.".
Dan Gohmanfce288f2009-09-09 00:09:15 +00003; RUN: llc < %s -march=ppc32 -mcpu=g5 | grep vcmpbfp | count 1
Chris Lattner2a8fd4a2006-03-31 06:01:48 +00004
Tanya Lattnercfab3da2008-02-19 08:07:33 +00005
6define void @test(<4 x float>* %x, <4 x float>* %y, i32* %P) {
Chris Lattner2a8fd4a2006-03-31 06:01:48 +00007entry:
8 %tmp = load <4 x float>* %x ; <<4 x float>> [#uses=1]
9 %tmp2 = load <4 x float>* %y ; <<4 x float>> [#uses=1]
Tanya Lattnercfab3da2008-02-19 08:07:33 +000010 %tmp.upgrd.1 = call i32 @llvm.ppc.altivec.vcmpbfp.p( i32 1, <4 x float> %tmp, <4 x float> %tmp2 ) ; <i32> [#uses=1]
Chris Lattner2a8fd4a2006-03-31 06:01:48 +000011 %tmp4 = load <4 x float>* %x ; <<4 x float>> [#uses=1]
12 %tmp6 = load <4 x float>* %y ; <<4 x float>> [#uses=1]
Tanya Lattnercfab3da2008-02-19 08:07:33 +000013 %tmp.upgrd.2 = call <4 x i32> @llvm.ppc.altivec.vcmpbfp( <4 x float> %tmp4, <4 x float> %tmp6 ) ; <<4 x i32>> [#uses=1]
14 %tmp7 = bitcast <4 x i32> %tmp.upgrd.2 to <4 x float> ; <<4 x float>> [#uses=1]
Chris Lattner2a8fd4a2006-03-31 06:01:48 +000015 store <4 x float> %tmp7, <4 x float>* %x
Tanya Lattnercfab3da2008-02-19 08:07:33 +000016 store i32 %tmp.upgrd.1, i32* %P
Chris Lattner2a8fd4a2006-03-31 06:01:48 +000017 ret void
18}
19
Tanya Lattnercfab3da2008-02-19 08:07:33 +000020declare i32 @llvm.ppc.altivec.vcmpbfp.p(i32, <4 x float>, <4 x float>)
Chris Lattner2a8fd4a2006-03-31 06:01:48 +000021
Tanya Lattnercfab3da2008-02-19 08:07:33 +000022declare <4 x i32> @llvm.ppc.altivec.vcmpbfp(<4 x float>, <4 x float>)