diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-02-10 18:30:57 +0100 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2015-02-10 18:54:27 -0500 |
commit | 74e334dcd177b585c64ddafa732a3dc9e3f6b5ec (patch) | |
tree | d2e80f3871e4eacac8ea211e0f80f984ee5c68da /src/stdio/fileno.c | |
parent | bf2071eda32528ee8b0bb89544152646684a2cf3 (diff) | |
download | musl-74e334dcd177b585c64ddafa732a3dc9e3f6b5ec.tar.gz musl-74e334dcd177b585c64ddafa732a3dc9e3f6b5ec.tar.xz musl-74e334dcd177b585c64ddafa732a3dc9e3f6b5ec.zip |
x86_64/memset: avoid performing final store twice
The code does a potentially misaligned 8-byte store to fill the tail of the buffer. Then it fills the initial part of the buffer which is a multiple of 8 bytes. Therefore, if size is divisible by 8, we were storing last word twice. This patch decrements byte count before dividing it by 8, making one less store in "size is divisible by 8" case, and not changing anything in all other cases. All at the cost of replacing one MOV insn with LEA insn. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/stdio/fileno.c')
0 files changed, 0 insertions, 0 deletions