brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.2 KiB · 364cbef Raw
244 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=arm64-eabi < %s | FileCheck %s3 4define float @fma32(float %a, float %b, float %c) nounwind readnone ssp {5; CHECK-LABEL: fma32:6; CHECK:       // %bb.0: // %entry7; CHECK-NEXT:    fmadd s0, s0, s1, s28; CHECK-NEXT:    ret9entry:10  %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c)11  ret float %012}13 14define float @fnma32(float %a, float %b, float %c) nounwind readnone ssp {15; CHECK-LABEL: fnma32:16; CHECK:       // %bb.0: // %entry17; CHECK-NEXT:    fnmadd s0, s0, s1, s218; CHECK-NEXT:    ret19entry:20  %0 = tail call float @llvm.fma.f32(float %a, float %b, float %c)21  %mul = fmul float %0, -1.000000e+0022  ret float %mul23}24 25define float @fms32(float %a, float %b, float %c) nounwind readnone ssp {26; CHECK-LABEL: fms32:27; CHECK:       // %bb.0: // %entry28; CHECK-NEXT:    fmsub s0, s0, s1, s229; CHECK-NEXT:    ret30entry:31  %mul = fmul float %b, -1.000000e+0032  %0 = tail call float @llvm.fma.f32(float %a, float %mul, float %c)33  ret float %034}35 36define float @fms32_com(float %a, float %b, float %c) nounwind readnone ssp {37; CHECK-LABEL: fms32_com:38; CHECK:       // %bb.0: // %entry39; CHECK-NEXT:    fmsub s0, s1, s0, s240; CHECK-NEXT:    ret41entry:42  %mul = fmul float %b, -1.000000e+0043  %0 = tail call float @llvm.fma.f32(float %mul, float %a, float %c)44  ret float %045}46 47define float @fnms32(float %a, float %b, float %c) nounwind readnone ssp {48; CHECK-LABEL: fnms32:49; CHECK:       // %bb.0: // %entry50; CHECK-NEXT:    fnmsub s0, s0, s1, s251; CHECK-NEXT:    ret52entry:53  %mul = fmul float %c, -1.000000e+0054  %0 = tail call float @llvm.fma.f32(float %a, float %b, float %mul)55  ret float %056}57 58define double @fma64(double %a, double %b, double %c) nounwind readnone ssp {59; CHECK-LABEL: fma64:60; CHECK:       // %bb.0: // %entry61; CHECK-NEXT:    fmadd d0, d0, d1, d262; CHECK-NEXT:    ret63entry:64  %0 = tail call double @llvm.fma.f64(double %a, double %b, double %c)65  ret double %066}67 68define double @fnma64(double %a, double %b, double %c) nounwind readnone ssp {69; CHECK-LABEL: fnma64:70; CHECK:       // %bb.0: // %entry71; CHECK-NEXT:    fnmadd d0, d0, d1, d272; CHECK-NEXT:    ret73entry:74  %0 = tail call double @llvm.fma.f64(double %a, double %b, double %c)75  %mul = fmul double %0, -1.000000e+0076  ret double %mul77}78 79define double @fms64(double %a, double %b, double %c) nounwind readnone ssp {80; CHECK-LABEL: fms64:81; CHECK:       // %bb.0: // %entry82; CHECK-NEXT:    fmsub d0, d0, d1, d283; CHECK-NEXT:    ret84entry:85  %mul = fneg double %b86  %0 = tail call double @llvm.fma.f64(double %a, double %mul, double %c)87  ret double %088}89 90define double @fms64_com(double %a, double %b, double %c) nounwind readnone ssp {91; CHECK-LABEL: fms64_com:92; CHECK:       // %bb.0: // %entry93; CHECK-NEXT:    fmsub d0, d1, d0, d294; CHECK-NEXT:    ret95entry:96  %mul = fneg double %b97  %0 = tail call double @llvm.fma.f64(double %mul, double %a, double %c)98  ret double %099}100 101define double @fnms64(double %a, double %b, double %c) nounwind readnone ssp {102; CHECK-LABEL: fnms64:103; CHECK:       // %bb.0: // %entry104; CHECK-NEXT:    fnmsub d0, d0, d1, d2105; CHECK-NEXT:    ret106entry:107  %mul = fneg double %c108  %0 = tail call double @llvm.fma.f64(double %a, double %b, double %mul)109  ret double %0110}111 112define float @fma32_strict(float %a, float %b, float %c) nounwind readnone ssp strictfp {113; CHECK-LABEL: fma32_strict:114; CHECK:       // %bb.0: // %entry115; CHECK-NEXT:    fmadd s0, s0, s1, s2116; CHECK-NEXT:    ret117entry:118  %0 = tail call float @llvm.experimental.constrained.fma.f32(float %a, float %b, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0119  ret float %0120}121 122define float @fnma32_strict(float %a, float %b, float %c) nounwind readnone ssp strictfp {123; CHECK-LABEL: fnma32_strict:124; CHECK:       // %bb.0: // %entry125; CHECK-NEXT:    fnmadd s0, s0, s1, s2126; CHECK-NEXT:    ret127entry:128  %0 = tail call float @llvm.experimental.constrained.fma.f32(float %a, float %b, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0129  %neg = fneg float %0130  ret float %neg131}132 133define float @fms32_strict(float %a, float %b, float %c) nounwind readnone ssp strictfp {134; CHECK-LABEL: fms32_strict:135; CHECK:       // %bb.0: // %entry136; CHECK-NEXT:    fmsub s0, s0, s1, s2137; CHECK-NEXT:    ret138entry:139  %neg = fneg float %b140  %0 = tail call float @llvm.experimental.constrained.fma.f32(float %a, float %neg, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0141  ret float %0142}143 144define float @fms32_com_strict(float %a, float %b, float %c) nounwind readnone ssp strictfp {145; CHECK-LABEL: fms32_com_strict:146; CHECK:       // %bb.0: // %entry147; CHECK-NEXT:    fmsub s0, s0, s1, s2148; CHECK-NEXT:    ret149entry:150  %neg = fneg float %b151  %0 = tail call float @llvm.experimental.constrained.fma.f32(float %neg, float %a, float %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0152  ret float %0153}154 155define float @fnms32_strict(float %a, float %b, float %c) nounwind readnone ssp strictfp {156; CHECK-LABEL: fnms32_strict:157; CHECK:       // %bb.0: // %entry158; CHECK-NEXT:    fnmsub s0, s0, s1, s2159; CHECK-NEXT:    ret160entry:161  %neg = fneg float %c162  %0 = tail call float @llvm.experimental.constrained.fma.f32(float %a, float %b, float %neg, metadata !"round.tonearest", metadata !"fpexcept.strict") #0163  ret float %0164}165 166define double @fma64_strict(double %a, double %b, double %c) nounwind readnone ssp strictfp {167; CHECK-LABEL: fma64_strict:168; CHECK:       // %bb.0: // %entry169; CHECK-NEXT:    fmadd d0, d0, d1, d2170; CHECK-NEXT:    ret171entry:172  %0 = tail call double @llvm.experimental.constrained.fma.f64(double %a, double %b, double %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0173  ret double %0174}175 176define double @fnma64_strict(double %a, double %b, double %c) nounwind readnone ssp strictfp {177; CHECK-LABEL: fnma64_strict:178; CHECK:       // %bb.0: // %entry179; CHECK-NEXT:    fnmadd d0, d0, d1, d2180; CHECK-NEXT:    ret181entry:182  %0 = tail call double @llvm.experimental.constrained.fma.f64(double %a, double %b, double %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0183  %neg = fneg double %0184  ret double %neg185}186 187define double @fms64_strict(double %a, double %b, double %c) nounwind readnone ssp strictfp {188; CHECK-LABEL: fms64_strict:189; CHECK:       // %bb.0: // %entry190; CHECK-NEXT:    fmsub d0, d0, d1, d2191; CHECK-NEXT:    ret192entry:193  %neg = fneg double %b194  %0 = tail call double @llvm.experimental.constrained.fma.f64(double %a, double %neg, double %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0195  ret double %0196}197 198define double @fms64_com_strict(double %a, double %b, double %c) nounwind readnone ssp strictfp {199; CHECK-LABEL: fms64_com_strict:200; CHECK:       // %bb.0: // %entry201; CHECK-NEXT:    fmsub d0, d0, d1, d2202; CHECK-NEXT:    ret203entry:204  %neg = fneg double %b205  %0 = tail call double @llvm.experimental.constrained.fma.f64(double %neg, double %a, double %c, metadata !"round.tonearest", metadata !"fpexcept.strict") #0206  ret double %0207}208 209define double @fnms64_strict(double %a, double %b, double %c) nounwind readnone ssp strictfp {210; CHECK-LABEL: fnms64_strict:211; CHECK:       // %bb.0: // %entry212; CHECK-NEXT:    fnmsub d0, d0, d1, d2213; CHECK-NEXT:    ret214entry:215  %neg = fneg double %c216  %0 = tail call double @llvm.experimental.constrained.fma.f64(double %a, double %b, double %neg, metadata !"round.tonearest", metadata !"fpexcept.strict") #0217  ret double %0218}219 220; This would crash while trying getNegatedExpression().221 222define float @negated_constant(float %x) {223; CHECK-LABEL: negated_constant:224; CHECK:       // %bb.0:225; CHECK-NEXT:    mov w8, #-1037565952 // =0xc2280000226; CHECK-NEXT:    fmov s1, w8227; CHECK-NEXT:    mov w8, #1109917696 // =0x42280000228; CHECK-NEXT:    fmov s2, w8229; CHECK-NEXT:    fmul s1, s0, s1230; CHECK-NEXT:    fmadd s0, s0, s2, s1231; CHECK-NEXT:    ret232  %m = fmul float %x, 42.0233  %fma = call nsz float @llvm.fma.f32(float %x, float -42.0, float %m)234  %nfma = fneg float %fma235  ret float %nfma236}237 238attributes #0 = { strictfp }239 240declare float @llvm.fma.f32(float, float, float) nounwind readnone241declare double @llvm.fma.f64(double, double, double) nounwind readnone242declare float @llvm.experimental.constrained.fma.f32(float, float, float, metadata, metadata)243declare double @llvm.experimental.constrained.fma.f64(double, double, double, metadata, metadata)244