aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/PTX/mad-disabling.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/PTX/mad-disabling.ll')
-rw-r--r--test/CodeGen/PTX/mad-disabling.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGen/PTX/mad-disabling.ll b/test/CodeGen/PTX/mad-disabling.ll
new file mode 100644
index 000000000000..ad7b3417ec48
--- /dev/null
+++ b/test/CodeGen/PTX/mad-disabling.ll
@@ -0,0 +1,16 @@
+; RUN: llc < %s -march=ptx32 -mattr=+ptx20,+sm20 | grep "mad"
+; RUN: llc < %s -march=ptx32 -mattr=+ptx20,+sm20,+no-fma | grep -v "mad"
+
+define ptx_device float @test_mul_add_f(float %x, float %y, float %z) {
+entry:
+ %a = fmul float %x, %y
+ %b = fadd float %a, %z
+ ret float %b
+}
+
+define ptx_device double @test_mul_add_d(double %x, double %y, double %z) {
+entry:
+ %a = fmul double %x, %y
+ %b = fadd double %a, %z
+ ret double %b
+}