From ad4c5d897292a95216ad317181c06ad41222ab97 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Wed, 7 Mar 2018 12:23:41 +0300 Subject: [PATCH] mdbx: add __cold/__hot for Elbrus. --- src/defs.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/defs.h b/src/defs.h index f572673e..0dcfde66 100644 --- a/src/defs.h +++ b/src/defs.h @@ -268,7 +268,9 @@ #ifndef __hot # if defined(__OPTIMIZE__) -# if defined(__clang__) && !__has_attribute(hot) +# if defined(__e2k__) +# define __hot __attribute__((hot)) __optimize(3) +# elif defined(__clang__) && !__has_attribute(hot) /* just put frequently used functions in separate section */ # define __hot __attribute__((section("text.hot"))) __optimize("O3") # elif defined(__GNUC__) || __has_attribute(hot) @@ -283,7 +285,9 @@ #ifndef __cold # if defined(__OPTIMIZE__) -# if defined(__clang__) && !__has_attribute(cold) +# if defined(__e2k__) +# define __cold __attribute__((cold)) __optimize(1) +# elif defined(__clang__) && !__has_attribute(cold) /* just put infrequently used functions in separate section */ # define __cold __attribute__((section("text.unlikely"))) __optimize("Os") # elif defined(__GNUC__) || __has_attribute(cold)