tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: small changes in aesxcbcmac.c



Eric Haszlakiewicz wrote:
> On September 25, 2016 5:01:16 PM EDT, Alexander Nasonov <alnsn%yandex.ru@localhost> wrote:
> >The first change shrinks aes_xcbc_mac_init by 183 bytes on amd64
> >(from 562 to 379 bytes).
> 
> Do you mean it shrinks its stack usage?  Or does that change to static const vars somehow shrink the function itself?

gcc copies each byte to the stack:

ffffffff80532a10:       c6 45 98 01             movb   $0x1,-0x68(%rbp)
ffffffff80532a14:       c6 45 99 01             movb   $0x1,-0x67(%rbp)
ffffffff80532a18:       c6 45 9a 01             movb   $0x1,-0x66(%rbp)
ffffffff80532a1c:       c6 45 9b 01             movb   $0x1,-0x65(%rbp)
ffffffff80532a20:       c6 45 9c 01             movb   $0x1,-0x64(%rbp)
ffffffff80532a24:       c6 45 9d 01             movb   $0x1,-0x63(%rbp)
ffffffff80532a28:       c6 45 9e 01             movb   $0x1,-0x62(%rbp)
ffffffff80532a2c:       c6 45 9f 01             movb   $0x1,-0x61(%rbp)
ffffffff80532a30:       c6 45 a0 01             movb   $0x1,-0x60(%rbp)
ffffffff80532a34:       c6 45 a1 01             movb   $0x1,-0x5f(%rbp)
ffffffff80532a38:       c6 45 a2 01             movb   $0x1,-0x5e(%rbp)
ffffffff80532a3c:       c6 45 a3 01             movb   $0x1,-0x5d(%rbp)
ffffffff80532a40:       c6 45 a4 01             movb   $0x1,-0x5c(%rbp)
ffffffff80532a44:       c6 45 a5 01             movb   $0x1,-0x5b(%rbp)
ffffffff80532a48:       c6 45 a6 01             movb   $0x1,-0x5a(%rbp)
ffffffff80532a4c:       c6 45 a7 01             movb   $0x1,-0x59(%rbp)
ffffffff80532a50:       c6 45 a8 02             movb   $0x2,-0x58(%rbp)
ffffffff80532a54:       c6 45 a9 02             movb   $0x2,-0x57(%rbp)
ffffffff80532a58:       c6 45 aa 02             movb   $0x2,-0x56(%rbp)

and so on.

Alex


Home | Main Index | Thread Index | Old Index