humzak711 opened a new pull request, #18130: URL: https://github.com/apache/nuttx/pull/18130
## Summary This PR optimizes the x86_64 assembly code to reduce code size and reduce length changing prefix (LCP) stalls in hot code. key optimizations include: - Reducing the use of length changing prefixes (LCPs) which cause bottlnecks in instruction predecoders in modern x86_64 microarchitectures - Using xor reg32, reg32 instead of xor reg64, reg64 to zero registers. In x86_64 32 bit operations are zero extended to 64 bits. This saves us one byte (the REX.W prefix) per instruction - Replacing cmp $0, reg with test reg, reg to reduce instruction length by one byte ## Impact - Minor reduction in code size for the x86_64 kernel - Performance optimization in irq_common and up_saveusercontext by reducing predecoder stalls on microarchitectures sensitive to LCPs ## Testing - Host: Linux x86_64 - Board: qemu-intel64:nsh - ostest passed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
