We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ee1785 commit 361909eCopy full SHA for 361909e
1 file changed
py/mpconfig.h
@@ -562,3 +562,13 @@ typedef double mp_float_t;
562
#ifndef MP_WEAK
563
#define MP_WEAK __attribute__((weak))
564
#endif
565
+
566
+// Condition is likely to be true, to help branch prediction
567
+#ifndef MP_LIKELY
568
+#define MP_LIKELY(x) __builtin_expect((x), 1)
569
+#endif
570
571
+// Condition is likely to be false, to help branch prediction
572
+#ifndef MP_UNLIKELY
573
+#define MP_UNLIKELY(x) __builtin_expect((x), 0)
574
0 commit comments