variableScope

This commit is contained in:
gtsoul-tech
2024-04-29 13:13:07 +03:00
parent 62e3450eae
commit 987cd17160
17 changed files with 45 additions and 55 deletions

View File

@@ -155,13 +155,13 @@ u32 compress32_impl_c(u32 x, u32 m) {
return 0;
}
u32 mk, mp, mv, t;
u32 mk, mv;
x &= m; // clear irrelevant bits
mk = ~m << 1; // we will count 0's to right
for (u32 i = 0; i < 5; i++) {
mp = mk ^ (mk << 1);
u32 mp = mk ^ (mk << 1);
mp ^= mp << 2;
mp ^= mp << 4;
mp ^= mp << 8;
@@ -169,7 +169,7 @@ u32 compress32_impl_c(u32 x, u32 m) {
mv = mp & m; // bits to move
m = (m ^ mv) | (mv >> (1 << i)); // compress m
t = x & mv;
u32 t = x & mv;
x = (x ^ t) | (t >> (1 << i)); // compress x
mk = mk & ~mp;
}
@@ -239,14 +239,14 @@ u32 expand32_impl_c(u32 x, u32 m) {
return 0;
}
u32 m0, mk, mp, mv, t;
u32 m0, mk, mv;
u32 array[5];
m0 = m; // save original mask
mk = ~m << 1; // we will count 0's to right
for (int i = 0; i < 5; i++) {
mp = mk ^ (mk << 1); // parallel suffix
u32 mp = mk ^ (mk << 1); // parallel suffix
mp = mp ^ (mp << 2);
mp = mp ^ (mp << 4);
mp = mp ^ (mp << 8);
@@ -259,7 +259,7 @@ u32 expand32_impl_c(u32 x, u32 m) {
for (int i = 4; i >= 0; i--) {
mv = array[i];
t = x << (1 << i);
u32 t = x << (1 << i);
x = (x & ~mv) | (t & mv);
}
@@ -409,7 +409,7 @@ u64a pdep64_impl_c(u64a x, u64a _m) {
u64a result = 0x0UL;
const u64a mask = 0x8000000000000000UL;
u64a m = _m;
u64a c, t;
u64a p;
/* The pop-count of the mask gives the number of the bits from
@@ -421,8 +421,8 @@ u64a pdep64_impl_c(u64a x, u64a _m) {
each mask bit as it is processed. */
while (m != 0)
{
c = __builtin_clzl (m);
t = x << (p - c);
u64a c = __builtin_clzl (m);
u64a t = x << (p - c);
m ^= (mask >> c);
result |= (t & (mask >> c));
p++;