-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/internal/obj/x86: invalid zoffset for ymmxmm0f38[1] #21286
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
Comments
It may have something to do with Code seems overly complex, identifier names are unhelpful and inconsistent. |
IIRC it was mechanically translated from c code. Definitely not the most pleasant part of the toolchain to work on. |
Ok, it really needs "investigation", because simple expectations does not work. // works
var ymmxmm0f38 = []ytab{
{Ymm, Ynone, Ymr, Zlitm_r, 3}, // Does not count trailing "0"
{Yxm, Ynone, Yxr, Zlitm_r, 5}, // Does count trailing "0"
}
{0x0F, 0x38, 0x02, 0, 0x66, 0x0F, 0x38, 0x02, 0}
// => maybe "0" is not counted?
// - does not work
var ymmxmm0f38 = []ytab{
{Yxm, Ynone, Yxr, Zlitm_r, 4}, // Switched 2 lines; does not count trailing "0"
{Ymm, Ynone, Ymr, Zlitm_r, 3},
}
{0x66, 0x0F, 0x38, 0x02, 0, 0x0F, 0x38, 0x02, 0} // Swapped zero-terminating byte sequences
// also does not work
var ymmxmm0f38 = []ytab{
{Ymm, Ynone, Ymr, Zlitm_r, 4}, // Set zoffset to 4
{Yxm, Ynone, Yxr, Zlitm_r, 5},
}
{0x0F, 0x38, 0x02, 0, 0x66, 0x0F, 0x38, 0x02, 0} The observation is that "0" must be counted for There is also odd line like |
My guess is: |
Even if there is no bug, it would be really nice to condense what you learned down to some comments in the code. |
There is no bug. |
Problem:
I think there is a bug inside
cmd/internal/obj/x86/asm6.go
.Suspicious lines:
link to sources
The
zoffset
field of 2-nd element ofymmxmm0f38
seems incorrect.Here is
optab
item for additional context:link to sources
Potential solution:
5
should be replaced with4
(If I get it right).Severity:
This bug never triggers because
zoffset
does not matterfor last
ytab
entry.Affects only code clarity and correctness, I guess.
The text was updated successfully, but these errors were encountered: