blob: cb65e9b50fe2fbf4ab021bc923574839a469678f [file] [log] [blame]
Dan Gohman0a063102009-09-08 23:54:48 +00001; RUN: llc < %s -relocation-model=static -mcpu=yonah | grep {andpd.*4(%esp), %xmm}
Chris Lattner1e3362f2008-01-26 19:45:50 +00002
3; The double argument is at 4(esp) which is 16-byte aligned, allowing us to
4; fold the load into the andpd.
5
6target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
7target triple = "i686-apple-darwin8"
8@G = external global double
9
10define void @test({ double, double }* byval %z, double* %P) {
11entry:
12 %tmp = getelementptr { double, double }* %z, i32 0, i32 0 ; <double*> [#uses=1]
13 %tmp1 = load double* %tmp, align 8 ; <double> [#uses=1]
14 %tmp2 = tail call double @fabs( double %tmp1 ) ; <double> [#uses=1]
15 %tmp3 = load double* @G, align 16 ; <double> [#uses=1]
16 %tmp4 = tail call double @fabs( double %tmp3 ) ; <double> [#uses=1]
Dan Gohman7ce405e2009-06-04 22:49:04 +000017 %tmp6 = fadd double %tmp4, %tmp2 ; <double> [#uses=1]
Chris Lattner1e3362f2008-01-26 19:45:50 +000018 store double %tmp6, double* %P, align 8
19 ret void
20}
21
22declare double @fabs(double)