Skip to content

Commit

Permalink
remove register
Browse files Browse the repository at this point in the history
let the compiler find the best register optimization
  • Loading branch information
fperrad authored and sjaeckel committed Dec 2, 2015
1 parent edef6ca commit 8714ee5
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
16 changes: 8 additions & 8 deletions bn_fast_mp_montgomery_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
* an array of double precision words W[...]
*/
{
register mp_word *_W;
register mp_digit *tmpx;
mp_word *_W;
mp_digit *tmpx;

/* alias for the W[] array */
_W = W;
Expand Down Expand Up @@ -72,7 +72,7 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
* by casting the value down to a mp_digit. Note this requires
* that W[ix-1] have the carry cleared (see after the inner loop)
*/
register mp_digit mu;
mp_digit mu;
mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK);

/* a = a + mu * m * b**i
Expand All @@ -90,9 +90,9 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
* first m->used words of W[] have the carries fixed
*/
{
register int iy;
register mp_digit *tmpn;
register mp_word *_W;
int iy;
mp_digit *tmpn;
mp_word *_W;

/* alias for the digits of the modulus */
tmpn = n->dp;
Expand All @@ -115,8 +115,8 @@ int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)
* significant digits we zeroed].
*/
{
register mp_digit *tmpx;
register mp_word *_W, *_W1;
mp_digit *tmpx;
mp_word *_W, *_W1;

/* nox fix rest of carries */

Expand Down
4 changes: 2 additions & 2 deletions bn_fast_s_mp_mul_digs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
{
int olduse, res, pa, ix, iz;
mp_digit W[MP_WARRAY];
register mp_word _W;
mp_word _W;

/* grow the destination as required */
if (c->alloc < digs) {
Expand Down Expand Up @@ -85,7 +85,7 @@ int fast_s_mp_mul_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
c->used = pa;

{
register mp_digit *tmpc;
mp_digit *tmpc;
tmpc = c->dp;
for (ix = 0; ix < (pa + 1); ix++) {
/* now extract the previous digit [below the carry] */
Expand Down
2 changes: 1 addition & 1 deletion bn_fast_s_mp_mul_high_digs.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int fast_s_mp_mul_high_digs (mp_int * a, mp_int * b, mp_int * c, int digs)
c->used = pa;

{
register mp_digit *tmpc;
mp_digit *tmpc;

tmpc = c->dp + digs;
for (ix = digs; ix < pa; ix++) {
Expand Down
2 changes: 1 addition & 1 deletion bn_mp_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mp_copy (mp_int * a, mp_int * b)

/* zero b and copy the parameters over */
{
register mp_digit *tmpa, *tmpb;
mp_digit *tmpa, *tmpb;

/* pointer aliases */

Expand Down
2 changes: 1 addition & 1 deletion bn_mp_div_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int mp_div_2(mp_int * a, mp_int * b)
oldused = b->used;
b->used = a->used;
{
register mp_digit r, rr, *tmpa, *tmpb;
mp_digit r, rr, *tmpa, *tmpb;

/* source alias */
tmpa = a->dp + b->used - 1;
Expand Down
2 changes: 1 addition & 1 deletion bn_mp_div_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int mp_div_2d (mp_int * a, int b, mp_int * c, mp_int * d)
/* shift any bit count < DIGIT_BIT */
D = (mp_digit) (b % DIGIT_BIT);
if (D != 0) {
register mp_digit *tmpc, mask, shift;
mp_digit *tmpc, mask, shift;

/* mask */
mask = (((mp_digit)1) << D) - 1;
Expand Down
4 changes: 2 additions & 2 deletions bn_mp_karatsuba_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int mp_karatsuba_mul (mp_int * a, mp_int * b, mp_int * c)
y1.used = b->used - B;

{
register int x;
register mp_digit *tmpa, *tmpb, *tmpx, *tmpy;
int x;
mp_digit *tmpa, *tmpb, *tmpx, *tmpy;

/* we copy the digits directly instead of using higher level functions
* since we also need to shift the digits
Expand Down
4 changes: 2 additions & 2 deletions bn_mp_karatsuba_sqr.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ int mp_karatsuba_sqr (mp_int * a, mp_int * b)
goto X0X0;

{
register int x;
register mp_digit *dst, *src;
int x;
mp_digit *dst, *src;

src = a->dp;

Expand Down
2 changes: 1 addition & 1 deletion bn_mp_lshd.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int mp_lshd (mp_int * a, int b)
}

{
register mp_digit *top, *bottom;
mp_digit *top, *bottom;

/* increment the used by the shift amount then copy upwards */
a->used += b;
Expand Down
6 changes: 3 additions & 3 deletions bn_mp_montgomery_reduce.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho)

/* a = a + mu * m * b**i */
{
register int iy;
register mp_digit *tmpn, *tmpx, u;
register mp_word r;
int iy;
mp_digit *tmpn, *tmpx, u;
mp_word r;

/* alias for digits of the modulus */
tmpn = n->dp;
Expand Down
2 changes: 1 addition & 1 deletion bn_mp_mul_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int mp_mul_2(mp_int * a, mp_int * b)
b->used = a->used;

{
register mp_digit r, rr, *tmpa, *tmpb;
mp_digit r, rr, *tmpa, *tmpb;

/* alias for source */
tmpa = a->dp;
Expand Down
4 changes: 2 additions & 2 deletions bn_mp_mul_2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ int mp_mul_2d (mp_int * a, int b, mp_int * c)
/* shift any bit count < DIGIT_BIT */
d = (mp_digit) (b % DIGIT_BIT);
if (d != 0) {
register mp_digit *tmpc, shift, mask, r, rr;
register int x;
mp_digit *tmpc, shift, mask, r, rr;
int x;

/* bitmask for carries */
mask = (((mp_digit)1) << d) - 1;
Expand Down
2 changes: 1 addition & 1 deletion bn_mp_rshd.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void mp_rshd (mp_int * a, int b)
}

{
register mp_digit *bottom, *top;
mp_digit *bottom, *top;

/* shift the digits down */

Expand Down
4 changes: 2 additions & 2 deletions bn_s_mp_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ s_mp_add (mp_int * a, mp_int * b, mp_int * c)
c->used = max + 1;

{
register mp_digit u, *tmpa, *tmpb, *tmpc;
register int i;
mp_digit u, *tmpa, *tmpb, *tmpc;
int i;

/* alias for digit pointers */

Expand Down
4 changes: 2 additions & 2 deletions bn_s_mp_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ s_mp_sub (mp_int * a, mp_int * b, mp_int * c)
c->used = max;

{
register mp_digit u, *tmpa, *tmpb, *tmpc;
register int i;
mp_digit u, *tmpa, *tmpb, *tmpc;
int i;

/* alias for digit pointers */
tmpa = a->dp;
Expand Down

0 comments on commit 8714ee5

Please sign in to comment.