Hi Kennon,

Some perf reports and analysis imply that backward moves (with overlap?) are no faster than straight rep movsb on some CPUs, so it may be better to just simplify to that, unless you want to stash the final element(s) to be moved out of the way in register(s), and use multiple registers in unrolled wide moves for the aligned portion?

On 2026-02-27 11:20, KENNON J CONRAD via Cygwin wrote:
    I updated the BIOS to the newest version and ran the code again.  The 
memmove got SIG_TRAP again.  This time the code was freeing up uint16_t array 
element 1525 and eliminating array element 1676 by moving elements 1525 - 1675 
to elements 1526 - 1676.
RSI contains the address of element 1601, indicating the rep movsq did only 9 
iterations before the SIG_TRAP happened.  The ZF shows a value of 0.  So it 
seems like this is perhaps an OS problem with ZF handling of interrupts.  At 
this point, it is easiest for me to avoid memmove for backward moves with 
source/destination overlap because of this problem.  I don't know how many 
computers are impacted by this problem but I do know it's causing crashes on my 
test computer and that's enough reason to avoid it.

On 02/26/2026 7:06 PM PST Eliot Moss wrote:
On 2/26/2026 9:04 PM, KENNON J CONRAD wrote:
Perhaps something like this?  Maybe I need to try a BIOS update?
Yes, something *like* these flaws.  The thing is to find out if your specific
processor has a flaw that needs an update, etc.
Intel Haswell (and related architectures) processors may experience stability 
issues, including machine check errors (MCEs), due to a microcode bug related 
to REP MOVS (specifically REP MOVSB or REP MOVSQ) handling. These issues often 
cause system crashes or lockups, leading to microcode, BIOS/UEFI updates to 
resolve them.
Debian Wiki
   +4
Issue: A high-rate of interrupts or specific memory operations can cause REP 
MOVS instructions to trigger Machine Check Errors (MCE) or internal errors 
(IERR) on older processors.
Affected Processors: The bug primarily impacts older Intel processors, 
including Haswell and Broadwell architectures.
Fix/Mitigation: The primary solution is to apply the latest motherboard 
BIOS/UEFI update, which contains the corrected microcode update (often labelled 
20180108 or later).
Background: This is linked to Intel’s efforts to fix security vulnerabilities 
(like Spectre), where early patches for Haswell/Broadwell caused unexpected 
instability, requiring further refinements.
Debian Wiki
   +4
--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                -- Antoine de Saint-Exupéry

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to