3 ms·
A fairly high proportion of extensions (both existing, and simply possible in future in general) are so specialised that you wrap the special instructions insid
by brucehoult 5y ago
A fairly high proportion of extensions (both existing, and simply possible in future in general) are so specialised that you wrap the special instructions inside a function (often within a loop inside that function) and then put that function in a library.
You just choose whether to use that version of the library or another one that uses normal instructions.
It's no exaggeration to say that many of those extension instructions might exist in only one function in one library on your entire Linux (or Android, FreeBSD, whatever) system.
To some extent the Vector extension can be like that. For most programs they'll just pick up vectorised versions of memcpy, strlen and so forth. In other programs (generally ones you compile yourself) you might want to use the vector extension directly -- maybe with auto-vectorisation in time. LLVM can do a bit of that already.
Only a few of the extensions have instructions that can profitably weave their way into every part of your code. The Bitmanip extension is like that. You really want to know whether your target processor has B or not.