[llvm] r292070 - [NVPTX] Add codegen tests for llvm.fma.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 15 08:55:37 PST 2017


Author: jlebar
Date: Sun Jan 15 10:55:37 2017
New Revision: 292070

URL: http://llvm.org/viewvc/llvm-project?rev=292070&view=rev
Log:
[NVPTX] Add codegen tests for llvm.fma.

Modified:
    llvm/trunk/test/CodeGen/NVPTX/math-intrins.ll

Modified: llvm/trunk/test/CodeGen/NVPTX/math-intrins.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/math-intrins.ll?rev=292070&r1=292069&r2=292070&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/math-intrins.ll (original)
+++ llvm/trunk/test/CodeGen/NVPTX/math-intrins.ll Sun Jan 15 10:55:37 2017
@@ -21,6 +21,8 @@ declare float @llvm.minnum.f32(float, fl
 declare double @llvm.minnum.f64(double, double) #0
 declare float @llvm.maxnum.f32(float, float) #0
 declare double @llvm.maxnum.f64(double, double) #0
+declare float @llvm.fma.f32(float, float, float) #0
+declare double @llvm.fma.f64(double, double, double) #0
 
 ; ---- ceil ----
 
@@ -257,5 +259,28 @@ define double @max_double(double %a, dou
   ret double %x
 }
 
+; ---- fma ----
+
+; CHECK-LABEL: @fma_float
+define float @fma_float(float %a, float %b, float %c) {
+  ; CHECK: fma.rn.f32
+  %x = call float @llvm.fma.f32(float %a, float %b, float %c)
+  ret float %x
+}
+
+; CHECK-LABEL: @fma_float_ftz
+define float @fma_float_ftz(float %a, float %b, float %c) #1 {
+  ; CHECK: fma.rn.ftz.f32
+  %x = call float @llvm.fma.f32(float %a, float %b, float %c)
+  ret float %x
+}
+
+; CHECK-LABEL: @fma_double
+define double @fma_double(double %a, double %b, double %c) {
+  ; CHECK: fma.rn.f64
+  %x = call double @llvm.fma.f64(double %a, double %b, double %c)
+  ret double %x
+}
+
 attributes #0 = { nounwind readnone }
 attributes #1 = { "nvptx-f32ftz" = "true" }




More information about the llvm-commits mailing list