Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Jahns
yaxt
Commits
3d51a7b6
Commit
3d51a7b6
authored
Apr 09, 2020
by
Thomas Jahns
🤸
Browse files
Make precedence of shift operator explicit.
parent
12b9eead
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/xt_arithmetic_long.h
View file @
3d51a7b6
...
...
@@ -548,13 +548,13 @@ xdivmnu(Xt_ushort *restrict q, Xt_ushort *restrict r,
s
=
xinlz
(
v
[
n
-
1
])
-
xt_hint_bits
;
// 0 <= s <= 15.
Xt_ushort
vn
[
n
];
/* normalized v */
for
(
int
i
=
n
-
1
;
i
>
0
;
i
--
)
vn
[
i
]
=
(
v
[
i
]
<<
s
)
|
(
v
[
i
-
1
]
>>
xt_hint_bits
-
s
);
vn
[
i
]
=
(
v
[
i
]
<<
s
)
|
(
v
[
i
-
1
]
>>
(
xt_hint_bits
-
s
)
)
;
vn
[
0
]
=
v
[
0
]
<<
s
;
Xt_ushort
un
[
m
+
1
];
/* normalized u */
un
[
m
]
=
u
[
m
-
1
]
>>
(
xt_hint_bits
-
s
);
for
(
int
i
=
m
-
1
;
i
>
0
;
i
--
)
un
[
i
]
=
(
u
[
i
]
<<
s
)
|
(
u
[
i
-
1
]
>>
xt_hint_bits
-
s
);
un
[
i
]
=
(
u
[
i
]
<<
s
)
|
(
u
[
i
-
1
]
>>
(
xt_hint_bits
-
s
)
)
;
un
[
0
]
=
u
[
0
]
<<
s
;
for
(
int
j
=
m
-
n
;
j
>=
0
;
j
--
)
{
// Main loop.
...
...
@@ -590,13 +590,12 @@ xdivmnu(Xt_ushort *restrict q, Xt_ushort *restrict r,
un
[
j
+
n
]
=
un
[
j
+
n
]
+
k
;
}
}
// End j.
// If the caller wants the remainder, unnormalize
// it and pass it back.
if
(
r
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
r
[
i
]
=
(
un
[
i
]
>>
s
)
|
(
un
[
i
+
1
]
<<
xt_hint_bits
-
s
);
}
return
;
// If the caller wants the remainder, unnormalize
// it and pass it back.
if
(
r
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
r
[
i
]
=
(
un
[
i
]
>>
s
)
|
(
un
[
i
+
1
]
<<
(
xt_hint_bits
-
s
));
}
}
static
inline
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment