1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=i686-apple-darwin8 -mcpu=yonah -march=x86 | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; These testcases shouldn't require loading into an XMM register then storing 4*9880d681SAndroid Build Coastguard Worker; to memory, then reloading into an FPStack reg. 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker; CHECK: test1 7*9880d681SAndroid Build Coastguard Worker; CHECK: fldl 8*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: ret 9*9880d681SAndroid Build Coastguard Workerdefine double @test1(double *%P) { 10*9880d681SAndroid Build Coastguard Worker %A = load double, double* %P 11*9880d681SAndroid Build Coastguard Worker ret double %A 12*9880d681SAndroid Build Coastguard Worker} 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker; fastcc should return a value 15*9880d681SAndroid Build Coastguard Worker; CHECK: test2 16*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: xmm 17*9880d681SAndroid Build Coastguard Worker; CHECK: ret 18*9880d681SAndroid Build Coastguard Workerdefine fastcc double @test2(<2 x double> %A) { 19*9880d681SAndroid Build Coastguard Worker %B = extractelement <2 x double> %A, i32 0 20*9880d681SAndroid Build Coastguard Worker ret double %B 21*9880d681SAndroid Build Coastguard Worker} 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Worker; CHECK: test3 24*9880d681SAndroid Build Coastguard Worker; CHECK: sub{{.*}}%esp 25*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: xmm 26*9880d681SAndroid Build Coastguard Workerdefine fastcc double @test3(<4 x float> %A) { 27*9880d681SAndroid Build Coastguard Worker %B = bitcast <4 x float> %A to <2 x double> 28*9880d681SAndroid Build Coastguard Worker %C = call fastcc double @test2(<2 x double> %B) 29*9880d681SAndroid Build Coastguard Worker ret double %C 30*9880d681SAndroid Build Coastguard Worker} 31*9880d681SAndroid Build Coastguard Worker 32*9880d681SAndroid Build Coastguard Worker; Clear the stack when not using a return value. 33*9880d681SAndroid Build Coastguard Worker; CHECK: test4 34*9880d681SAndroid Build Coastguard Worker; CHECK: call 35*9880d681SAndroid Build Coastguard Worker; CHECK: fstp 36*9880d681SAndroid Build Coastguard Worker; CHECK: ret 37*9880d681SAndroid Build Coastguard Workerdefine void @test4(double *%P) { 38*9880d681SAndroid Build Coastguard Worker %A = call double @test1(double *%P) 39*9880d681SAndroid Build Coastguard Worker ret void 40*9880d681SAndroid Build Coastguard Worker} 41