beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / s390_32 / README
blob59519ba538461b1da9933df9ee41ce6a4a5f52fc
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.
5 * mpn_add_n, mpn_sub_n: Use code along the lines below.  Two-way unrolling
6   would be adequate.
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;
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   }
33 * mpn_lshift, mpn_rshift: Use SLDL/SRDL, and two-way unrolling.
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.