From 51a709db4d1f82763cca1090235b0adbf0ea4e7f Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Sun, 14 Mar 2010 18:42:47 +0000 Subject: [PATCH] Document fp16 intrinsics llvm-svn: 98505 --- docs/LangRef.html | 90 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index adaf44ab870..a867ee01c53 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 @@ -6606,6 +6612,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)
    +
    + +
    +