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: x86 assembly REP MOVSB instruction not works #60620

Closed
cocotyty opened this issue Jun 6, 2023 · 2 comments
Closed

cmd/asm: x86 assembly REP MOVSB instruction not works #60620

cocotyty opened this issue Jun 6, 2023 · 2 comments

Comments

@cocotyty
Copy link

cocotyty commented Jun 6, 2023

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

$ go version
go version go1.20.4 linux/amd64

Does this issue reproduce with the latest release?

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tangyang/.cache/go-build"
GOENV="/home/tangyang/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/tangyang/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tangyang/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2407807130=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Write a asm file , contains:
REP MOVSB

What did you expect to see?

Compile successfully

What did you see instead?

/xxx.s:406: illegal or missing addressing mode for symbol MOVSB

@randall77
Copy link
Contributor

See, e..g, runtime/asm_amd64.s for a correct use of REP.
In particular, you should write it as

    REP; MOVSB

With the semicolon.

Please reopen this issue if that fix doesn't work for you. When you reopen, please include an entire .s file that isn't compiling, so we can reproduce on our end.

@randall77 randall77 changed the title affected/package: x86 assembly REP MOVSB instruction not works cmd/asm: x86 assembly REP MOVSB instruction not works Jun 6, 2023
@cocotyty
Copy link
Author

cocotyty commented Jun 6, 2023

See, e..g, runtime/asm_amd64.s for a correct use of REP. In particular, you should write it as

    REP; MOVSB

With the semicolon.

Please reopen this issue if that fix doesn't work for you. When you reopen, please include an entire .s file that isn't compiling, so we can reproduce on our end.

Thank you for your help! It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants