Skip to content

Commit 030bc28

Browse files
committed
Refine unit test names
1 parent ddd202a commit 030bc28

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

Python/optimizer_bytecodes.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -514,11 +514,6 @@ dummy_func(void) {
514514
}
515515

516516
op(_COMPARE_OP_INT, (left, right -- res, l, r)) {
517-
/* Comparison oparg masks */
518-
const int COMPARE_LT_MASK = 2;
519-
const int COMPARE_GT_MASK = 4;
520-
const int COMPARE_EQ_MASK = 8;
521-
522517
int cmp_mask = oparg & (COMPARE_LT_MASK | COMPARE_GT_MASK | COMPARE_EQ_MASK);
523518

524519
if (cmp_mask == COMPARE_EQ_MASK) {
@@ -536,7 +531,17 @@ dummy_func(void) {
536531
}
537532

538533
op(_COMPARE_OP_FLOAT, (left, right -- res, l, r)) {
539-
res = sym_new_type(ctx, &PyBool_Type);
534+
int cmp_mask = oparg & (COMPARE_LT_MASK | COMPARE_GT_MASK | COMPARE_EQ_MASK);
535+
536+
if (cmp_mask == COMPARE_EQ_MASK) {
537+
res = sym_new_predicate(ctx, left, right, JIT_PRED_EQ);
538+
}
539+
else if (cmp_mask == (COMPARE_LT_MASK | COMPARE_GT_MASK)) {
540+
res = sym_new_predicate(ctx, left, right, JIT_PRED_NE);
541+
}
542+
else {
543+
res = sym_new_type(ctx, &PyBool_Type);
544+
}
540545
l = left;
541546
r = right;
542547
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right, res);

0 commit comments

Comments
 (0)