Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:47:21

0001 /*
0002  * Copyright (c) 2004-2006 The Regents of the University of California.
0003  *                         All rights reserved.
0004  * Copyright (c) 2014-2020 Intel, Inc.  All rights reserved.
0005  * Copyright (c) 2021-2022 Nanook Consulting.  All rights reserved.
0006  * $COPYRIGHT$
0007  *
0008  * Additional copyrights may follow
0009  *
0010  * $HEADER$
0011  */
0012 
0013 /** @file
0014  *
0015  * Compiler-specific prefetch functions
0016  *
0017  * A small set of prefetch / prediction interfaces for using compiler
0018  * directives to improve memory prefetching and branch prediction
0019  */
0020 
0021 #ifndef PMIX_PREFETCH_H
0022 #define PMIX_PREFETCH_H
0023 
0024 #include "src/include/pmix_config.h"
0025 
0026 #if PMIX_C_HAVE_BUILTIN_EXPECT
0027 #    define PMIX_LIKELY(expression)   __builtin_expect(!!(expression), 1)
0028 #    define PMIX_UNLIKELY(expression) __builtin_expect(!!(expression), 0)
0029 #else
0030 #    define PMIX_LIKELY(expression)   (expression)
0031 #    define PMIX_UNLIKELY(expression) (expression)
0032 #endif
0033 
0034 #if PMIX_C_HAVE_BUILTIN_PREFETCH
0035 #    define PMIX_PREFETCH(address, rw, locality) __builtin_prefetch(address, rw, locality)
0036 #else
0037 #    define PMIX_PREFETCH(address, rw, locality)
0038 #endif
0039 
0040 #endif