brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · f9e4e99 Raw
60 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+fma | FileCheck %s3 4; This test checks that (fneg (fma (fneg x), y, (fneg z))) can't be folded to (fma x, y, z)5; without no signed zeros flag (nsz).6 7declare float @llvm.fma.f32(float, float, float)8 9define float @fneg_fma32(float %x, float %y, float %z) {10; CHECK-LABEL: fneg_fma32:11; CHECK:       # %bb.0:12; CHECK-NEXT:    vfnmsub213ss {{.*#+}} xmm0 = -(xmm1 * xmm0) - xmm213; CHECK-NEXT:    vxorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm014; CHECK-NEXT:    retq15  %negx = fneg float %x16  %negz = fneg float %z17  %fma = call float @llvm.fma.f32(float %negx, float %y, float %negz)18  %n = fneg float %fma19  ret float %n20}21 22define float @fneg_fma32_nsz(float %x, float %y, float %z) {23; CHECK-LABEL: fneg_fma32_nsz:24; CHECK:       # %bb.0:25; CHECK-NEXT:    vfmadd213ss {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm226; CHECK-NEXT:    retq27  %negx = fneg float %x28  %negz = fneg float %z29  %fma = call nsz float @llvm.fma.f32(float %negx, float %y, float %negz)30  %n = fneg float %fma31  ret float %n32}33 34declare double @llvm.fma.f64(double, double, double)35 36define double @fneg_fma64(double %x, double %y, double %z) {37; CHECK-LABEL: fneg_fma64:38; CHECK:       # %bb.0:39; CHECK-NEXT:    vfnmsub213sd {{.*#+}} xmm0 = -(xmm1 * xmm0) - xmm240; CHECK-NEXT:    vxorpd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm041; CHECK-NEXT:    retq42  %negx = fneg double %x43  %negz = fneg double %z44  %fma = call double @llvm.fma.f64(double %negx, double %y, double %negz)45  %n = fneg double %fma46  ret double %n47}48 49define double @fneg_fma64_nsz(double %x, double %y, double %z) {50; CHECK-LABEL: fneg_fma64_nsz:51; CHECK:       # %bb.0:52; CHECK-NEXT:    vfmadd213sd {{.*#+}} xmm0 = (xmm1 * xmm0) + xmm253; CHECK-NEXT:    retq54  %negx = fneg double %x55  %negz = fneg double %z56  %fma = call nsz double @llvm.fma.f64(double %negx, double %y, double %negz)57  %n = fneg double %fma58  ret double %n59}60