Hacker News new | ask | show | jobs
by cornstalks 971 days ago
One thing I'm curious about translators like these: are they smart enough to convert software polyfill functions to hardware instructions? For example, armv7a doesn't have a divide instruction, so a software polyfill function is used (like __aeabi_idiv). Do translators recognize these common software functions and translate them to native instructions (i.e. sdiv in this example)?
1 comments

That's a good question, I don't know.

I suspect the specific case of sdiv may be practically handled already for post-div Armv7a and ARMv8a AARCH32 on dynamically loaded operating systems, either by the dynamic loader or the compiler support library choosing to swap in a different implementation of __aeabi_idiv according to the available capabilities.