News for hackers. Stuff that matters.
Re:Addressing Criticism of RISC-V Microprocessors by IshKebab on Sunday March 20, 2022 @07:00AM (#30741654)
Dubious. How is "you have to use this magic combination of instructions that compress & execute well" better than having a dedicated instruction?

Also no mention of the binary compatibility issues - which `-march` do you compile your code for? On x86 you have a choice of 3. For RISC-V as far as I can tell there are 96 valid targets.

Re:Addressing Criticism of RISC-V Microprocessors by socialdemocrat on Sunday March 20, 2022 @11:06AM (#30743214)
Because dedicated instructions suck up valuable encoding space, and the more instructions you have, the more instruction you have which potentially become obsolete with new advances in microarchitecture.

Not to mention that by sticking with simple single purpose instructions you make the CPU easier to teach to students. That is after all one of the goals of RISC-V in addition to creating a good ISA for industry.

Have we learned nothing about why we abandoned CISC in the first place? Those CPUs got riddled with instructions that never got used much.

Re:Addressing Criticism of RISC-V Microprocessors by google234123 on Sunday March 20, 2022 @01:29PM (#30744610)
With every node shrinkage those legacy instructions take up less space
Re:Addressing Criticism of RISC-V Microprocessors by bigcheesegs on Sunday March 20, 2022 @04:54PM (#30746515)
Encoding space, not die space.
Re:Addressing Criticism of RISC-V Microprocessors by google234123 on Sunday March 20, 2022 @10:49PM (#30749571)
Encoding space is almost infinite on intel though.
Re:Addressing Criticism of RISC-V Microprocessors by ansible on Monday March 21, 2022 @04:37AM (#30751696)
> Encoding space is almost infinite on Intel though.

Yes... if you willing to tolerate ever more complex and slow instruction decoding. This is a very bad tradeoff.

Re:Addressing Criticism of RISC-V Microprocessors by mhh__ on Sunday March 20, 2022 @07:38AM (#30741820)
No. Firstly -march (or similar, e.g. -mcpu in LLVM land) should target a chip not individual instruction sets.

Secondly, AVX-512 alone has a handful of different extensions. There are a bunch of different SSE variants, and similarly instructions are still being added to the VEX prefix (normal AVX).

There is more potentially for getting it wrong with riscv but 64 bit implies a number of extensions too so it's too far off what amd64 originally meant for X86 (e.g. implies SSE2)

Re:Addressing Criticism of RISC-V Microprocessors by IshKebab on Sunday March 20, 2022 @08:15AM (#30742017)
What do you mean "no"? My comment was entirely factual.

> Firstly -march (or similar, e.g. -mcpu in LLVM land) should target a chip not individual instruction sets.

LLVM still uses -march. And no you shouldn't target a specific chip unless you know your code will only run on that chip. That's the whole point I'm making. Sometimes you do know that (in embedded situations) but often you don't. Desktop apps aren't compiled for specific chips.

> Secondly, AVX-512 alone has a handful of different extensions.

Yes but these are generally linear - if an x86 chip supports extension N it will support extension N-1 too. Not true for RISC-V.

Re:Addressing Criticism of RISC-V Microprocessors by mhh__ on Sunday March 20, 2022 @08:32AM (#30742114)
The LLVM tools (like llc) use -mcpu. Clang mimics GCC. My point about the specific chip is that you have to know it anyway if you're planning on targeting a combination of extensions so you might as well use it.

As for linearity, the "generally" bit will apply to RISC-V by the time we have real desktop class chips using the ISA. We still can't assume AVX support for most programs, I don't view this as any different to RISC-V extensions. Just this ~year Intel added VEX-coded AI NN acceleration instructions, I assume RISC-V has similar plans.

Re:Addressing Criticism of RISC-V Microprocessors by IshKebab on Sunday March 20, 2022 @06:10PM (#30747212)
LLVM uses -march and -mcpu. It seems to be a bit of a mess which one you should use and also depend on the architecture.

Time will tell if there's a de facto minimum set of extensions for desktop RISC-V. Let's hope so, but it isn't guaranteed.

Re:Addressing Criticism of RISC-V Microprocessors by monocasa on Sunday March 20, 2022 @11:26AM (#30743391)
> Yes but these are generally linear - if an x86 chip supports extension N it will support extension N-1 too. Not true for RISC-V.

Not if you include AMD and Intel cores in that.

Re:Addressing Criticism of RISC-V Microprocessors by IshKebab on Sunday March 20, 2022 @03:46PM (#30745945)
Re:Addressing Criticism of RISC-V Microprocessors by monocasa on Sunday March 20, 2022 @05:40PM (#30746950)
That list isn't really an accurate picture of the world, but a vague attempt to make sense of the madness.

There's plenty of cores that don't follow that versioning scheme, and it's not an Intel or AMD construct.