From 0eb51b440c4ea7eba82964047221e17758de2057 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 12 Feb 2004 18:10:10 +0000 Subject: [PATCH] Add support for the llvm.memmove intrinsic. Patch graciously contributed by Reid Spencer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11354 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 47 +++++++++++++++++++++++++++++++++++++++ include/llvm/Intrinsics.h | 4 +++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index 7b03c45511f..20436ede7e2 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -98,6 +98,7 @@
  • Standard C Library Intrinsics
    1. 'llvm.memcpy' Intrinsic
    2. +
    3. 'llvm.memmove' Intrinsic
  • Debugger intrinsics @@ -1790,6 +1791,52 @@ be set to 0 or 1. + + + +
    + +
    Syntax:
    +
    +  call void (sbyte*, sbyte*, uint, uint)* %llvm.memmove(sbyte* <dest>, sbyte* <src>,
    +                                                       uint <len>, uint <align>)
    +
    + +
    Overview:
    + +

    +The 'llvm.memmove' intrinsic moves a block of memory from the source +location to the destination location. It is similar to the 'llvm.memcpy' +intrinsic but allows the two memory locations to overlap. +

    + +

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

    + +
    Arguments:
    + +

    +The first argument is a pointer to the destination, the second is a pointer to +the source. The third argument is an (arbitrarily sized) integer argument +specifying the number of bytes to copy, and the fourth argument is the alignment +of the source and destination locations. +

    + +
    Semantics:
    + +

    +The 'llvm.memmove' intrinsic copies a block of memory from the source +location to the destination location, which may overlap. It +copies "len" bytes of memory over. 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. +

    +
    +
    diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h index 098d5d4abd2..125105dd303 100644 --- a/include/llvm/Intrinsics.h +++ b/include/llvm/Intrinsics.h @@ -45,7 +45,9 @@ namespace Intrinsic { dbg_declare, // Declare a local object // Standard libc functions... - memcpy, + memcpy, // Used to copy non-overlapping memory blocks + memmove, // Used to copy overlapping memory blocks + // Standard libm functions...