summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-08-21 05:03:10 +0000
committerNadav Rotem <nrotem@apple.com>2013-08-21 05:03:10 +0000
commit7efc04cb40a602f0d51c12d2ab55b30882d6cb5f (patch)
treee59c64651231e0ec35be02ead1896a4327add7bb /llvm/test
parent092559e6f07316d7607e77769ae34a70cabbd687 (diff)
downloadbcm5719-llvm-7efc04cb40a602f0d51c12d2ab55b30882d6cb5f.tar.gz
bcm5719-llvm-7efc04cb40a602f0d51c12d2ab55b30882d6cb5f.zip
In LLVM FMA3 operands are dst, src1, src2, src3, however dst is not encoded as it is always src1. This was causing the encoding of the operands to be off by one.
Patch by Chris Bieneman. llvm-svn: 188866
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/ExecutionEngine/fma3-jit.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/fma3-jit.ll b/llvm/test/ExecutionEngine/fma3-jit.ll
new file mode 100644
index 00000000000..25eaa65a538
--- /dev/null
+++ b/llvm/test/ExecutionEngine/fma3-jit.ll
@@ -0,0 +1,18 @@
+; RUN: %lli %s | FileCheck %s
+; REQUIRES: fma3
+; CHECK: 12.000000
+
+@msg_double = internal global [4 x i8] c"%f\0A\00"
+
+declare i32 @printf(i8*, ...)
+
+define i32 @main() {
+ %fma = tail call double @llvm.fma.f64(double 3.0, double 3.0, double 3.0) nounwind readnone
+
+ %ptr1 = getelementptr [4 x i8]* @msg_double, i32 0, i32 0
+ call i32 (i8*,...)* @printf(i8* %ptr1, double %fma)
+
+ ret i32 0
+}
+
+declare double @llvm.fma.f64(double, double, double) nounwind readnone
OpenPOWER on IntegriCloud