Skip to content

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

Open

Description

@clausecker

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.

Activity

  1. martisch commented on Sep 9, 2020

    @martisch
    Contributor

    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.

  2. clausecker commented on Sep 9, 2020

    @clausecker
    Author

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

  3. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Sep 10, 2020
  4. added this to the Unplanned milestone on Sep 10, 2020
  5. andybons commented on Sep 10, 2020

    @andybons
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions