brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.5 KiB · 5b6cab6 Raw
257 lines · plain
1; RUN: llc < %s -mtriple=ve | FileCheck %s2 3;;; Test ‘llvm.pow.*’ intrinsic4;;;5;;; Syntax:6;;;   This is an overloaded intrinsic. You can use llvm.pow on any7;;;   floating-point or vector of floating-point type. Not all targets8;;;   support all types however.9;;;10;;; declare float     @llvm.pow.f32(float  %Val, float %Power)11;;; declare double    @llvm.pow.f64(double %Val, double %Power)12;;; declare x86_fp80  @llvm.pow.f80(x86_fp80  %Val, x86_fp80 %Power)13;;; declare fp128     @llvm.pow.f128(fp128 %Val, fp128 %Power)14;;; declare ppc_fp128 @llvm.pow.ppcf128(ppc_fp128  %Val, ppc_fp128 Power)15;;;16;;; Overview:17;;;   The ‘llvm.pow.*’ intrinsics return the first operand raised to18;;;   the specified (positive or negative) power.19;;;20;;; Arguments:21;;;   The arguments and return value are floating-point numbers of22;;;   the same type.23;;;24;;; Note:25;;;   We test only float/double/fp128.26 27; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn28define float @func_fp_pow_var_float(float noundef %0, float noundef %1) {29; CHECK-LABEL: func_fp_pow_var_float:30; CHECK:       .LBB{{[0-9]+}}_2:31; CHECK-NEXT:    lea %s2, powf@lo32; CHECK-NEXT:    and %s2, %s2, (32)033; CHECK-NEXT:    lea.sl %s12, powf@hi(, %s2)34; CHECK-NEXT:    bsic %s10, (, %s12)35; CHECK-NEXT:    or %s11, 0, %s936  %3 = tail call fast float @llvm.pow.f32(float %0, float %1)37  ret float %338}39 40; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone speculatable willreturn41declare float @llvm.pow.f32(float, float)42 43; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn44define double @func_fp_pow_var_double(double noundef %0, double noundef %1) {45; CHECK-LABEL: func_fp_pow_var_double:46; CHECK:       .LBB{{[0-9]+}}_2:47; CHECK-NEXT:    lea %s2, pow@lo48; CHECK-NEXT:    and %s2, %s2, (32)049; CHECK-NEXT:    lea.sl %s12, pow@hi(, %s2)50; CHECK-NEXT:    bsic %s10, (, %s12)51; CHECK-NEXT:    or %s11, 0, %s952  %3 = tail call fast double @llvm.pow.f64(double %0, double %1)53  ret double %354}55 56; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone speculatable willreturn57declare double @llvm.pow.f64(double, double)58 59; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn60define fp128 @func_fp_pow_var_quad(fp128 noundef %0, fp128 noundef %1) {61; CHECK-LABEL: func_fp_pow_var_quad:62; CHECK:       .LBB{{[0-9]+}}_2:63; CHECK-NEXT:    lea %s4, powl@lo64; CHECK-NEXT:    and %s4, %s4, (32)065; CHECK-NEXT:    lea.sl %s12, powl@hi(, %s4)66; CHECK-NEXT:    bsic %s10, (, %s12)67; CHECK-NEXT:    or %s11, 0, %s968  %3 = tail call fast fp128 @llvm.pow.f128(fp128 %0, fp128 %1)69  ret fp128 %370}71 72; Function Attrs: mustprogress nocallback nofree nosync nounwind readnone speculatable willreturn73declare fp128 @llvm.pow.f128(fp128, fp128)74 75; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn76define float @func_fp_pow_zero_back_float(float noundef %0) {77; CHECK-LABEL: func_fp_pow_zero_back_float:78; CHECK:       # %bb.0:79; CHECK-NEXT:    lea.sl %s0, 106535321680; CHECK-NEXT:    b.l.t (, %s10)81  ret float 1.000000e+0082}83 84; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn85define double @func_fp_pow_zero_back_double(double noundef %0) {86; CHECK-LABEL: func_fp_pow_zero_back_double:87; CHECK:       # %bb.0:88; CHECK-NEXT:    lea.sl %s0, 107269324889; CHECK-NEXT:    b.l.t (, %s10)90  ret double 1.000000e+0091}92 93; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn94define fp128 @func_fp_pow_zero_back_quad(fp128 noundef %0) {95; CHECK-LABEL: func_fp_pow_zero_back_quad:96; CHECK:       # %bb.0:97; CHECK-NEXT:    lea %s0, .LCPI{{[0-9]+}}_0@lo98; CHECK-NEXT:    and %s0, %s0, (32)099; CHECK-NEXT:    lea.sl %s2, .LCPI{{[0-9]+}}_0@hi(, %s0)100; CHECK-NEXT:    ld %s0, 8(, %s2)101; CHECK-NEXT:    ld %s1, (, %s2)102; CHECK-NEXT:    b.l.t (, %s10)103  ret fp128 0xL00000000000000003FFF000000000000104}105 106; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn107define float @func_fp_pow_zero_fore_float(float noundef %0) {108; CHECK-LABEL: func_fp_pow_zero_fore_float:109; CHECK:       .LBB{{[0-9]+}}_2:110; CHECK-NEXT:    or %s1, 0, %s0111; CHECK-NEXT:    lea %s0, powf@lo112; CHECK-NEXT:    and %s0, %s0, (32)0113; CHECK-NEXT:    lea.sl %s12, powf@hi(, %s0)114; CHECK-NEXT:    lea.sl %s0, 0115; CHECK-NEXT:    bsic %s10, (, %s12)116; CHECK-NEXT:    or %s11, 0, %s9117  %2 = tail call fast float @llvm.pow.f32(float 0.000000e+00, float %0)118  ret float %2119}120 121; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn122define double @func_fp_pow_zero_fore_double(double noundef %0) {123; CHECK-LABEL: func_fp_pow_zero_fore_double:124; CHECK:       .LBB{{[0-9]+}}_2:125; CHECK-NEXT:    or %s1, 0, %s0126; CHECK-NEXT:    lea %s0, pow@lo127; CHECK-NEXT:    and %s0, %s0, (32)0128; CHECK-NEXT:    lea.sl %s12, pow@hi(, %s0)129; CHECK-NEXT:    lea.sl %s0, 0130; CHECK-NEXT:    bsic %s10, (, %s12)131; CHECK-NEXT:    or %s11, 0, %s9132  %2 = tail call fast double @llvm.pow.f64(double 0.000000e+00, double %0)133  ret double %2134}135 136; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn137define fp128 @func_fp_pow_zero_fore_quad(fp128 noundef %0) {138; CHECK-LABEL: func_fp_pow_zero_fore_quad:139; CHECK:       .LBB{{[0-9]+}}_2:140; CHECK-NEXT:    or %s2, 0, %s0141; CHECK-NEXT:    or %s3, 0, %s1142; CHECK-NEXT:    lea %s0, .LCPI{{[0-9]+}}_0@lo143; CHECK-NEXT:    and %s0, %s0, (32)0144; CHECK-NEXT:    lea.sl %s4, .LCPI{{[0-9]+}}_0@hi(, %s0)145; CHECK-NEXT:    ld %s0, 8(, %s4)146; CHECK-NEXT:    ld %s1, (, %s4)147; CHECK-NEXT:    lea %s4, powl@lo148; CHECK-NEXT:    and %s4, %s4, (32)0149; CHECK-NEXT:    lea.sl %s12, powl@hi(, %s4)150; CHECK-NEXT:    bsic %s10, (, %s12)151; CHECK-NEXT:    or %s11, 0, %s9152  %2 = tail call fast fp128 @llvm.pow.f128(fp128 0xL00000000000000000000000000000000, fp128 %0)153  ret fp128 %2154}155 156; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn157define float @func_fp_pow_const_back_float(float noundef %0) {158; CHECK-LABEL: func_fp_pow_const_back_float:159; CHECK:       # %bb.0:160; CHECK-NEXT:    fmul.s %s0, %s0, %s0161; CHECK-NEXT:    lea.sl %s1, 1065353216162; CHECK-NEXT:    fdiv.s %s0, %s1, %s0163; CHECK-NEXT:    b.l.t (, %s10)164  %2 = tail call fast float @llvm.powi.f32.i32(float %0, i32 -2)165  ret float %2166}167 168; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn169define double @func_fp_pow_const_back_double(double noundef %0) {170; CHECK-LABEL: func_fp_pow_const_back_double:171; CHECK:       # %bb.0:172; CHECK-NEXT:    fmul.d %s0, %s0, %s0173; CHECK-NEXT:    lea.sl %s1, 1072693248174; CHECK-NEXT:    fdiv.d %s0, %s1, %s0175; CHECK-NEXT:    b.l.t (, %s10)176  %2 = tail call fast double @llvm.powi.f64.i32(double %0, i32 -2)177  ret double %2178}179 180; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn181define fp128 @func_fp_pow_const_back_quad(fp128 noundef %0) {182; CHECK-LABEL: func_fp_pow_const_back_quad:183; CHECK:       .LBB{{[0-9]+}}_2:184; CHECK-NEXT:    fmul.q %s2, %s0, %s0185; CHECK-NEXT:    lea %s0, .LCPI{{[0-9]+}}_0@lo186; CHECK-NEXT:    and %s0, %s0, (32)0187; CHECK-NEXT:    lea.sl %s4, .LCPI{{[0-9]+}}_0@hi(, %s0)188; CHECK-NEXT:    ld %s0, 8(, %s4)189; CHECK-NEXT:    ld %s1, (, %s4)190; CHECK-NEXT:    lea %s4, __divtf3@lo191; CHECK-NEXT:    and %s4, %s4, (32)0192; CHECK-NEXT:    lea.sl %s12, __divtf3@hi(, %s4)193; CHECK-NEXT:    bsic %s10, (, %s12)194; CHECK-NEXT:    or %s11, 0, %s9195  %2 = tail call fast fp128 @llvm.powi.f128.i32(fp128 %0, i32 -2)196  ret fp128 %2197}198 199; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn200define float @func_fp_pow_const_fore_float(float noundef %0) {201; CHECK-LABEL: func_fp_pow_const_fore_float:202; CHECK:       .LBB{{[0-9]+}}_2:203; CHECK-NEXT:    or %s1, 0, %s0204; CHECK-NEXT:    lea %s0, powf@lo205; CHECK-NEXT:    and %s0, %s0, (32)0206; CHECK-NEXT:    lea.sl %s12, powf@hi(, %s0)207; CHECK-NEXT:    lea.sl %s0, -1073741824208; CHECK-NEXT:    bsic %s10, (, %s12)209; CHECK-NEXT:    or %s11, 0, %s9210  %2 = tail call fast float @llvm.pow.f32(float -2.000000e+00, float %0)211  ret float %2212}213 214; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn215define double @func_fp_pow_const_fore_double(double noundef %0) {216; CHECK-LABEL: func_fp_pow_const_fore_double:217; CHECK:       .LBB{{[0-9]+}}_2:218; CHECK-NEXT:    or %s1, 0, %s0219; CHECK-NEXT:    lea %s0, pow@lo220; CHECK-NEXT:    and %s0, %s0, (32)0221; CHECK-NEXT:    lea.sl %s12, pow@hi(, %s0)222; CHECK-NEXT:    lea.sl %s0, -1073741824223; CHECK-NEXT:    bsic %s10, (, %s12)224; CHECK-NEXT:    or %s11, 0, %s9225  %2 = tail call fast double @llvm.pow.f64(double -2.000000e+00, double %0)226  ret double %2227}228 229; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn230define fp128 @func_fp_pow_const_fore_quad(fp128 noundef %0) {231; CHECK-LABEL: func_fp_pow_const_fore_quad:232; CHECK:       .LBB{{[0-9]+}}_2:233; CHECK-NEXT:    or %s2, 0, %s0234; CHECK-NEXT:    or %s3, 0, %s1235; CHECK-NEXT:    lea %s0, .LCPI{{[0-9]+}}_0@lo236; CHECK-NEXT:    and %s0, %s0, (32)0237; CHECK-NEXT:    lea.sl %s4, .LCPI{{[0-9]+}}_0@hi(, %s0)238; CHECK-NEXT:    ld %s0, 8(, %s4)239; CHECK-NEXT:    ld %s1, (, %s4)240; CHECK-NEXT:    lea %s4, powl@lo241; CHECK-NEXT:    and %s4, %s4, (32)0242; CHECK-NEXT:    lea.sl %s12, powl@hi(, %s4)243; CHECK-NEXT:    bsic %s10, (, %s12)244; CHECK-NEXT:    or %s11, 0, %s9245  %2 = tail call fast fp128 @llvm.pow.f128(fp128 0xL0000000000000000C000000000000000, fp128 %0)246  ret fp128 %2247}248 249; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn250declare float @llvm.powi.f32.i32(float, i32)251 252; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn253declare double @llvm.powi.f64.i32(double, i32)254 255; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn256declare fp128 @llvm.powi.f128.i32(fp128, i32)257