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/arm64: minor mistake in pre-increment example #39367

Closed
fwessels opened this issue Jun 2, 2020 · 5 comments
Closed

cmd/internal/obj/arm64: minor mistake in pre-increment example #39367

fwessels opened this issue Jun 2, 2020 · 5 comments
Labels
arch-arm64 Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@fwessels
Copy link

fwessels commented Jun 2, 2020

The following URL contains a minor mistake: https://golang.org/pkg/cmd/internal/obj/arm64/

Under point 2 ("Go uses .P and .W suffixes to indicate post-increment and pre-increment.") there is a mismatch between the Go assembly and the GNU syntax (for the pre-increment with .W suffix).

Specifically Go assembly loads a signed-byte with MOVB whereas the GNU syntax loads an (unsigned) 64-bit double-word with ldr.

So either the example should be this

MOVB.W 16(R16), R10        <=>      ldrsb x10, [x16,#16]!

or

MOVD.W 16(R16), R10        <=>      ldr x10, [x16,#16]!

or even

MOVBU.W 16(R16), R10        <=>     ldrb x10, [x16,#16]!
@gopherbot gopherbot added this to the Unreleased milestone Jun 2, 2020
@dmitshur dmitshur changed the title x/website: Package arm64: minor mistake in pre-increment example cmd/internal/obj/arm64: minor mistake in pre-increment example Jun 2, 2020
@dmitshur dmitshur added arch-arm64 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 2, 2020
@dmitshur dmitshur modified the milestones: Unreleased, Backlog Jun 2, 2020
@dmitshur
Copy link
Contributor

dmitshur commented Jun 2, 2020

/cc @dr2chase @cherrymui

@dmitshur dmitshur added the Documentation Issues describing a change to documentation. label Jun 2, 2020
@cherrymui
Copy link
Member

cc @zhangfannie

@zhangfannie
Copy link
Contributor

@fwessels Thank you for pointing out the mistake in https://golang.org/pkg/cmd/internal/obj/arm64/. The arm64 go assembler has the correct encoding for instruction " MOVB.W 16(R16), R10 ", we just have a typo in this document. I will submit a patch to fix this error. Thanks.

@fwessels
Copy link
Author

fwessels commented Jun 3, 2020

Yes, correct, it is just a documentation error, luckily not in the assembler itself.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 3, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/236217 mentions this issue: cmd/internal/obj/arm64: fix typos in document

@golang golang locked and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants