From: Chris Lattner Date: Sat, 14 Feb 2004 04:08:35 +0000 (+0000) Subject: Document new intrinsics X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=10610646cbe02d5a018ddc1092f3b17e6325a94d Document new intrinsics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11438 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LangRef.html b/docs/LangRef.html index 33afe7e7e3b..e8c1f01cee1 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -95,10 +95,17 @@
  • 'llvm.va_copy' Intrinsic
  • +
  • Code Generator Intrinsics +
      +
    1. 'llvm.returnaddress' Intrinsic
    2. +
    3. 'llvm.frameaddress' Intrinsic
    4. +
    +
  • Standard C Library Intrinsics
    1. 'llvm.memcpy' Intrinsic
    2. 'llvm.memmove' Intrinsic
    3. +
    4. 'llvm.memset' Intrinsic
  • Debugger intrinsics @@ -1735,12 +1742,116 @@ complex and require memory allocation, for example.

    + +
    +

    +These intrinsics are provided by LLVM to expose special features that may only +be implemented with code generator support. +

    + +
    + + +
    + +
    Syntax:
    +
    +  call void* ()* %llvm.returnaddress(uint <level>)
    +
    + +
    Overview:
    + +

    +The 'llvm.returnaddress' intrinsic returns a target-specific value +indicating the return address of the current function or one of its callers. +

    + +
    Arguments:
    + +

    +The argument to this intrinsic indicates which function to return the address +for. Zero indicates the calling function, one indicates its caller, etc. The +argument is required to be a constant integer value. +

    + +
    Semantics:
    + +

    +The 'llvm.returnaddress' intrinsic either returns a pointer indicating +the return address of the specified call frame, or zero if it cannot be +identified. The value returned by this intrinsic is likely to be incorrect or 0 +for arguments other than zero, so it should only be used for debugging purposes. +

    + +

    +Note that calling this intrinsic does not prevent function inlining or other +aggressive transformations, so the value returned may not that of the obvious +source-language caller. +

    +
    + + + + + +
    + +
    Syntax:
    +
    +  call void* ()* %llvm.frameaddress(uint <level>)
    +
    + +
    Overview:
    + +

    +The 'llvm.frameaddress' intrinsic returns the target-specific frame +pointer value for the specified stack frame. +

    + +
    Arguments:
    + +

    +The argument to this intrinsic indicates which function to return the frame +pointer for. Zero indicates the calling function, one indicates its caller, +etc. The argument is required to be a constant integer value. +

    + +
    Semantics:
    + +

    +The 'llvm.frameaddress' intrinsic either returns a pointer indicating +the frame address of the specified call frame, or zero if it cannot be +identified. The value returned by this intrinsic is likely to be incorrect or 0 +for arguments other than zero, so it should only be used for debugging purposes. +

    +

    +Note that calling this intrinsic does not prevent function inlining or other +aggressive transformations, so the value returned may not that of the obvious +source-language caller. +

    +
    + + + + +
    +

    +LLVM provides intrinsics for a few important standard C library functions. +These intrinsics allow source-language front-ends to pass information about the +alignment of the pointer arguments to the code generator, providing opportunity +for more efficient code generation.

    @@ -1850,6 +1961,57 @@ be set to 0 or 1. + + + +
    + +
    Syntax:
    +
    +  call void (sbyte*, ubyte, uint, uint)* %llvm.memset(sbyte* <dest>, ubyte <val>,
    +                                                      uint <len>, uint <align>)
    +
    + +
    Overview:
    + +

    +The 'llvm.memset' intrinsic fills a block of memory with a particular +byte value. +

    + +

    +Note that, unlike the standard libc function, the llvm.memset intrinsic +does not return a value, and takes an extra alignment argument. +

    + +
    Arguments:
    + +

    +The first argument is a pointer to the destination to fill, the second is the +byte value to fill it with, the third argument is an (arbitrarily sized) integer +argument specifying the number of bytes to fill, and the fourth argument is the +known alignment of destination location. +

    + +

    +If the call to this intrinisic has an alignment value that is not 0 or 1, then +the caller guarantees that the size of the copy is a multiple of the alignment +and that the destination pointer is aligned to that boundary. +

    + +
    Semantics:
    + +

    +The 'llvm.memset' intrinsic fills "len" bytes of memory starting at the +destination location. If the argument is known to be aligned to some boundary, +this can be specified as the fourth argument, otherwise it should be set to 0 or +1. +

    +
    + +