News for hackers. Stuff that matters.
Re:A Big Week for RISC-V by geokon on Sunday February 13, 2022 @06:42AM (#30321056)
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

Re:A Big Week for RISC-V by rwmj on Sunday February 13, 2022 @06:59AM (#30321145)
This 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.
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @08:50AM (#30321753)
> 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.

Re:A Big Week for RISC-V by tux3 on Sunday February 13, 2022 @11:30AM (#30322893)
It will be useful for disassemblers, among other things.
Re:A Big Week for RISC-V by saagarjha on Sunday February 13, 2022 @06:41PM (#30326775)
Sure, it’s helpful but not really a requirement by any means. Normal x86 code tends to be self-synchronizing, for example.
Re:A Big Week for RISC-V by MaKey on Sunday February 13, 2022 @07:25AM (#30321250)
Sorry, my post was not intended to be FUD. I tried to follow the original claim but apparently placed too much merit in it.
Re:A Big Week for RISC-V by ori_b on Sunday February 13, 2022 @08:54AM (#30321771)
> 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.

Re:A Big Week for RISC-V by rjsw on Sunday February 13, 2022 @10:04AM (#30322119)
Plenty 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.