Skip to content

cmd/internal/obj/s390x: VSTRC vector instruction emitting incorrectly for few of extended mnemonics #69216

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

Closed
srinivas-pokala opened this issue Sep 2, 2024 · 3 comments
Assignees
Labels
arch-s390x Issues solely affecting the s390x architecture. NeedsFix The path to resolution is known, but the work has not been done.

Comments

@srinivas-pokala
Copy link
Contributor

Go version

go 1.24

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='s390x'
GOBIN='/root/go/bin'
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='s390x'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/go_compiler/dev/go_src'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/go_compiler/dev/go_src/pkg/tool/linux_s390x'
GOVCS=''
GOVERSION='devel go1.24-fc9f02c7ae Sun Sep 1 15:47:54 2024 +0000'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GCCGO='gccgo'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/root/go_compiler/dev/go_src/src/cmd/go.mod'
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 -march=z196 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1827913230=/tmp/go-build -gno-record-gcc-switches'

What did you do?

  1. Add all possible VSTRC vector instructions to the go asm file
  2. go tool asm <*.s> -o <filemame.o>
  3. go tool objdump -gnu <filename.o>

What did you see happen?

s390x assembler emitting incorrectly VSTRC vector instruction for few of extended mnemonics.
VSTRC V2, V4, V6, V3
VSTRCB V2, V4, V6, V8
VSTRCH V2, V4, V6, V8
VSTRCF V2, V4, V6, V8
VSTRCBS V2, V4, V6, V8
VSTRCHS V2, V4, V6, V8
VSTRCFS V2, V4, V6, V8
VSTRCZB V2, V4, V6, V8
VSTRCZH V2, V4, V6, V8
VSTRCZF V2, V4, V6, V8
VSTRCZBS V2, V4, V6, V8
VSTRCZHS V2, V4, V6, V8
VSTRCZFS V2, V4, V6, V8

when we do assembly of go asm(*.s) file with above instructions(go tool asm <file_name.s> -o <file_name.o>) and when we try to disassemble resulting object file(file_name.o) it resulting incorrect native(GNU) instructions for some of extended mnemonics as below.
vstrcb %v6,%v2,%v4,%v6
vstrch %v8,%v2,%v4,%v6
vstrcf %v8,%v2,%v4,%v6
vstrcb %v8,%v2,%v4,%v6
vstrch %v8,%v2,%v4,%v6
vstrcf %v8,%v2,%v4,%v6
vstrcb %v8,%v2,%v4,%v6
vstrch %v8,%v2,%v4,%v6
vstrcf %v8,%v2,%v4,%v6
vstrcb %v8,%v2,%v4,%v6
vstrch %v8,%v2,%v4,%v6
vstrcf %v8,%v2,%v4,%v6

What did you expect to see?

Need to fix in the codegen part of s390x assembler which handles code emitting.

@srinivas-pokala srinivas-pokala self-assigned this Sep 2, 2024
@srinivas-pokala srinivas-pokala added the arch-s390x Issues solely affecting the s390x architecture. label Sep 2, 2024
@srinivas-pokala
Copy link
Contributor Author

I have fixed the issue and verified locally on my machine, will the raise CL for the same.

@srinivas-pokala srinivas-pokala added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 2, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/612315 mentions this issue: cmd/internal/obj/s390x: VSTRC vector instruction emits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-s390x Issues solely affecting the s390x architecture. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants