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/compile: wrong VLD1 instruction implement on ARM64 #23448

Closed
mengzhuo opened this issue Jan 15, 2018 · 6 comments
Closed

cmd/compile: wrong VLD1 instruction implement on ARM64 #23448

mengzhuo opened this issue Jan 15, 2018 · 6 comments

Comments

@mengzhuo
Copy link
Contributor

What did you do?

compile vld1 instructions

#include "textflag.h"

TEXT ·vld(SB),NOSPLIT, $-8-0
    VLD1  (R0)(R10), [V1.B16]
    VLD1  (R0), [V1.B16]

What did you expect to see?

VLD from R0 offset by R10

What did you see instead?

same instruction 0x4c407001

TEXT _/root/test.vld(SB) /root/test/main_arm64.s
  main_arm64.s:4        0xe6650                 4c407001                VLD1 (R0), [V1.B16]
  main_arm64.s:5        0xe6654                 4c407001                VLD1 (R0), [V1.B16]
  main_arm64.s:5        0xe6658                 00000000                ?
  main_arm64.s:5        0xe665c                 00000000                ?

Does this issue reproduce with the latest release (go1.9.2)?

1.9.2 does not support VLD instructions

# _/root/test
./main_arm64.s:4: unrecognized instruction "VLD1"
./main_arm64.s:5: unrecognized instruction "VLD1"
asm: assembly of ./main_arm64.s failed

System details

go version devel +3968705 Mon Jan 15 03:01:20 2018 +0000 linux/arm64
GOARCH="arm64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/go"
GORACE=""
GOROOT="/root/godev"
GOTMPDIR=""
GOTOOLDIR="/root/godev/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build321456966=/tmp/go-build -g
no-record-gcc-switches"
GOROOT/bin/go version: go version devel +3968705 Mon Jan 15 03:01:20 2018 +0000 linux/arm64
GOROOT/bin/go tool compile -V: compile version devel +3968705 Mon Jan 15 03:01:20 2018 +0000
uname -sr: Linux 4.4.49-s5p6818
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:        16.04
Codename:       xenial
/lib/aarch64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.23-0ubuntu5) stable release version 2.23
, by Roland McGrath et al.
@randall77
Copy link
Contributor

@cherrymui
Copy link
Member

cherrymui commented Jan 15, 2018

If I read the architecture's manual correctly, I don't think VLD1 instruction accepts offset. Only the post-increment form VLD1.P does. Maybe we should reject plain VLD1 with non-zero offset (instead of silently drop the offset).

@randall77
Copy link
Contributor

Yes, we should either assemble it correctly or reject it. Silently misassembling is bad.

@williamweixiao
Copy link
Member

We need to reject it if it's VLD1 instead of VLD1.P. @zhangfannie We'll fix it ASAP.

@zhangfannie
Copy link
Contributor

@williamweixiao ok.

@gopherbot
Copy link

Change https://golang.org/cl/87956 mentions this issue: cmd/internal/obj/arm64: fix assemble VLD1 bug

@golang golang locked and limited conversation to collaborators Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants