Live data from Hacker News

Merge branch 'x86-rep-insns': x86 user copy clarifications

git.kernel.org

11–12 of 12 posts

Re: Merge branch 'x86-rep-insns': x86 user copy clarifications

#11
post #9

I'm doubtful that using anything other than REP MOVS for copying was ever slow enough to require making a decision on. Perhaps for extremely tiny copies, but I do wonder if the original decision was based on skewed microbenchmarking.

At first, REP MOVS and REP STOS were obviously better. Shorter code, that couldn't possibly be beaten by unrolled loops of anything because of instruction decoding overhead on each instruction cycle. Then for a range of x86 generations maybe starting with the Pentium Pro (first OOO) or Pentium (first superscalar), REP MOVS and REP STOS called into microcode and it was significantly faster to use unrolled loops of reg…

I think unrolled FILD/FIST was fastest on Pentium.

Re: Merge branch 'x86-rep-insns': x86 user copy clarifications

#12

I'm doubtful that using anything other than REP MOVS for copying was ever slow enough to require making a decision on. Perhaps for extremely tiny copies, but I do wonder if the original decision was based on skewed microbenchmarking.

Agner Fog, Optimizing subroutines in assembly language, page 150.

For those that aren't familiar: https://www.agner.org/optimize/#manuals

Previous HN discussion: https://news.ycombinator.com/item?id=17845252

Post reply on HN