7#include "nuitka/prelude.h"
13PyObject *RICH_COMPARE_GT_OBJECT_NILONG_CLONG(
nuitka_ilong *operand1,
long operand2) {
14 CHECK_NILONG_OBJECT(operand1);
16 bool left_c_usable = IS_NILONG_C_VALUE_VALID(operand1);
17 bool right_c_usable =
true;
19 if (left_c_usable && right_c_usable) {
20 bool r = COMPARE_LE_CBOOL_CLONG_CLONG(operand1->c_value, operand2);
23 PyObject *result = BOOL_FROM(!r);
24 Py_INCREF_IMMORTAL(result);
26 }
else if (!left_c_usable && !right_c_usable) {
27 ENFORCE_NILONG_OBJECT_VALUE(operand1);
29 return COMPARE_GT_OBJECT_LONG_CLONG(operand1->python_value, operand2);
31 return COMPARE_GT_OBJECT_LONG_CLONG(operand1->python_value, operand2);
36bool RICH_COMPARE_GT_CBOOL_NILONG_CLONG(
nuitka_ilong *operand1,
long operand2) {
37 CHECK_NILONG_OBJECT(operand1);
39 bool left_c_usable = IS_NILONG_C_VALUE_VALID(operand1);
40 bool right_c_usable =
true;
42 if (left_c_usable && right_c_usable) {
43 bool r = COMPARE_LE_CBOOL_CLONG_CLONG(operand1->c_value, operand2);
49 }
else if (!left_c_usable && !right_c_usable) {
50 ENFORCE_NILONG_OBJECT_VALUE(operand1);
52 return COMPARE_GT_CBOOL_LONG_CLONG(operand1->python_value, operand2);
54 return COMPARE_GT_CBOOL_LONG_CLONG(operand1->python_value, operand2);
60PyObject *RICH_COMPARE_GT_OBJECT_NILONG_DIGIT(
nuitka_ilong *operand1,
long operand2) {
61 CHECK_NILONG_OBJECT(operand1);
62 assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));
64 bool left_c_usable = IS_NILONG_C_VALUE_VALID(operand1);
65 bool right_c_usable =
true;
67 if (left_c_usable && right_c_usable) {
68 bool r = COMPARE_LE_CBOOL_CLONG_CLONG(operand1->c_value, operand2);
71 PyObject *result = BOOL_FROM(!r);
72 Py_INCREF_IMMORTAL(result);
74 }
else if (!left_c_usable && !right_c_usable) {
75 ENFORCE_NILONG_OBJECT_VALUE(operand1);
77 return COMPARE_GT_OBJECT_LONG_DIGIT(operand1->python_value, operand2);
79 return COMPARE_GT_OBJECT_LONG_DIGIT(operand1->python_value, operand2);
85bool RICH_COMPARE_GT_CBOOL_NILONG_DIGIT(
nuitka_ilong *operand1,
long operand2) {
86 CHECK_NILONG_OBJECT(operand1);
87 assert(Py_ABS(operand2) < (1 << PyLong_SHIFT));
89 bool left_c_usable = IS_NILONG_C_VALUE_VALID(operand1);
90 bool right_c_usable =
true;
92 if (left_c_usable && right_c_usable) {
93 bool r = COMPARE_LE_CBOOL_CLONG_CLONG(operand1->c_value, operand2);
99 }
else if (!left_c_usable && !right_c_usable) {
100 ENFORCE_NILONG_OBJECT_VALUE(operand1);
102 return COMPARE_GT_CBOOL_LONG_DIGIT(operand1->python_value, operand2);
104 return COMPARE_GT_CBOOL_LONG_DIGIT(operand1->python_value, operand2);