From f02e73018fcc0f0361950926f36a32105591700f Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 14 Mar 2010 18:42:47 +0000 Subject: Document fp16 intrinsics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98505 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index adaf44a..a867ee0 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -255,6 +255,12 @@
  • 'llvm.umul.with.overflow.* Intrinsics
  • +
  • Half Precision Floating Point Intrinsics +
      +
    1. 'llvm.convert.to.fp16' Intrinsic
    2. +
    3. 'llvm.conver.from.fp16' Intrinsic
    4. +
    +
  • Debugger intrinsics
  • Exception Handling intrinsics
  • Trampoline Intrinsic @@ -6608,6 +6614,90 @@ LLVM.

    + +
    + +

    Half precision floating point is storage-only format. That is why the values + in such format should be promoted to single precision format before any + operations. LLVM provides intrinsics for conversions to single precision and + back.

    + +
    + + + + +
    + +
    Syntax:
    +
    +  declare i16 @llvm.convert.to.fp16(f32 %a)
    +
    + +
    Overview:
    +

    The 'llvm.convert.to.fp16' intrinsic function performs + a conversion from single precision floating point format to half precision + floating point format.

    + +
    Arguments:
    +

    The intrinsic function contains single argument - the value to be + converted.

    + +
    Semantics:
    +

    The 'llvm.convert.to.fp16' intrinsic function performs + a conversion from single precision floating point format to half precision + floating point format. Since the format is storage only the return value is + just an i16 which contains the converted number.

    + +
    Examples:
    +
    +  %res = call i16 @llvm.convert.to.fp16(f32 %a)
    +  store i16 %res, i16* @x, align 2
    +
    + +
    + + + + +
    + +
    Syntax:
    +
    +  declare f32 @llvm.convert.from.fp16(i16 %a)
    +
    + +
    Overview:
    +

    The 'llvm.convert.from.fp16' intrinsic function performs + a conversion from half precision floating point format to single precision + floating point format.

    + +
    Arguments:
    +

    The intrinsic function contains single argument - the value to be + converted.

    + +
    Semantics:
    +

    The 'llvm.convert.from.fp16' intrinsic function performs a + conversion from half single precision floating point format to signle + precision floating point format. Since the format is storage only the + argument is represented by an i16 value.

    + +
    Examples:
    +
    +  %a = load i16* @x, align 2
    +  %res = call f32 @llvm.convert.from.fp16(i16 %a)
    +
    + +
    + + + -- cgit v1.1