2 ms·
Portability: one you hand-code assembler for an architecture you lose compatibility for others. Unless you provide multiple code paths to account for this, but
by dspillett 5y ago
Portability: one you hand-code assembler for an architecture you lose compatibility for others. Unless you provide multiple code paths to account for this, but that increases testing and maintenance requirements.
Future optimisations using better on-chip features, or other new techniques: new instructions that reduce the task might get used by the compiler but it won't update your section in hand-coded assembler.
Maintainability: you don't want to force larger parts of your workforce/community to be familiar with assembly if it is not useful day-to-day, or lock your assembly capable people to maintaining those hand-written-assembly portions.
- pmontra 5y agoUnderstood. About maintainability I guess that that code must be marked as do not modify, or the compiler will walk out of the optimization path. Future developers on that project must know very well why that code is written like that. Furthermore any new compiler or CPU could break the optimizations.