-
Notifications
You must be signed in to change notification settings - Fork 0
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
enable arm64 decode #2
Labels
enhancement
New feature or request
Comments
|
// UQSUB Vd.16B,Vn.16B,Vm.16B
func uqsub(Vd, Vn, Vm byte) uint32 {
inst := uint32(0x6e202c00) | uint32(Vd&0x1f) | uint32(Vn&0x1f)<<5 | (uint32(Vm&0x1f) << 16)
return inst
}
// CMHI Vd.16B,Vn.16B,Vm.16B
func cmhi(Vd, Vn, Vm byte) uint32 {
inst := uint32(0x6e203400) | uint32(Vd&0x1f) | uint32(Vn&0x1f)<<5 | (uint32(Vm&0x1f) << 16)
return inst
}
// UMAXV <V><d>, <Vn>.<t>
func umax(Rd, Vn byte) uint32 {
inst := uint32(0x6e30a800) | uint32(Rd&0x1f) | uint32(Vn&0x1f)<<5
return inst
}
// TBX Vd.Ta, { Vn.16B, <Vn+1>.16B, <Vn+2>.16B, <Vn+3>.16B }, Vm.Ta ; Four register table
func tbx4(Vd, Vn, Vm byte) uint32 {
inst := uint32(0x4e007000) | uint32(Vd&0x1f) | uint32(Vn&0x1f)<<5 | (uint32(Vm&0x1f) << 16)
return inst
}
func TestGenInstr(t *testing.T) {
fmt.Printf("WORD $0x%08x\n", uqsub(16, 0, 7))
fmt.Printf("WORD $0x%08x\n", uqsub(17, 1, 7))
fmt.Printf("WORD $0x%08x\n", uqsub(18, 2, 7))
fmt.Printf("WORD $0x%08x\n", uqsub(19, 3, 7))
fmt.Printf("WORD $0x%08x\n", cmhi(16, 0, 7))
fmt.Printf("WORD $0x%08x\n", cmhi(17, 1, 7))
fmt.Printf("WORD $0x%08x\n", cmhi(18, 2, 7))
fmt.Printf("WORD $0x%08x\n", cmhi(19, 3, 7))
fmt.Printf("WORD $0x%08x\n", umax(17, 16))
fmt.Printf("WORD $0x%08x\n", tbx4(16, 12, 16))
fmt.Printf("WORD $0x%08x\n", tbx4(17, 12, 17))
fmt.Printf("WORD $0x%08x\n", tbx4(18, 12, 18))
fmt.Printf("WORD $0x%08x\n", tbx4(19, 12, 19))
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Decode STD mode should be ok, reference https://github.com/aklomp/base64/blob/master/lib/arch/neon64/dec_loop.c, need to check URL mode.
STD mode:
URL mode:
Need to check if Golang ASM supports inst. UQSUB (vqsubq_u8) / CMHI (vcgtq_u8) / UMAXV (vmaxvq_u8).
The text was updated successfully, but these errors were encountered: