From bcddeaba9fb150c71b568075546442cabd1ab3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Sat, 31 Dec 2022 00:55:46 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20`CMP2INT()`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Решил вернуться к старому варианту. Вроде-бы все актуальные компиляторы ведут себя с ним прилично (не хуже), а некоторые лучше. --- src/internals.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/internals.h b/src/internals.h index 0e346ab4..862a6697 100644 --- a/src/internals.h +++ b/src/internals.h @@ -1681,13 +1681,7 @@ typedef struct MDBX_node { * | 1, a > b * \ */ -#ifndef __e2k__ -/* LY: fast enough on most systems */ -#define CMP2INT(a, b) (((b) > (a)) ? -1 : (a) > (b)) -#else -/* LY: more parallelable on VLIW Elbrus */ -#define CMP2INT(a, b) (((a) > (b)) - ((b) > (a))) -#endif +#define CMP2INT(a, b) (((a) != (b)) ? (((a) < (b)) ? -1 : 1) : 0) MDBX_MAYBE_UNUSED MDBX_NOTHROW_CONST_FUNCTION static __inline pgno_t int64pgno(int64_t i64) {