version 1.1.1.1, 2000/01/10 15:35:27 |
version 1.1.1.2, 2000/09/09 14:12:53 |
|
|
/* mpz_ior -- Logical inclusive or. |
/* mpz_ior -- Logical inclusive or. |
|
|
Copyright (C) 1991, 1993, 1994, 1996 Free Software Foundation, Inc. |
Copyright (C) 1991, 1993, 1994, 1996, 1997, 2000 Free Software Foundation, |
|
Inc. |
|
|
This file is part of the GNU MP Library. |
This file is part of the GNU MP Library. |
|
|
The GNU MP Library is free software; you can redistribute it and/or modify |
The GNU MP Library is free software; you can redistribute it and/or modify |
it under the terms of the GNU Library General Public License as published by |
it under the terms of the GNU Lesser General Public License as published by |
the Free Software Foundation; either version 2 of the License, or (at your |
the Free Software Foundation; either version 2.1 of the License, or (at your |
option) any later version. |
option) any later version. |
|
|
The GNU MP Library is distributed in the hope that it will be useful, but |
The GNU MP Library is distributed in the hope that it will be useful, but |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
License for more details. |
License for more details. |
|
|
You should have received a copy of the GNU Library General Public License |
You should have received a copy of the GNU Lesser General Public License |
along with the GNU MP Library; see the file COPYING.LIB. If not, write to |
along with the GNU MP Library; see the file COPYING.LIB. If not, write to |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
MA 02111-1307, USA. */ |
MA 02111-1307, USA. */ |
Line 126 mpz_ior (res, op1, op2) |
|
Line 127 mpz_ior (res, op1, op2) |
|
_mpz_realloc (res, res_size); |
_mpz_realloc (res, res_size); |
res_ptr = res->_mp_d; |
res_ptr = res->_mp_d; |
/* Don't re-read OP1_PTR and OP2_PTR. They point to |
/* Don't re-read OP1_PTR and OP2_PTR. They point to |
temporary space--never to the space RES->_mp_D used |
temporary space--never to the space RES->_mp_d used |
to point to before reallocation. */ |
to point to before reallocation. */ |
} |
} |
|
|
Line 163 mpz_ior (res, op1, op2) |
|
Line 164 mpz_ior (res, op1, op2) |
|
{ |
{ |
/* We should compute -OP1 | OP2. Swap OP1 and OP2 and fall |
/* We should compute -OP1 | OP2. Swap OP1 and OP2 and fall |
through to the code that handles OP1 | -OP2. */ |
through to the code that handles OP1 | -OP2. */ |
{mpz_srcptr t = op1; op1 = op2; op2 = t;} |
MPZ_SRCPTR_SWAP (op1, op2); |
{mp_srcptr t = op1_ptr; op1_ptr = op2_ptr; op2_ptr = t;} |
MPN_SRCPTR_SWAP (op1_ptr,op1_size, op2_ptr,op2_size); |
{mp_size_t t = op1_size; op1_size = op2_size; op2_size = t;} |
|
} |
} |
} |
} |
|
|
Line 187 mpz_ior (res, op1, op2) |
|
Line 187 mpz_ior (res, op1, op2) |
|
opx = (mp_ptr) TMP_ALLOC (op2_size * BYTES_PER_MP_LIMB); |
opx = (mp_ptr) TMP_ALLOC (op2_size * BYTES_PER_MP_LIMB); |
mpn_sub_1 (opx, op2_ptr, op2_size, (mp_limb_t) 1); |
mpn_sub_1 (opx, op2_ptr, op2_size, (mp_limb_t) 1); |
op2_ptr = opx; |
op2_ptr = opx; |
|
op2_size -= op2_ptr[op2_size - 1] == 0; |
|
|
if (res->_mp_alloc < res_alloc) |
if (res->_mp_alloc < res_alloc) |
{ |
{ |
Line 194 mpz_ior (res, op1, op2) |
|
Line 195 mpz_ior (res, op1, op2) |
|
op1_ptr = op1->_mp_d; |
op1_ptr = op1->_mp_d; |
res_ptr = res->_mp_d; |
res_ptr = res->_mp_d; |
/* Don't re-read OP2_PTR. It points to temporary space--never |
/* Don't re-read OP2_PTR. It points to temporary space--never |
to the space RES->_mp_D used to point to before reallocation. */ |
to the space RES->_mp_d used to point to before reallocation. */ |
} |
} |
|
|
if (op1_size >= op2_size) |
if (op1_size >= op2_size) |