From ec7b5e9290bc0e1b266525a4757773e9ab87847e Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Wed, 21 Aug 2013 05:03:10 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188866 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/ExecutionEngine/fma3-jit.ll | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/ExecutionEngine/fma3-jit.ll (limited to 'test/ExecutionEngine') diff --git a/test/ExecutionEngine/fma3-jit.ll b/test/ExecutionEngine/fma3-jit.ll new file mode 100644 index 0000000..25eaa65 --- /dev/null +++ b/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 -- cgit v1.1