root/opal/mca/pmix/pmix4x/pmix/src/include/prefetch.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2004-2006 The Regents of the University of California.
   3  *                         All rights reserved.
   4  * Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
   5  * $COPYRIGHT$
   6  *
   7  * Additional copyrights may follow
   8  *
   9  * $HEADER$
  10  */
  11 
  12 /** @file
  13  *
  14  * Compiler-specific prefetch functions
  15  *
  16  * A small set of prefetch / prediction interfaces for using compiler
  17  * directives to improve memory prefetching and branch prediction
  18  */
  19 
  20 #ifndef PMIX_PREFETCH_H
  21 #define PMIX_PREFETCH_H
  22 
  23 #include <src/include/pmix_config.h>
  24 
  25 #if PMIX_C_HAVE_BUILTIN_EXPECT
  26 #define PMIX_LIKELY(expression) __builtin_expect(!!(expression), 1)
  27 #define PMIX_UNLIKELY(expression) __builtin_expect(!!(expression), 0)
  28 #else
  29 #define PMIX_LIKELY(expression) (expression)
  30 #define PMIX_UNLIKELY(expression) (expression)
  31 #endif
  32 
  33 #if PMIX_C_HAVE_BUILTIN_PREFETCH
  34 #define PMIX_PREFETCH(address,rw,locality) __builtin_prefetch(address,rw,locality)
  35 #else
  36 #define PMIX_PREFETCH(address,rw,locality)
  37 #endif
  38 
  39 #endif

/* [<][>][^][v][top][bottom][index][help] */