Skip to content

Commit 959d07d

Browse files
committed
DEBUG /wo gmp issues
1 parent abfa248 commit 959d07d

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

ext/gmp/gmp.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -368,40 +368,7 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
368368

369369
static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2) /* {{{ */
370370
{
371-
switch (opcode) {
372-
case ZEND_ADD:
373-
gmp_zval_binary_ui_op(result, op1, op2, mpz_add, mpz_add_ui, false, true);
374-
if (UNEXPECTED(EG(exception))) { return FAILURE; }
375-
return SUCCESS;
376-
case ZEND_SUB:
377-
DO_BINARY_UI_OP(mpz_sub);
378-
case ZEND_MUL:
379-
DO_BINARY_UI_OP(mpz_mul);
380-
case ZEND_POW:
381-
shift_operator_helper(mpz_pow_ui, result, op1, op2, opcode);
382-
return SUCCESS;
383-
case ZEND_DIV:
384-
DO_BINARY_UI_OP_EX(mpz_tdiv_q, gmp_mpz_tdiv_q_ui, 1);
385-
case ZEND_MOD:
386-
DO_BINARY_UI_OP_EX(mpz_mod, gmp_mpz_mod_ui, 1);
387-
case ZEND_SL:
388-
shift_operator_helper(mpz_mul_2exp, result, op1, op2, opcode);
389-
return SUCCESS;
390-
case ZEND_SR:
391-
shift_operator_helper(mpz_fdiv_q_2exp, result, op1, op2, opcode);
392-
return SUCCESS;
393-
case ZEND_BW_OR:
394-
DO_BINARY_OP(mpz_ior);
395-
case ZEND_BW_AND:
396-
DO_BINARY_OP(mpz_and);
397-
case ZEND_BW_XOR:
398-
DO_BINARY_OP(mpz_xor);
399-
case ZEND_BW_NOT:
400-
DO_UNARY_OP(mpz_com);
401-
402-
default:
403371
return FAILURE;
404-
}
405372
}
406373
/* }}} */
407374

@@ -1045,21 +1012,18 @@ ZEND_FUNCTION(gmp_strval)
10451012
/* {{{ Add a and b */
10461013
ZEND_FUNCTION(gmp_add)
10471014
{
1048-
gmp_binary_ui_op(mpz_add, mpz_add_ui);
10491015
}
10501016
/* }}} */
10511017

10521018
/* {{{ Subtract b from a */
10531019
ZEND_FUNCTION(gmp_sub)
10541020
{
1055-
gmp_binary_ui_op(mpz_sub, mpz_sub_ui);
10561021
}
10571022
/* }}} */
10581023

10591024
/* {{{ Multiply a and b */
10601025
ZEND_FUNCTION(gmp_mul)
10611026
{
1062-
gmp_binary_ui_op(mpz_mul, mpz_mul_ui);
10631027
}
10641028
/* }}} */
10651029

@@ -1513,14 +1477,12 @@ ZEND_FUNCTION(gmp_prob_prime)
15131477
/* {{{ Computes greatest common denominator (gcd) of a and b */
15141478
ZEND_FUNCTION(gmp_gcd)
15151479
{
1516-
gmp_binary_ui_op(mpz_gcd, gmp_mpz_gcd_ui);
15171480
}
15181481
/* }}} */
15191482

15201483
/* {{{ Computes least common multiple (lcm) of a and b */
15211484
ZEND_FUNCTION(gmp_lcm)
15221485
{
1523-
gmp_binary_ui_op(mpz_lcm, mpz_lcm_ui);
15241486
}
15251487
/* }}} */
15261488

0 commit comments

Comments
 (0)