From 5afba6f00c3e2eef83aebbcff5fcfca2fa3c978e Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 5 Jun 2012 19:07:46 +0000 Subject: Add a new intrinsic: llvm.fmuladd. This intrinsic represents a multiply-add expression (a * b + c) that can be implemented as a fused multiply-add (fma) if the target determines that this will be more efficient. This intrinsic will be used to implement FP_CONTRACT support and an aggressive FMA formation mode. If your target has a fast FMA instruction you should override the isFMAFasterThanMulAndAdd method in TargetLowering to return true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158014 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'docs') diff --git a/docs/LangRef.html b/docs/LangRef.html index 1f43ab67f2..f13f13909b 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -277,6 +277,11 @@
  • 'llvm.umul.with.overflow.* Intrinsics
  • +
  • Specialised Arithmetic Intrinsics +
      +
    1. 'llvm.fmuladd Intrinsic
    2. +
    +
  • Half Precision Floating Point Intrinsics
    1. 'llvm.convert.to.fp16' Intrinsic
    2. @@ -7945,6 +7950,52 @@ LLVM.

      + +

      + Specialised Arithmetic Intrinsics +

      + + + +

      + 'llvm.fmuladd.*' Intrinsic +

      + +
      + +
      Syntax:
      +
      +  declare float @llvm.fmuladd.f32(float %a, float %b, float %c)
      +  declare double @llvm.fmuladd.f64(double %a, double %b, double %c)
      +
      + +
      Overview:
      +

      The 'llvm.fmuladd.*' intrinsic functions represent multiply-add +expressions that can be fused if the code generator determines that the fused +expression would be legal and efficient.

      + +
      Arguments:
      +

      The 'llvm.fmuladd.*' intrinsics each take three arguments: two +multiplicands, a and b, and an addend c.

      + +
      Semantics:
      +

      The expression:

      +
      +  %0 = call float @llvm.fmuladd.f32(%a, %b, %c)
      +
      +

      is equivalent to the expression a * b + c, except that rounding will not be +performed between the multiplication and addition steps if the code generator +fuses the operations. Fusion is not guaranteed, even if the target platform +supports it. If a fused multiply-add is required the corresponding llvm.fma.* +intrinsic function should be used instead.

      + +
      Examples:
      +
      +  %r2 = call float @llvm.fmuladd.f32(float %a, float %b, float %c) ; yields {float}:r2 = (a * b) + c
      +
      + +
      +

      Half Precision Floating Point Intrinsics -- cgit v1.2.3-70-g09d2