DEV Community

Molossus Spondee
Molossus Spondee

Posted on

If you could add one new instruction to mainstream hardware what would it be?

Similar to Agner Fog's idea of a new instruction set architecture but much less limited in scope https://www.agner.org/optimize/blog/read.php?i=421 if you could add one entirely new instruction to mainstream hardware what would add? I'll write some of my own thoughts below as a comment but I'm interested in what the rest of the developer community would want. Are there things you just can't do without adding a dedicated instruction or things that are just too slow? Or perhaps it is more of a convenience thing or some other factor I have not considered?

Top comments (1)

Collapse
 
mspondee profile image
Molossus Spondee

Myself I would add an instruction to better support write barriers that does a mov but also dirties a per page bit at the same time. The bit would have to be in memory somewhere so other instructions could have a normal dirty write as well.