1 ; RUN: llc < %s -march=xcore | FileCheck %s 2 declare double @llvm.cos.f64(double) 3 declare double @llvm.exp.f64(double) 4 declare double @llvm.exp2.f64(double) 5 declare double @llvm.log.f64(double) 6 declare double @llvm.log10.f64(double) 7 declare double @llvm.log2.f64(double) 8 declare double @llvm.pow.f64(double, double) 9 declare double @llvm.powi.f64(double, i32) 10 declare double @llvm.sin.f64(double) 11 declare double @llvm.sqrt.f64(double) 12 13 define double @cos(double %F) { 14 ; CHECK-LABEL: cos: 15 ; CHECK: bl cos 16 %result = call double @llvm.cos.f64(double %F) 17 ret double %result 18 } 19 20 declare float @llvm.cos.f32(float) 21 22 ; CHECK-LABEL: cosf: 23 ; CHECK: bl cosf 24 define float @cosf(float %F) { 25 %result = call float @llvm.cos.f32(float %F) 26 ret float %result 27 } 28 29 define double @exp(double %F) { 30 ; CHECK-LABEL: exp: 31 ; CHECK: bl exp 32 %result = call double @llvm.exp.f64(double %F) 33 ret double %result 34 } 35 36 declare float @llvm.exp.f32(float) 37 38 define float @expf(float %F) { 39 ; CHECK-LABEL: expf: 40 ; CHECK: bl expf 41 %result = call float @llvm.exp.f32(float %F) 42 ret float %result 43 } 44 45 define double @exp2(double %F) { 46 ; CHECK-LABEL: exp2: 47 ; CHECK: bl exp2 48 %result = call double @llvm.exp2.f64(double %F) 49 ret double %result 50 } 51 52 declare float @llvm.exp2.f32(float) 53 54 define float @exp2f(float %F) { 55 ; CHECK-LABEL: exp2f: 56 ; CHECK: bl exp2f 57 %result = call float @llvm.exp2.f32(float %F) 58 ret float %result 59 } 60 61 define double @log(double %F) { 62 ; CHECK-LABEL: log: 63 ; CHECK: bl log 64 %result = call double @llvm.log.f64(double %F) 65 ret double %result 66 } 67 68 declare float @llvm.log.f32(float) 69 70 define float @logf(float %F) { 71 ; CHECK-LABEL: logf: 72 ; CHECK: bl logf 73 %result = call float @llvm.log.f32(float %F) 74 ret float %result 75 } 76 77 define double @log10(double %F) { 78 ; CHECK-LABEL: log10: 79 ; CHECK: bl log10 80 %result = call double @llvm.log10.f64(double %F) 81 ret double %result 82 } 83 84 declare float @llvm.log10.f32(float) 85 86 define float @log10f(float %F) { 87 ; CHECK-LABEL: log10f: 88 ; CHECK: bl log10f 89 %result = call float @llvm.log10.f32(float %F) 90 ret float %result 91 } 92 93 define double @log2(double %F) { 94 ; CHECK-LABEL: log2: 95 ; CHECK: bl log2 96 %result = call double @llvm.log2.f64(double %F) 97 ret double %result 98 } 99 100 declare float @llvm.log2.f32(float) 101 102 define float @log2f(float %F) { 103 ; CHECK-LABEL: log2f: 104 ; CHECK: bl log2f 105 %result = call float @llvm.log2.f32(float %F) 106 ret float %result 107 } 108 109 define double @pow(double %F, double %power) { 110 ; CHECK-LABEL: pow: 111 ; CHECK: bl pow 112 %result = call double @llvm.pow.f64(double %F, double %power) 113 ret double %result 114 } 115 116 declare float @llvm.pow.f32(float, float) 117 118 define float @powf(float %F, float %power) { 119 ; CHECK-LABEL: powf: 120 ; CHECK: bl powf 121 %result = call float @llvm.pow.f32(float %F, float %power) 122 ret float %result 123 } 124 125 define double @powi(double %F, i32 %power) { 126 ; CHECK-LABEL: powi: 127 ; CHECK: bl __powidf2 128 %result = call double @llvm.powi.f64(double %F, i32 %power) 129 ret double %result 130 } 131 132 declare float @llvm.powi.f32(float, i32) 133 134 define float @powif(float %F, i32 %power) { 135 ; CHECK-LABEL: powif: 136 ; CHECK: bl __powisf2 137 %result = call float @llvm.powi.f32(float %F, i32 %power) 138 ret float %result 139 } 140 141 define double @sin(double %F) { 142 ; CHECK-LABEL: sin: 143 ; CHECK: bl sin 144 %result = call double @llvm.sin.f64(double %F) 145 ret double %result 146 } 147 148 declare float @llvm.sin.f32(float) 149 150 define float @sinf(float %F) { 151 ; CHECK-LABEL: sinf: 152 ; CHECK: bl sinf 153 %result = call float @llvm.sin.f32(float %F) 154 ret float %result 155 } 156 157 define double @sqrt(double %F) { 158 ; CHECK-LABEL: sqrt: 159 ; CHECK: bl sqrt 160 %result = call double @llvm.sqrt.f64(double %F) 161 ret double %result 162 } 163 164 declare float @llvm.sqrt.f32(float) 165 166 define float @sqrtf(float %F) { 167 ; CHECK-LABEL: sqrtf: 168 ; CHECK: bl sqrtf 169 %result = call float @llvm.sqrt.f32(float %F) 170 ret float %result 171 } 172