From 5bd003ebbe3f853f16502168f620c1ac71d29def Mon Sep 17 00:00:00 2001 From: emmansun Date: Sat, 1 Jan 2022 20:17:57 +0800 Subject: [PATCH] try out arm64 inst --- sm4/arm64_verify.s | 14 ++++++++++++++ sm4/arm64_verify_test.go | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sm4/arm64_verify.s create mode 100644 sm4/arm64_verify_test.go diff --git a/sm4/arm64_verify.s b/sm4/arm64_verify.s new file mode 100644 index 0000000..920f442 --- /dev/null +++ b/sm4/arm64_verify.s @@ -0,0 +1,14 @@ +#include "textflag.h" + +// func tblAsm(in, imm, out *byte) +TEXT ·tblAsm(SB),NOSPLIT,$0 + MOVD in+0(FP), R8 + MOVD imm+8(FP), R9 + MOVD out+16(FP), R10 + + VLD1 (R8), [V0.B16] + VLD1 (R9), [V1.B16] + + VTBL V1.B16, [V0.B16], V2.B16 + VST1 V2.B16, (R10) + RET \ No newline at end of file diff --git a/sm4/arm64_verify_test.go b/sm4/arm64_verify_test.go new file mode 100644 index 0000000..c091871 --- /dev/null +++ b/sm4/arm64_verify_test.go @@ -0,0 +1,10 @@ +//go:build arm64 +// +build arm64 + +//go:noescape +func tblAsm(in, imm, out *byte) + +func TestTblAsm(t *testing.T) { + in := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} + +} \ No newline at end of file