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/asm: VMOVQ misassembled to VMOVD on 386 #41295

Open
clausecker opened this issue Sep 9, 2020 · 3 comments
Open

cmd/asm: VMOVQ misassembled to VMOVD on 386 #41295

clausecker opened this issue Sep 9, 2020 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@clausecker
Copy link

clausecker commented Sep 9, 2020

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

$ go version
go version go1.15 linux/amd64

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
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build142714031=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Create an assembly file with the following content, assemble it for 386:

TEXT foo<>(SB), 4, $0
	VMOVQ (SI),X0

Then, dump the resulting object file.

What did you expect to see?

An instruction VMOVQ (SI), X0 with encoding c5fa7e06.

What do you see instead?

A weirdly assembled VMOVD (SI), X0 with encoding c4e1f96e06. It appears that the assembler mis-assembles VMOVQ to VMOVD on 386.

@martisch
Copy link
Contributor

martisch commented Sep 9, 2020

Does VMOVQ (SI), AX exist?

c5fa7e06 seems to be VMOVQ (SI), X0 in another disassembler I tried and https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2b-manual.pdf seems to suggest VMOVQ only works from or into xmm registers.

@clausecker
Copy link
Author

Sorry. This was a typo. I meant to write VMOVQ (SI), X0 of course.

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 10, 2020
@andybons andybons added this to the Unplanned milestone Sep 10, 2020
@andybons
Copy link
Member

@cherrymui

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants