Back to index

glibc  2.9
Defines
memcopy.h File Reference
#include <sysdeps/generic/memcopy.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define OP_T_THRES   8
#define BYTE_COPY_FWD(dst_bp, src_bp, nbytes)
#define BYTE_COPY_BWD(dst_ep, src_ep, nbytes)
#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes)
#define WORD_COPY_BWD(dst_ep, src_ep, nbytes_left, nbytes)

Define Documentation

#define BYTE_COPY_BWD (   dst_ep,
  src_ep,
  nbytes 
)
Value:
do                                                                   \
    {                                                                \
      int __d0;                                                             \
      asm volatile(/* Set the direction flag, so copying goes backwards.  */  \
                 "std\n"                                             \
                 /* Copy bytes.  */                                         \
                 "rep\n"                                             \
                 "movsb\n"                                           \
                 /* Clear the dir flag.  Convention says it should be 0. */ \
                 "cld" :                                             \
                 "=D" (dst_ep), "=S" (src_ep), "=c" (__d0) :                \
                 "0" (dst_ep - 1), "1" (src_ep - 1), "2" (nbytes) :         \
                 "memory");                                          \
      dst_ep += 1;                                                   \
      src_ep += 1;                                                   \
    } while (0)

Definition at line 41 of file memcopy.h.

#define BYTE_COPY_FWD (   dst_bp,
  src_bp,
  nbytes 
)
Value:
do {                                                                 \
    int __d0;                                                        \
    asm volatile(/* Clear the direction flag, so copying goes forward.  */    \
               "cld\n"                                               \
               /* Copy bytes.  */                                    \
               "rep\n"                                               \
               "movsb" :                                             \
               "=D" (dst_bp), "=S" (src_bp), "=c" (__d0) :                  \
               "0" (dst_bp), "1" (src_bp), "2" (nbytes) :                   \
               "memory");                                            \
  } while (0)

Definition at line 27 of file memcopy.h.

#define OP_T_THRES   8

Definition at line 24 of file memcopy.h.

#define WORD_COPY_BWD (   dst_ep,
  src_ep,
  nbytes_left,
  nbytes 
)
Value:
do                                                                   \
    {                                                                \
      int __d0;                                                             \
      asm volatile(/* Set the direction flag, so copying goes backwards.  */  \
                 "std\n"                                             \
                 /* Copy longwords.  */                              \
                 "rep\n"                                             \
                 "movsl\n"                                           \
                 /* Clear the dir flag.  Convention says it should be 0. */ \
                 "cld" :                                             \
                 "=D" (dst_ep), "=S" (src_ep), "=c" (__d0) :                \
                 "0" (dst_ep - 4), "1" (src_ep - 4), "2" ((nbytes) / 4) :   \
                 "memory");                                          \
      dst_ep += 4;                                                   \
      src_ep += 4;                                                   \
      (nbytes_left) = (nbytes) % 4;                                         \
    } while (0)

Definition at line 76 of file memcopy.h.

#define WORD_COPY_FWD (   dst_bp,
  src_bp,
  nbytes_left,
  nbytes 
)
Value:
do                                                                   \
    {                                                                \
      int __d0;                                                             \
      asm volatile(/* Clear the direction flag, so copying goes forward.  */  \
                 "cld\n"                                             \
                 /* Copy longwords.  */                              \
                 "rep\n"                                             \
                 "movsl" :                                           \
                 "=D" (dst_bp), "=S" (src_bp), "=c" (__d0) :                \
                 "0" (dst_bp), "1" (src_bp), "2" ((nbytes) / 4) :           \
                 "memory");                                          \
      (nbytes_left) = (nbytes) % 4;                                         \
    } while (0)

Definition at line 60 of file memcopy.h.