93 lines · plain
1; RUN: sed -e "s/RETTYPE/void/;s/RETVAL//" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s2; RUN: sed -e "s/RETTYPE/i32/;s/RETVAL/undef/" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s3; RUN: sed -e "s/RETTYPE/\{i64\,i64\}/;s/RETVAL/undef/" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL %s4; RUN: sed -e "s/RETTYPE/double/;s/RETVAL/0./" %s | llc -mtriple=aarch64-apple-darwin | FileCheck --check-prefixes=ALL,DOUBLE %s5 6; We don't need to save registers before using them inside preserve_none function.7define preserve_nonecc RETTYPE @preserve_nonecc1(i64, i64, double, double) nounwind {8entry:9;ALL-LABEL: preserve_nonecc110;ALL: ; %bb.0:11;ALL-NEXT: InlineAsm Start12;ALL-NEXT: InlineAsm End13;DOUBLE-NEXT: movi d0, #000000000000000014;ALL-NEXT: ret15 call void asm sideeffect "", "~{x0},~{x1},~{x2},~{x3},~{x4},~{x5},~{x6},~{x7},~{x8},~{x9},~{x10},~{x11},~{x12},~{x13},~{x14},~{x15},~{x16},~{x17},~{x19},~{x20},~{x21},~{x22},~{x23},~{x24},~{x25},~{x26},~{x27},~{x28},~{d0},~{d1},~{d2},~{d3},~{d4},~{d5},~{d6},~{d7},~{d8},~{d9},~{d10},~{d11},~{d12},~{d13},~{d14},~{d15},~{d16}"()16 ret RETTYPE RETVAL17}18 19; When calling a preserve_none function, all live registers must be saved and20; restored around the function call.21declare preserve_nonecc RETTYPE @preserve_nonecc2(i64, i64, double, double)22define void @bar() nounwind {23entry:24;ALL-LABEL: bar25;ALL: InlineAsm Start26;ALL: stp x9, x827;ALL: stp x11, x1028;ALL: stp x13, x1229;ALL: stp x15, x1430;ALL: stp x17, x1631;ALL: stp x20, x1932;ALL: stp x22, x2133;ALL: stp x24, x2334;ALL: stp x26, x2535;ALL: stp x28, x2736;ALL: stp d8, d737;ALL: stp d10, d938;ALL: stp d12, d1139;ALL: stp d14, d1340;ALL: stp d16, d1541;ALL: ldp x20, x1942;ALL: ldp x22, x2143;ALL: ldp x24, x2344;ALL: ldp x26, x2545;ALL: ldp x28, x2746;ALL: ldp d8, d747;ALL: ldp d10, d948;ALL: ldp d12, d1149;ALL: ldp d14, d1350;ALL: ldp d16, d1551;ALL: ldp x9, x852;ALL: ldp x11, x1053;ALL: ldp x13, x1254;ALL: ldp x15, x1455;ALL: ldp x17, x1656;ALL: InlineAsm Start57 %a0 = call i64 asm sideeffect "", "={x8}"() nounwind58 %a1 = call i64 asm sideeffect "", "={x9}"() nounwind59 %a2 = call i64 asm sideeffect "", "={x10}"() nounwind60 %a3 = call i64 asm sideeffect "", "={x11}"() nounwind61 %a4 = call i64 asm sideeffect "", "={x12}"() nounwind62 %a5 = call i64 asm sideeffect "", "={x13}"() nounwind63 %a6 = call i64 asm sideeffect "", "={x14}"() nounwind64 %a7 = call i64 asm sideeffect "", "={x15}"() nounwind65 %a8 = call i64 asm sideeffect "", "={x16}"() nounwind66 %a9 = call i64 asm sideeffect "", "={x17}"() nounwind67 %a10 = call i64 asm sideeffect "", "={x19}"() nounwind68 %a11 = call i64 asm sideeffect "", "={x20}"() nounwind69 %a12 = call i64 asm sideeffect "", "={x21}"() nounwind70 %a13 = call i64 asm sideeffect "", "={x22}"() nounwind71 %a14 = call i64 asm sideeffect "", "={x23}"() nounwind72 %a15 = call i64 asm sideeffect "", "={x24}"() nounwind73 %a16 = call i64 asm sideeffect "", "={x25}"() nounwind74 %a17 = call i64 asm sideeffect "", "={x26}"() nounwind75 %a18 = call i64 asm sideeffect "", "={x27}"() nounwind76 %a19 = call i64 asm sideeffect "", "={x28}"() nounwind77 78 %f0 = call <1 x double> asm sideeffect "", "={d7}"() nounwind79 %f1 = call <1 x double> asm sideeffect "", "={d8}"() nounwind80 %f2 = call <1 x double> asm sideeffect "", "={d9}"() nounwind81 %f3 = call <1 x double> asm sideeffect "", "={d10}"() nounwind82 %f4 = call <1 x double> asm sideeffect "", "={d11}"() nounwind83 %f5 = call <1 x double> asm sideeffect "", "={d12}"() nounwind84 %f6 = call <1 x double> asm sideeffect "", "={d13}"() nounwind85 %f7 = call <1 x double> asm sideeffect "", "={d14}"() nounwind86 %f8 = call <1 x double> asm sideeffect "", "={d15}"() nounwind87 %f9 = call <1 x double> asm sideeffect "", "={d16}"() nounwind88 89 call preserve_nonecc RETTYPE @preserve_nonecc2(i64 1, i64 2, double 3.0, double 4.0)90 call void asm sideeffect "", "{x8},{x9},{x10},{x11},{x12},{x13},{x14},{x15},{x16},{x17},{x19},{x20},{x21},{x22},{x23},{x24},{x25},{x26},{x27},{x28},{d7},{d8},{d9},{d10},{d11},{d12},{d13},{d14},{d15},{d16}"(i64 %a0, i64 %a1, i64 %a2, i64 %a3, i64 %a4, i64 %a5, i64 %a6, i64 %a7, i64 %a8, i64 %a9, i64 %a10, i64 %a11, i64 %a12, i64 %a13, i64 %a14, i64 %a15, i64 %a16, i64 %a17, i64 %a18, i64 %a19, <1 x double> %f0, <1 x double> %f1, <1 x double> %f2, <1 x double> %f3, <1 x double> %f4, <1 x double> %f5, <1 x double> %f6, <1 x double> %f7, <1 x double> %f8, <1 x double> %f9)91 ret void92}93