4 ms·
I find it hard to believe there is no way to probe for extensions and provide a fallback It's a problem that already exists right now. If you compile code on
by geokon 5y ago
I find it hard to believe there is no way to probe for extensions and provide a fallback
It's a problem that already exists right now.
If you compile code on a machine with SSE or AVX and run it on an old Pentium, does it crash?
I had a fun bug once running ARM code that had some NEON in it and it would crashed on Scaleway's VPS bc their servers ran chips that didn't have NEON implemented
- rwmj 5y agoThis is the standard FUD spread around by Arm apologists. Of course you can detect RISC-V extensions at both compile and run time. In fact it's the first widespread ISA that was designed with extension in mind (so for example there's a uniform way to find instruction boundaries even if you do not know how to fully interpret an extension). This is in stark contrast to x86 where extensions are basically hacks piled on hacks.
- MaKey 5y agoSorry, my post was not intended to be FUD. I tried to follow the original claim but apparently placed too much merit in it.
- saagarjha 5y ago> so for example there's a uniform way to find instruction boundaries even if you do not know how to fully interpret an extension This doesn’t make sense, though. If you have something in your instruction stream that you don’t understand, it would be insane to do anything but fault immediately, unless the instruction is some sort of optional feature such as a hint or security mechanism where there is no real behavior associated with it. I mean ARM has this “capability” too by virtue of a fixed length instruction set but it doesn’t do anything with this like you’re describing.
- ori_b 5y ago> If you compile code on a machine with SSE or AVX and run it on an old Pentium, does it crash? Yes. Or it leaves them unused on the machine with avx. For short runs of instructions, the overhead of fallback selection is larger than the overhead of using the least common denominator. For large functions, fallback selection is done by selecting specific functions after benchmarking.
- rjsw 5y agoPlenty of open source packages probe for extensions when built for either X86_64 or ARM, then call fallback code if the extension isn't there. Things like OpenJDK, pixman, nss, ffmpeg.