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: golang assembler handles arm64 instruction hlt/hvc/smc/brk/clrex incorrectly. #20765

Closed
zhangfannie opened this issue Jun 23, 2017 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@zhangfannie
Copy link
Contributor

zhangfannie commented Jun 23, 2017

Please answer these questions before submitting your issue. Thanks!

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

go version devel +59051da Fri Jun 16 06:05:57 2017 +0000 linux/arm64

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

GOARCH="arm64"
GOBIN=""
GOEXE=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/fanzha02/go"
GORACE=""
GOROOT="/home/fanzha02/work/asm_test/golang_us/golang_1/golang"
GOTOOLDIR="/home/fanzha02/work/asm_test/golang_us/golang_1/golang/pkg/tool/linux_arm64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build468264647=/tmp/go-build -gno-record-gcc-switches"
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"

What did you do?

cd src/cmd/asm/internal/asm
add arm64enc.s test file
enable the ARM64Encoder test command
go test -run "ARM64Encoder"

arm64enc.s test file and endtoend_test.go you can load from this patch:
https://go-review.googlesource.com/c/46438/1

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

go test successfully

What did you see instead?

the hlt/hvc/smc/brk/clrex test cases are failed

@gopherbot
Copy link

CL https://golang.org/cl/46438 mentions this issue.

@cherrymui
Copy link
Member

cd src/cmd/asm/internal/asm
add arm64enc.s test file
enable the ARM64Encoder test command
go test -run "ARM64Encoder"

Instead of throwing a big test in a pending CL, could you describe what the correct encoding should be, and what wrong encoding it currently generates? Thanks!

@zhangfannie
Copy link
Contributor Author

zhangfannie commented Jun 26, 2017

@cherrymui Please refer to the following information. Thanks.
BRK $35943 the current assembly have encoding 000020d4, the correct encoding e08c31d4
CLREX $4 have encoding 5f3f03d5, 5f3403d5
DCPS1 $11378 have encoding 0100a0d4, 418ea5d4
DCPS2 $10699 have encoding 0200a0d4, 6239a5d4
DCPS3 $24415 have encoding 0300a0d4, e3ebabd4
HLT $65509 have encoding 000040d4, a0fc5fd4
HVC $61428 have encoding 020000d4, 82fe1dd4
SMC $37977 have encoding 030000d4, 238b12d4

@ALTree ALTree added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 14, 2017
@ALTree ALTree added this to the Go1.10 milestone Nov 14, 2017
@gopherbot
Copy link

Change https://golang.org/cl/78275 mentions this issue: cmd/internal/obj/arm64: fix assemble hlt/hvc/smc/brk/clrex bug

@golang golang locked and limited conversation to collaborators Nov 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants