4 ms·
It's called REP MOVSB (or MOVSW, MOVSD, maybe also MOVSQ?). It has existed since the 8086 day; and for reasons I don't know, it supposedly works well for big bl
by beagle3 6y ago
It's called REP MOVSB (or MOVSW, MOVSD, maybe also MOVSQ?). It has existed since the 8086 day; and for reasons I don't know, it supposedly works well for big blocks these days (>1K or so) but is supposedly slower than register moves for small blocks.
- JoshTriplett 6y ago> it supposedly works well for big blocks these days (>1K or so) but is supposedly slower than register moves for small blocks. On current processors with Fast Short REP MOVSB (FSRM), REP MOVSB is the fastest method for all sizes. On processors without FSRM, but with ERMS, REP MOVSB is faster for anything longer than ~128 bytes.
- beagle3 6y agoThanks! Is there a simple rule-of-the-thumb about when can one rely on FSRM?
- JoshTriplett 6y agoYou should check the corresponding CPUID bit, but in general, Ice Lake and newer.