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: the encoding of VMOVQ instruction is wrong #50528

Closed
erifan opened this issue Jan 10, 2022 · 1 comment · Fixed by ferrmin/go#267
Closed

cmd/internal/obj/arm64: the encoding of VMOVQ instruction is wrong #50528

erifan opened this issue Jan 10, 2022 · 1 comment · Fixed by ferrmin/go#267
Labels
arch-arm64 FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@erifan
Copy link

erifan commented Jan 10, 2022

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

$ go version
tip

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
Linux arm64

What did you do?

VMOVQ $0x1122334455667788, $8877665544332211, V2

What did you expect to see?

As https://pkg.go.dev/cmd/internal/obj/arm64 descripted, the value of V2 should be 0x11223344556677888877665544332211.

What did you see instead?

The value of V2 is 0x88776655443322111122334455667788.

I'm working on a fix.

@erifan erifan self-assigned this Jan 10, 2022
@gopherbot
Copy link

Change https://golang.org/cl/377055 mentions this issue: cmd/internal/obj/arm64: fix VMOVQ instruction encoding error

@seankhliao seankhliao added arch-arm64 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 16, 2022
jproberts pushed a commit to jproberts/go that referenced this issue Jun 21, 2022
The VMOVQ instruction stores a 128-bit number into a V register, for
example:
    VMOVQ $0x1122334455667788, $0x99aabbccddeeff00, V2
From a documentation (https://pkg.go.dev/cmd/internal/obj/arm64) point
of view, the value in V2 should be 0x112233445566778899aabbccddeeff00,
however the value is actually 0x99aabbccddeeff001122334455667788. The
reason is that we misplaced the high 64-bit and the low 64-bit in the
literal pool. To maintain backward compatibility, this CL adjusts the
rule of VMOVQ instruction to make the documentation consistent with the
code.

Fixes golang#50528

Change-Id: Ib51f59e97c55252ab2a50bbc6ba4d430732a7a04
Reviewed-on: https://go-review.googlesource.com/c/go/+/377055
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Eric Fang <eric.fang@arm.com>
Run-TryBot: Eric Fang <eric.fang@arm.com>
Trust: Eric Fang <eric.fang@arm.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
@rsc rsc unassigned erifan Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants