P
Patrick
Hi
I have a basic question concerning rotations and bitmasking.
Assume the following code fragement.
uint32 p_lo[] = { 0x00, 0x00};
for (j = 0; j < 64; j++ )
p_lo[0] <<= (j % 32);
p_lo[1] <<= (j % 32);
p_lo[1] |= (p_hi[0] >> (32 - (j % 32)));
}
I itend to do the following. In each iteration shift each element of
the array by an amount of
n. Additionally, the n-bits that are shifted out of each word should
be the least significant bits of the next higher
word. This I try to do by shifting the lower word by 32 - n positions
to the left and OR then the result
with the next higher word. Unfortunately the output does not make
sense.
Has anyone an idea what I am missing?
Many thanks,
Patrick
I have a basic question concerning rotations and bitmasking.
Assume the following code fragement.
uint32 p_lo[] = { 0x00, 0x00};
for (j = 0; j < 64; j++ )
p_lo[0] <<= (j % 32);
p_lo[1] <<= (j % 32);
p_lo[1] |= (p_hi[0] >> (32 - (j % 32)));
}
I itend to do the following. In each iteration shift each element of
the array by an amount of
n. Additionally, the n-bits that are shifted out of each word should
be the least significant bits of the next higher
word. This I try to do by shifting the lower word by 32 - n positions
to the left and OR then the result
with the next higher word. Unfortunately the output does not make
sense.
Has anyone an idea what I am missing?
Many thanks,
Patrick