-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/asm: x86, incorrect Optab entry - PSRLW #13010
Labels
Milestone
Comments
CL https://golang.org/cl/16168 mentions this issue. |
@bjwbell Thanks for the report. |
bjwbell
added a commit
to bjwbell/gensimd
that referenced
this issue
Oct 22, 2015
The u16x8 SHR support includes a workaround for a go compiler bug, "cmd/asm: x86, incorrect Optab entry - PSRLW" golang/go#13010
This is bad but not bad enough to be in Go 1.5.2.
|
Thanks Russ |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In
src/cmd/internal/obj/x86/asm6.go
, theOptab
table entryshould instead be
As it is now, if the shift amount is specified in a xmm register then PSRLW actually performs an arithmetic shift right i.e. PSRAW.
The issue can be reproduced with the below assembly function by calling it with
shift := uint8(1)
andx := [8]uint16{65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535}
The expected return value is
[8]uint16{32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767}
The actual return value is
[8]uint16{65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535}
Apologies for the redundant loads/stores in the assembly, it's output from code generation.
The text was updated successfully, but these errors were encountered: