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

x/arch/x86/x86asm: add AVX-256 and AVX-512 registers and instructions #47307

Open
TACIXAT opened this issue Jul 21, 2021 · 2 comments
Open

x/arch/x86/x86asm: add AVX-256 and AVX-512 registers and instructions #47307

TACIXAT opened this issue Jul 21, 2021 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@TACIXAT
Copy link

TACIXAT commented Jul 21, 2021

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

$ go version
go version go1.15.8 windows/amd64

Does this issue reproduce with the latest release?

Didn't try. Documentation says no.

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\me\AppData\Local\go-build
set GOENV=C:\Users\me\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\me\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\me\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=off
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\me\AppData\Local\Temp\go-build560694702=/tmp/go-build -gno-record-gcc-switches

What did you do?

package main

import (
	"golang.org/x/arch/x86/x86asm"
	"log"
)

func main() {
	bs := []byte{ 
		0x62, 0xf1, 0x7c, 0x48, 0x10, 0xc1,
		0x62, 0x71, 0x7c, 0x48, 0x10, 0x46, 0x07 } 

	off := 0
	for off < len(bs) {
		inst, err := x86asm.Decode(bs[off:], 64)
		if err != nil {
			log.Fatal(err)
		}
		log.Println(inst)
		off += inst.Len
	}
}

What did you expect to see?

vmovups zmm0,zmm1 or something

What did you see instead?

unrecognized instruction

@seankhliao seankhliao changed the title Feature Request - Add AVX-256 and AVX-512 registers and instructions to x86asm x/arch/x86/x86asm: add AVX-256 and AVX-512 registers and instructions Jul 21, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jul 21, 2021
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 21, 2021
@seankhliao
Copy link
Member

cc @cherrymui

@TACIXAT
Copy link
Author

TACIXAT commented Jul 22, 2021

package main

import (
	"golang.org/x/arch/x86/x86asm"
	"log"
)

func main() {
	bs := []byte{ 
		0xc5, 0xf9, 0xef, 0xc0} 

	off := 0
	for off < len(bs) {
		inst, err := x86asm.Decode(bs[off:], 64)
		if err != nil {
			log.Fatal(err)
		}

		log.Println(inst)
		off += inst.Len
	}
}
2021/07/22 14:40:40 Prefix(0xc5) Prefix(0xf9) OUT DX, EAX
2021/07/22 14:40:40 Prefix(0xc0) Op(0)

Should be a vpxor.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants