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: ARM64 NEON unsigned min and max instructions (VUMAX, VUMIN) #42326

Closed
jacksonrnewhouse opened this issue Nov 1, 2020 · 4 comments
Closed
Labels
arch-arm64 FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@jacksonrnewhouse
Copy link

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

$ go version
go1.15.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jnewhouse/Library/Caches/go-build"
GOENV="/Users/jnewhouse/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/jnewhouse/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jnewhouse/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.15.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jnewhouse/code/git/github/roaring/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/5f/0h9ls87j0vz_gp0wmdw6_8tr0000gp/T/go-build172968056=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I tried to use VUMAX and VUMIN to implement a vectorized sorted union algorithm used in the C versions of Roaring, to work on RoaringBitmap/roaring#288. To test them out I wrote assembler like


	VMOV set1+0(FP), V0.H8
	VMOV set2+24(FP), V1.H8
	VUMIN V0.H8, V1.H8, V2.H8
	VUMAX V0.H8, V1.H8, V3.H8

What did you expect to see?

It should compile.

What did you see instead?

 GOARCH=arm64 go build .
# github.com/RoaringBitmap/roaring
./setutil_arm64.s:140: unrecognized instruction "VUMIN"
./setutil_arm64.s:141: unrecognized instruction "VUMAX"
asm: assembly of ./setutil_arm64.s failed

From what I can gather, these instructions have been added in an ad hoc basis, with an ask for specific questions, as discussed in #41092. With the advent of powerful arm64 machines like AWS's Graviton 2, I imagine there will be more people wanting to write vectorized arm64. I think it is worth (1) Clearly documenting which Neon calls are supported, and (2) Porting over a large useful set of them at once. For instance, I can easily imagine wanting VUMINP, VUMINV etc.

@toothrot toothrot added arch-arm64 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 2, 2020
@toothrot toothrot added this to the Backlog milestone Nov 2, 2020
@toothrot
Copy link
Contributor

toothrot commented Nov 2, 2020

/cc @cherrymui @randall77

@cherrymui
Copy link
Member

cherrymui commented Nov 2, 2020

cc @zhangfannie

@zhangfannie
Copy link
Contributor

@cherrymui We will enable them ASAP. Thank you.

@gopherbot
Copy link

Change https://golang.org/cl/271497 mentions this issue: cmd/asm: add arm64 instructions VUMAX and VUMIN

@golang golang locked and limited conversation to collaborators Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 FrozenDueToAge 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

5 participants