FAQ
Reviewers: rsc,

Message:
Hello rsc@golang.org (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go/


Description:
runtime: Use aligned loads for AES key schedule.

Please review this at https://codereview.appspot.com/7763050/

Affected files:
M src/pkg/runtime/asm_386.s
M src/pkg/runtime/asm_amd64.s


Index: src/pkg/runtime/asm_386.s
===================================================================
--- a/src/pkg/runtime/asm_386.s
+++ b/src/pkg/runtime/asm_386.s
@@ -742,8 +742,8 @@
TEXT runtime·aeshashbody(SB),7,$0
MOVL (DX), X0 // seed to low 32 bits of xmm0
PINSRD $1, CX, X0 // size to next 32 bits of xmm0
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
+ MOVO runtime·aeskeysched+0(SB), X2
+ MOVO runtime·aeskeysched+16(SB), X3
aesloop:
CMPL CX, $16
JB aesloopend
@@ -791,11 +791,9 @@
MOVL 12(SP), AX // ptr to data
MOVL (DX), X0 // seed
PINSRD $1, (AX), X0 // data
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
- AESENC X2, X0
- AESENC X3, X0
- AESENC X2, X0
+ AESENC runtime·aeskeysched+0(SB), X0
+ AESENC runtime·aeskeysched+16(SB), X0
+ AESENC runtime·aeskeysched+0(SB), X0
MOVL X0, (DX)
RET

@@ -804,11 +802,9 @@
MOVL 12(SP), AX // ptr to data
MOVQ (AX), X0 // data
PINSRD $2, (DX), X0 // seed
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
- AESENC X2, X0
- AESENC X3, X0
- AESENC X2, X0
+ AESENC runtime·aeskeysched+0(SB), X0
+ AESENC runtime·aeskeysched+16(SB), X0
+ AESENC runtime·aeskeysched+0(SB), X0
MOVL X0, (DX)
RET

Index: src/pkg/runtime/asm_amd64.s
===================================================================
--- a/src/pkg/runtime/asm_amd64.s
+++ b/src/pkg/runtime/asm_amd64.s
@@ -762,8 +762,8 @@
TEXT runtime·aeshashbody(SB),7,$0
MOVQ (DX), X0 // seed to low 64 bits of xmm0
PINSRQ $1, CX, X0 // size to high 64 bits of xmm0
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
+ MOVO runtime·aeskeysched+0(SB), X2
+ MOVO runtime·aeskeysched+16(SB), X3
aesloop:
CMPQ CX, $16
JB aesloopend
@@ -811,11 +811,9 @@
MOVQ 24(SP), AX // ptr to data
MOVQ (DX), X0 // seed
PINSRD $2, (AX), X0 // data
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
- AESENC X2, X0
- AESENC X3, X0
- AESENC X2, X0
+ AESENC runtime·aeskeysched+0(SB), X0
+ AESENC runtime·aeskeysched+16(SB), X0
+ AESENC runtime·aeskeysched+0(SB), X0
MOVQ X0, (DX)
RET

@@ -824,11 +822,9 @@
MOVQ 24(SP), AX // ptr to data
MOVQ (DX), X0 // seed
PINSRQ $1, (AX), X0 // data
- MOVOU runtime·aeskeysched+0(SB), X2
- MOVOU runtime·aeskeysched+16(SB), X3
- AESENC X2, X0
- AESENC X3, X0
- AESENC X2, X0
+ AESENC runtime·aeskeysched+0(SB), X0
+ AESENC runtime·aeskeysched+16(SB), X0
+ AESENC runtime·aeskeysched+0(SB), X0
MOVQ X0, (DX)
RET



--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Russ Cox at Mar 20, 2013 at 9:11 pm
    LGTM

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at Mar 20, 2013 at 9:12 pm
    any benchmark data?

    in writing AES-NI support for crypto/aes, i benchmarked aligned and
    unaligned form
    of load instructions, and found out (surprisingly) that with aligned
    data, the difference
    is negligible.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Keith Randall at Mar 20, 2013 at 9:15 pm
    No, I suspect it is in the noise of any measurement. It saves 2
    instructions for hash32 and hash64.

    On Wed, Mar 20, 2013 at 2:11 PM, minux wrote:

    any benchmark data?

    in writing AES-NI support for crypto/aes, i benchmarked aligned and
    unaligned form
    of load instructions, and found out (surprisingly) that with aligned
    data, the difference
    is negligible.
    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Minux at Mar 20, 2013 at 9:17 pm

    On Thu, Mar 21, 2013 at 5:15 AM, Keith Randall wrote:
    No, I suspect it is in the noise of any measurement. It saves 2
    instructions for hash32 and hash64.
    ok, thanks for confirmation.

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Khr at Mar 20, 2013 at 9:34 pm
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=77d9e6e1900c ***

    runtime: Use aligned loads for AES key schedule.

    R=rsc, minux.ma, khr
    CC=golang-dev
    https://codereview.appspot.com/7763050


    https://codereview.appspot.com/7763050/

    --

    ---
    You received this message because you are subscribed to the Google Groups "golang-dev" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedMar 20, '13 at 9:08p
activeMar 20, '13 at 9:34p
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase