From f484e9699d9d18e578493dc0f9924ce2b56a42d9 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 29 Aug 2019 16:21:58 -0700 Subject: [PATCH] runtime: use all 64 bits of hash seed on arm64 Fixes #33960 Change-Id: I4f8cf65dcf4140a97e7b368572b31c171c453316 Reviewed-on: https://go-review.googlesource.com/c/go/+/192498 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/runtime/asm_arm64.s | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 21ea519d64..0be06d124e 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -504,7 +504,7 @@ TEXT runtime·memhash(SB),NOSPLIT|NOFRAME,$0-32 BEQ noaes MOVD p+0(FP), R0 MOVD s+16(FP), R1 - MOVWU h+8(FP), R3 + MOVD h+8(FP), R3 MOVD $ret+24(FP), R2 B aeshashbody<>(SB) noaes: @@ -517,20 +517,20 @@ TEXT runtime·strhash(SB),NOSPLIT|NOFRAME,$0-24 BEQ noaes MOVD p+0(FP), R10 // string pointer LDP (R10), (R0, R1) //string data/ length - MOVWU h+8(FP), R3 + MOVD h+8(FP), R3 MOVD $ret+16(FP), R2 // return adddress B aeshashbody<>(SB) noaes: B runtime·strhashFallback(SB) // R0: data -// R1: length (maximum 32 bits) +// R1: length // R2: address to put return value // R3: seed data TEXT aeshashbody<>(SB),NOSPLIT|NOFRAME,$0 VEOR V30.B16, V30.B16, V30.B16 - VMOV R3, V30.S[0] - VMOV R1, V30.S[1] // load length into seed + VMOV R3, V30.D[0] + VMOV R1, V30.D[1] // load length into seed MOVD $runtime·aeskeysched+0(SB), R4 VLD1.P 16(R4), [V0.B16] -- 2.50.0