]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use all 64 bits of hash seed on arm64
authorKeith Randall <keithr@alum.mit.edu>
Thu, 29 Aug 2019 23:21:58 +0000 (16:21 -0700)
committerKeith Randall <khr@golang.org>
Fri, 30 Aug 2019 00:10:31 +0000 (00:10 +0000)
Fixes #33960

Change-Id: I4f8cf65dcf4140a97e7b368572b31c171c453316
Reviewed-on: https://go-review.googlesource.com/c/go/+/192498
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/asm_arm64.s

index 21ea519d647b582263dd5300a824d8b98b23136a..0be06d124e508664a2a6364116e689f9f165347f 100644 (file)
@@ -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
+       MOV   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
+       MOV   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]