Home | History | Annotate | Line # | Download | only in generic
      1  1.1  mrg /* mpn_sec_add_1, mpn_sec_sub_1
      2  1.1  mrg 
      3  1.1  mrg    Contributed to the GNU project by Niels Mller
      4  1.1  mrg 
      5  1.1  mrg Copyright 2013, 2014 Free Software Foundation, Inc.
      6  1.1  mrg 
      7  1.1  mrg This file is part of the GNU MP Library.
      8  1.1  mrg 
      9  1.1  mrg The GNU MP Library is free software; you can redistribute it and/or modify
     10  1.1  mrg it under the terms of either:
     11  1.1  mrg 
     12  1.1  mrg   * the GNU Lesser General Public License as published by the Free
     13  1.1  mrg     Software Foundation; either version 3 of the License, or (at your
     14  1.1  mrg     option) any later version.
     15  1.1  mrg 
     16  1.1  mrg or
     17  1.1  mrg 
     18  1.1  mrg   * the GNU General Public License as published by the Free Software
     19  1.1  mrg     Foundation; either version 2 of the License, or (at your option) any
     20  1.1  mrg     later version.
     21  1.1  mrg 
     22  1.1  mrg or both in parallel, as here.
     23  1.1  mrg 
     24  1.1  mrg The GNU MP Library is distributed in the hope that it will be useful, but
     25  1.1  mrg WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
     26  1.1  mrg or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     27  1.1  mrg for more details.
     28  1.1  mrg 
     29  1.1  mrg You should have received copies of the GNU General Public License and the
     30  1.1  mrg GNU Lesser General Public License along with the GNU MP Library.  If not,
     31  1.1  mrg see https://www.gnu.org/licenses/.  */
     32  1.1  mrg 
     33  1.1  mrg #include "gmp-impl.h"
     34  1.1  mrg 
     35  1.1  mrg #if OPERATION_sec_add_1
     36  1.1  mrg #define FNAME mpn_sec_add_1
     37  1.1  mrg #define FNAME_itch mpn_sec_add_1_itch
     38  1.1  mrg #define OP_N mpn_add_n
     39  1.1  mrg #endif
     40  1.1  mrg #if OPERATION_sec_sub_1
     41  1.1  mrg #define FNAME mpn_sec_sub_1
     42  1.1  mrg #define FNAME_itch mpn_sec_sub_1_itch
     43  1.1  mrg #define OP_N mpn_sub_n
     44  1.1  mrg #endif
     45  1.1  mrg 
     46  1.1  mrg /* It's annoying to that we need scratch space */
     47  1.1  mrg mp_size_t
     48  1.1  mrg FNAME_itch (mp_size_t n)
     49  1.1  mrg {
     50  1.1  mrg   return n;
     51  1.1  mrg }
     52  1.1  mrg 
     53  1.1  mrg mp_limb_t
     54  1.1  mrg FNAME (mp_ptr rp, mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_ptr scratch)
     55  1.1  mrg {
     56  1.1  mrg   scratch[0] = b;
     57  1.1  mrg   MPN_ZERO (scratch + 1, n-1);
     58  1.1  mrg   return OP_N (rp, ap, scratch, n);
     59  1.1  mrg }
     60