Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shift bug #1

Open
avater210 opened this issue Jan 25, 2024 · 0 comments
Open

shift bug #1

avater210 opened this issue Jan 25, 2024 · 0 comments

Comments

@avater210
Copy link

移位逻辑上是>=32移出去就好,但是在x86上shr shl等指令实现是只看寄存器或者变量的后5位,其它位mask掉,即只支持0-31,我看这里考虑了右移,左移也会有问题同样问题。

if (bb.logBinary.exp >= 127)
dx = dx << (bb.logBinary.exp - 127);
else if (bb.logBinary.exp >= 103)
// dx >> 32 is dx in msvc.
dx = dx >> (127 - bb.logBinary.exp);
else
dx = 0;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant