"Fossies" - the Fresh Open Source Software Archive

Member "gmp-6.2.1/mpn/s390_32/README" (14 Nov 2020, 899 Bytes) of package /linux/misc/gmp-6.2.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 All current (2001) S/390 and z/Architecture machines are single-issue,
    2 but some newer machines have a deep pipeline.  Software-pipelining is
    3 therefore beneficial.
    4 
    5 * mpn_add_n, mpn_sub_n: Use code along the lines below.  Two-way unrolling
    6   would be adequate.
    7 
    8   mp_limb_t
    9   mpn_add_n (mp_ptr rp, mp_srcptr up, mp_srcptr vp, mp_size_t n)
   10   {
   11     mp_limb_t a, b, r, cy;
   12     mp_size_t i;
   13     mp_limb_t mm = -1;
   14 
   15     cy = 0;
   16     up += n;
   17     vp += n;
   18     rp += n;
   19     i = -n;
   20     do
   21       {
   22 	a = up[i];
   23 	b = vp[i];
   24 	r = a + b + cy;
   25 	rp[i] = r;
   26 	cy = (((a & b) | ((a | b) & (r ^ mm)))) >> 31;
   27 	i++;
   28       }
   29     while (i < 0);
   30     return cy;
   31   }
   32 
   33 * mpn_lshift, mpn_rshift: Use SLDL/SRDL, and two-way unrolling.
   34 
   35 * mpn_mul_1, mpn_addmul_1, mpn_submul_1: For machines with just signed
   36   multiply (MR), use two loops, similar to the corresponding VAX or
   37   POWER functions.  Handle carry like for mpn_add_n.