1933de7aaSKristof Beyls; RUN: llc -verify-machineinstrs < %s -mtriple=armv4t | FileCheck %s -check-prefix=CHECK-v4A32 2933de7aaSKristof Beyls; RUN: llc -verify-machineinstrs < %s -mtriple=armv7a | FileCheck %s -check-prefix=CHECK-v7A32 3933de7aaSKristof Beyls; RUN: llc -verify-machineinstrs < %s -mtriple=thumbv7a | FileCheck %s -check-prefix=CHECK-THUMB2 4933de7aaSKristof Beyls; FIXME: There are no tests for Thumb1 since dynamic stack alignment is not supported for 5933de7aaSKristof Beyls; Thumb1. 6933de7aaSKristof Beyls 7933de7aaSKristof Beylsdefine i32 @f_bic_can_be_used_align() nounwind { 8933de7aaSKristof Beylsentry: 9933de7aaSKristof Beyls; CHECK-LABEL: f_bic_can_be_used_align: 10933de7aaSKristof Beyls; CHECK-v7A32: bfc sp, #0, #8 11933de7aaSKristof Beyls; CHECK-v4A32: bic sp, sp, #255 12933de7aaSKristof Beyls; CHECK-THUMB2: mov r4, sp 13933de7aaSKristof Beyls; CHECK-THUMB2-NEXT: bfc r4, #0, #8 14933de7aaSKristof Beyls; CHECK-THUMB2-NEXT: mov sp, r4 15933de7aaSKristof Beyls %x = alloca i32, align 256 16933de7aaSKristof Beyls store volatile i32 0, i32* %x, align 256 17933de7aaSKristof Beyls ret i32 0 18933de7aaSKristof Beyls} 19933de7aaSKristof Beyls 20933de7aaSKristof Beylsdefine i32 @f_too_large_for_bic_align() nounwind { 21933de7aaSKristof Beylsentry: 22933de7aaSKristof Beyls; CHECK-LABEL: f_too_large_for_bic_align: 23933de7aaSKristof Beyls; CHECK-v7A32: bfc sp, #0, #9 24933de7aaSKristof Beyls; CHECK-v4A32: lsr sp, sp, #9 25933de7aaSKristof Beyls; CHECK-v4A32: lsl sp, sp, #9 26933de7aaSKristof Beyls; CHECK-THUMB2: mov r4, sp 27933de7aaSKristof Beyls; CHECK-THUMB2-NEXT: bfc r4, #0, #9 28933de7aaSKristof Beyls; CHECK-THUMB2-NEXT: mov sp, r4 29933de7aaSKristof Beyls %x = alloca i32, align 512 30933de7aaSKristof Beyls store volatile i32 0, i32* %x, align 512 31933de7aaSKristof Beyls ret i32 0 32933de7aaSKristof Beyls} 33933de7aaSKristof Beyls 34933de7aaSKristof Beylsdefine i8* @f_alignedDPRCS2Spills(double* %d) #0 { 35933de7aaSKristof Beylsentry: 36933de7aaSKristof Beyls; CHECK-LABEL: f_too_large_for_bic_align: 37933de7aaSKristof Beyls; CHECK-v7A32: bfc sp, #0, #12 38933de7aaSKristof Beyls; CHECK-v4A32: lsr sp, sp, #12 39933de7aaSKristof Beyls; CHECK-v4A32: lsl sp, sp, #12 40933de7aaSKristof Beyls; CHECK-THUMB2: bfc r4, #0, #12 41933de7aaSKristof Beyls; CHECK-THUMB2-NEXT: mov sp, r4 42933de7aaSKristof Beyls %a = alloca i8, align 4096 43*a79ac14fSDavid Blaikie %0 = load double, double* %d, align 4 4479e6c749SDavid Blaikie %arrayidx1 = getelementptr inbounds double, double* %d, i32 1 45*a79ac14fSDavid Blaikie %1 = load double, double* %arrayidx1, align 4 4679e6c749SDavid Blaikie %arrayidx2 = getelementptr inbounds double, double* %d, i32 2 47*a79ac14fSDavid Blaikie %2 = load double, double* %arrayidx2, align 4 4879e6c749SDavid Blaikie %arrayidx3 = getelementptr inbounds double, double* %d, i32 3 49*a79ac14fSDavid Blaikie %3 = load double, double* %arrayidx3, align 4 5079e6c749SDavid Blaikie %arrayidx4 = getelementptr inbounds double, double* %d, i32 4 51*a79ac14fSDavid Blaikie %4 = load double, double* %arrayidx4, align 4 5279e6c749SDavid Blaikie %arrayidx5 = getelementptr inbounds double, double* %d, i32 5 53*a79ac14fSDavid Blaikie %5 = load double, double* %arrayidx5, align 4 5479e6c749SDavid Blaikie %arrayidx6 = getelementptr inbounds double, double* %d, i32 6 55*a79ac14fSDavid Blaikie %6 = load double, double* %arrayidx6, align 4 5679e6c749SDavid Blaikie %arrayidx7 = getelementptr inbounds double, double* %d, i32 7 57*a79ac14fSDavid Blaikie %7 = load double, double* %arrayidx7, align 4 5879e6c749SDavid Blaikie %arrayidx8 = getelementptr inbounds double, double* %d, i32 8 59*a79ac14fSDavid Blaikie %8 = load double, double* %arrayidx8, align 4 6079e6c749SDavid Blaikie %arrayidx9 = getelementptr inbounds double, double* %d, i32 9 61*a79ac14fSDavid Blaikie %9 = load double, double* %arrayidx9, align 4 6279e6c749SDavid Blaikie %arrayidx10 = getelementptr inbounds double, double* %d, i32 10 63*a79ac14fSDavid Blaikie %10 = load double, double* %arrayidx10, align 4 6479e6c749SDavid Blaikie %arrayidx11 = getelementptr inbounds double, double* %d, i32 11 65*a79ac14fSDavid Blaikie %11 = load double, double* %arrayidx11, align 4 6679e6c749SDavid Blaikie %arrayidx12 = getelementptr inbounds double, double* %d, i32 12 67*a79ac14fSDavid Blaikie %12 = load double, double* %arrayidx12, align 4 6879e6c749SDavid Blaikie %arrayidx13 = getelementptr inbounds double, double* %d, i32 13 69*a79ac14fSDavid Blaikie %13 = load double, double* %arrayidx13, align 4 7079e6c749SDavid Blaikie %arrayidx14 = getelementptr inbounds double, double* %d, i32 14 71*a79ac14fSDavid Blaikie %14 = load double, double* %arrayidx14, align 4 7279e6c749SDavid Blaikie %arrayidx15 = getelementptr inbounds double, double* %d, i32 15 73*a79ac14fSDavid Blaikie %15 = load double, double* %arrayidx15, align 4 7479e6c749SDavid Blaikie %arrayidx16 = getelementptr inbounds double, double* %d, i32 16 75*a79ac14fSDavid Blaikie %16 = load double, double* %arrayidx16, align 4 7679e6c749SDavid Blaikie %arrayidx17 = getelementptr inbounds double, double* %d, i32 17 77*a79ac14fSDavid Blaikie %17 = load double, double* %arrayidx17, align 4 7879e6c749SDavid Blaikie %arrayidx18 = getelementptr inbounds double, double* %d, i32 18 79*a79ac14fSDavid Blaikie %18 = load double, double* %arrayidx18, align 4 8079e6c749SDavid Blaikie %arrayidx19 = getelementptr inbounds double, double* %d, i32 19 81*a79ac14fSDavid Blaikie %19 = load double, double* %arrayidx19, align 4 8279e6c749SDavid Blaikie %arrayidx20 = getelementptr inbounds double, double* %d, i32 20 83*a79ac14fSDavid Blaikie %20 = load double, double* %arrayidx20, align 4 8479e6c749SDavid Blaikie %arrayidx21 = getelementptr inbounds double, double* %d, i32 21 85*a79ac14fSDavid Blaikie %21 = load double, double* %arrayidx21, align 4 8679e6c749SDavid Blaikie %arrayidx22 = getelementptr inbounds double, double* %d, i32 22 87*a79ac14fSDavid Blaikie %22 = load double, double* %arrayidx22, align 4 8879e6c749SDavid Blaikie %arrayidx23 = getelementptr inbounds double, double* %d, i32 23 89*a79ac14fSDavid Blaikie %23 = load double, double* %arrayidx23, align 4 9079e6c749SDavid Blaikie %arrayidx24 = getelementptr inbounds double, double* %d, i32 24 91*a79ac14fSDavid Blaikie %24 = load double, double* %arrayidx24, align 4 9279e6c749SDavid Blaikie %arrayidx25 = getelementptr inbounds double, double* %d, i32 25 93*a79ac14fSDavid Blaikie %25 = load double, double* %arrayidx25, align 4 9479e6c749SDavid Blaikie %arrayidx26 = getelementptr inbounds double, double* %d, i32 26 95*a79ac14fSDavid Blaikie %26 = load double, double* %arrayidx26, align 4 9679e6c749SDavid Blaikie %arrayidx27 = getelementptr inbounds double, double* %d, i32 27 97*a79ac14fSDavid Blaikie %27 = load double, double* %arrayidx27, align 4 9879e6c749SDavid Blaikie %arrayidx28 = getelementptr inbounds double, double* %d, i32 28 99*a79ac14fSDavid Blaikie %28 = load double, double* %arrayidx28, align 4 10079e6c749SDavid Blaikie %arrayidx29 = getelementptr inbounds double, double* %d, i32 29 101*a79ac14fSDavid Blaikie %29 = load double, double* %arrayidx29, align 4 102933de7aaSKristof Beyls %div = fdiv double %29, %28 103933de7aaSKristof Beyls %div30 = fdiv double %div, %27 104933de7aaSKristof Beyls %div31 = fdiv double %div30, %26 105933de7aaSKristof Beyls %div32 = fdiv double %div31, %25 106933de7aaSKristof Beyls %div33 = fdiv double %div32, %24 107933de7aaSKristof Beyls %div34 = fdiv double %div33, %23 108933de7aaSKristof Beyls %div35 = fdiv double %div34, %22 109933de7aaSKristof Beyls %div36 = fdiv double %div35, %21 110933de7aaSKristof Beyls %div37 = fdiv double %div36, %20 111933de7aaSKristof Beyls %div38 = fdiv double %div37, %19 112933de7aaSKristof Beyls %div39 = fdiv double %div38, %18 113933de7aaSKristof Beyls %div40 = fdiv double %div39, %17 114933de7aaSKristof Beyls %div41 = fdiv double %div40, %16 115933de7aaSKristof Beyls %div42 = fdiv double %div41, %15 116933de7aaSKristof Beyls %div43 = fdiv double %div42, %14 117933de7aaSKristof Beyls %div44 = fdiv double %div43, %13 118933de7aaSKristof Beyls %div45 = fdiv double %div44, %12 119933de7aaSKristof Beyls %div46 = fdiv double %div45, %11 120933de7aaSKristof Beyls %div47 = fdiv double %div46, %10 121933de7aaSKristof Beyls %div48 = fdiv double %div47, %9 122933de7aaSKristof Beyls %div49 = fdiv double %div48, %8 123933de7aaSKristof Beyls %div50 = fdiv double %div49, %7 124933de7aaSKristof Beyls %div51 = fdiv double %div50, %6 125933de7aaSKristof Beyls %div52 = fdiv double %div51, %5 126933de7aaSKristof Beyls %div53 = fdiv double %div52, %4 127933de7aaSKristof Beyls %div54 = fdiv double %div53, %3 128933de7aaSKristof Beyls %div55 = fdiv double %div54, %2 129933de7aaSKristof Beyls %div56 = fdiv double %div55, %1 130933de7aaSKristof Beyls %div57 = fdiv double %div56, %0 131933de7aaSKristof Beyls %div58 = fdiv double %0, %1 132933de7aaSKristof Beyls %div59 = fdiv double %div58, %2 133933de7aaSKristof Beyls %div60 = fdiv double %div59, %3 134933de7aaSKristof Beyls %div61 = fdiv double %div60, %4 135933de7aaSKristof Beyls %div62 = fdiv double %div61, %5 136933de7aaSKristof Beyls %div63 = fdiv double %div62, %6 137933de7aaSKristof Beyls %div64 = fdiv double %div63, %7 138933de7aaSKristof Beyls %div65 = fdiv double %div64, %8 139933de7aaSKristof Beyls %div66 = fdiv double %div65, %9 140933de7aaSKristof Beyls %div67 = fdiv double %div66, %10 141933de7aaSKristof Beyls %div68 = fdiv double %div67, %11 142933de7aaSKristof Beyls %div69 = fdiv double %div68, %12 143933de7aaSKristof Beyls %div70 = fdiv double %div69, %13 144933de7aaSKristof Beyls %div71 = fdiv double %div70, %14 145933de7aaSKristof Beyls %div72 = fdiv double %div71, %15 146933de7aaSKristof Beyls %div73 = fdiv double %div72, %16 147933de7aaSKristof Beyls %div74 = fdiv double %div73, %17 148933de7aaSKristof Beyls %div75 = fdiv double %div74, %18 149933de7aaSKristof Beyls %div76 = fdiv double %div75, %19 150933de7aaSKristof Beyls %div77 = fdiv double %div76, %20 151933de7aaSKristof Beyls %div78 = fdiv double %div77, %21 152933de7aaSKristof Beyls %div79 = fdiv double %div78, %22 153933de7aaSKristof Beyls %div80 = fdiv double %div79, %23 154933de7aaSKristof Beyls %div81 = fdiv double %div80, %24 155933de7aaSKristof Beyls %div82 = fdiv double %div81, %25 156933de7aaSKristof Beyls %div83 = fdiv double %div82, %26 157933de7aaSKristof Beyls %div84 = fdiv double %div83, %27 158933de7aaSKristof Beyls %div85 = fdiv double %div84, %28 159933de7aaSKristof Beyls %div86 = fdiv double %div85, %29 160933de7aaSKristof Beyls %mul = fmul double %div57, %div86 161933de7aaSKristof Beyls %conv = fptosi double %mul to i32 16279e6c749SDavid Blaikie %add.ptr = getelementptr inbounds i8, i8* %a, i32 %conv 163933de7aaSKristof Beyls ret i8* %add.ptr 164933de7aaSKristof Beyls} 165