From bdb6ff620b9fca3cac59d171f3b4f0ff46d30104 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Wed, 27 Nov 2024 14:18:24 +0100 Subject: [PATCH] * src/lisp.h (EQ): Improve generated code. Outside compilation 'symbols_with_pos_enabled' is always false, so ask the compiler to organize the most likely execution path in a sequential fashion in order to favor run-time performance. (cherry picked from commit b0ba0d42b0fdf70a20cd7a070128db8abe4a0826) --- src/lisp.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lisp.h b/src/lisp.h index 5ef97047f76..832a1755c04 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1353,10 +1353,10 @@ INLINE bool INLINE bool EQ (Lisp_Object x, Lisp_Object y) { - return BASE_EQ ((symbols_with_pos_enabled && SYMBOL_WITH_POS_P (x) - ? XSYMBOL_WITH_POS_SYM (x) : x), - (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (y) - ? XSYMBOL_WITH_POS_SYM (y) : y)); + return BASE_EQ ((__builtin_expect (symbols_with_pos_enabled, false) + && SYMBOL_WITH_POS_P (x) ? XSYMBOL_WITH_POS_SYM (x) : x), + (__builtin_expect (symbols_with_pos_enabled, false) + && SYMBOL_WITH_POS_P (y) ? XSYMBOL_WITH_POS_SYM (y) : y)); } INLINE intmax_t -- 2.39.5