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

cmd/internal/obj: wrong binary generated for TST instruction by the ARM assembler #19357

Closed
benshi001 opened this issue Mar 2, 2017 · 6 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@benshi001
Copy link
Member

benshi001 commented Mar 2, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

the newest go master branch

What operating system and processor architecture are you using (go env)?

GOARCH=arm
GOOS=linux

What did you do?

test the arm assembler

If possible, provide a recipe for reproducing the error.

Wrong 4-byte word assembled

TST $255, R7: have encoding 000050e3, want ff0017e3
TST $4278190080, R9: have encoding 000050e3, want ff0419e3
TST R9<<30, R7: have encoding 000050e3, want 090f17e1
TST R9>>30, R7: have encoding 000050e3, want 290f17e1
TST R9->30, R7: have encoding 000050e3, want 490f17e1
TST R9@>30, R7: have encoding 000050e3, want 690f17e1
TST R9<<R8, R7: have encoding 000050e3, want 190817e1
TST R9>>R8, R7: have encoding 000050e3, want 390817e1
TST R9->R8, R7: have encoding 000050e3, want 590817e1
TST R9@>R8, R7: have encoding 000050e3, want 790817e1

@benshi001
Copy link
Member Author

All variants of TST are encoded to the same 000050e3. Actually TST have 3 different forms as CMP/CMN/TEQ have.

@benshi001
Copy link
Member Author

I have committed a patch to fix this issue.

https://go-review.googlesource.com/#/c/37662/

@gopherbot
Copy link

CL https://golang.org/cl/37662 mentions this issue.

@ALTree ALTree changed the title Wrong binary generated for TST instruction by the ARM assembler cmd/internal/obj: wrong binary generated for TST instruction by the ARM assembler Mar 2, 2017
@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 2, 2017
@ALTree ALTree added this to the Go1.9 milestone Mar 2, 2017
@ALTree
Copy link
Member

ALTree commented Mar 2, 2017

@benshi001 when filing issues, please start the title with the package path and a colon (in this case, "cmd/internal/obj:"). Thanks!

@benshi001
Copy link
Member Author

OK. I learn it. ^_^

@benshi001
Copy link
Member Author

B is also wrongly assembled, I have reported in another #19419.

@golang golang locked and limited conversation to collaborators Mar 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants