80 lines · plain
1; Test that combined sin/cos library call is emitted when appropriate2 3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s --check-prefix=CHECK-OPT4; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s --check-prefix=CHECK-OPT5 6define float @f1(float %x) {7; CHECK-OPT-LABEL: f1:8; CHECK-OPT: brasl %r14, sincosf@PLT9; CHECK-OPT: le %f0, 164(%r15)10; CHECK-OPT: aeb %f0, 160(%r15)11 %tmp1 = call float @sinf(float %x) readnone12 %tmp2 = call float @cosf(float %x) readnone13 %add = fadd float %tmp1, %tmp214 ret float %add15}16 17define float @f1_errno(float %x) {18; CHECK-OPT-LABEL: f1_errno:19; CHECK-OPT: brasl %r14, sinf@PLT20; CHECK-OPT: ler %f9, %f021; CHECK-OPT: brasl %r14, cosf@PLT22; CHECK-OPT: aebr %f0, %f923 %tmp1 = call float @sinf(float %x)24 %tmp2 = call float @cosf(float %x)25 %add = fadd float %tmp1, %tmp226 ret float %add27}28 29define double @f2(double %x) {30; CHECK-OPT-LABEL: f2:31; CHECK-OPT: brasl %r14, sincos@PLT32; CHECK-OPT: ld %f0, 168(%r15)33; CHECK-OPT: adb %f0, 160(%r15)34 %tmp1 = call double @sin(double %x) readnone35 %tmp2 = call double @cos(double %x) readnone36 %add = fadd double %tmp1, %tmp237 ret double %add38}39 40define double @f2_errno(double %x) {41; CHECK-OPT-LABEL: f2_errno:42; CHECK-OPT: brasl %r14, sin@PLT43; CHECK-OPT: ldr %f9, %f044; CHECK-OPT: brasl %r14, cos@PLT45; CHECK-OPT: adbr %f0, %f946 %tmp1 = call double @sin(double %x)47 %tmp2 = call double @cos(double %x)48 %add = fadd double %tmp1, %tmp249 ret double %add50}51 52define fp128 @f3(fp128 %x) {53; CHECK-OPT-LABEL: f3:54; CHECK-OPT: brasl %r14, sincosl@PLT55; CHECK-OPT: axbr56 %tmp1 = call fp128 @sinl(fp128 %x) readnone57 %tmp2 = call fp128 @cosl(fp128 %x) readnone58 %add = fadd fp128 %tmp1, %tmp259 ret fp128 %add60}61 62define fp128 @f3_errno(fp128 %x) {63; CHECK-OPT-LABEL: f3_errno:64; CHECK-OPT: brasl %r14, sinl@PLT65; CHECK-OPT: brasl %r14, cosl@PLT66; CHECK-OPT: axbr67 %tmp1 = call fp128 @sinl(fp128 %x)68 %tmp2 = call fp128 @cosl(fp128 %x)69 %add = fadd fp128 %tmp1, %tmp270 ret fp128 %add71}72 73declare float @sinf(float)74declare double @sin(double)75declare fp128 @sinl(fp128)76declare float @cosf(float)77declare double @cos(double)78declare fp128 @cosl(fp128)79 80