News for hackers. Stuff that matters.
Re:BeagleV – An affordable RISC-V computer designed to run L... by hajile on Wednesday January 13, 2021 @10:30AM (#25763178)
> The main difference is that RISC-V is a lot more modular, so it's going to be difficult to distribute binaries for but more flexible if you're doing something completely vertical. Also a lot of the modules have bundle relatively common/easy instructions with niche/difficult ones. E.g. multiply with divide.

I don't think it'll be worse than ARM and it's decidedly better than x86.

There are SEVEN major revisions of ARMv8. Then there's v8-R, v8-M, and additional 32-bit variants of each instruction set in addition to both ARMv7 and ARMv6 which also still ship billions of chips per year. Oh, and under pressure from companies, ARM also allows custom instructions now. Those aren't just theoretical either -- Apple at least added a ton of custom matrix instructions to the M1.

For x86, supporting only semi-recent processors (2006 Core or greater) leaves you still checking for support for: SSE3, SSE4, SSE4.1, SSE4a, SSE4.2, SSE5, AVX, AVX2, AVX512, XOP, AES, SHA, TBM, ABM, BMI1, BMI2, F16C, ADX, CLMUL, FMA3, FMA4, LWP, SMX, TSX, RdRand, MPX, SGX, SME, and TME. That's 29 instruction sets and not all of them have use on both Intel and AMD chips.

RISC-V seems at least that cohesive. If you're shipping a general purpose CPU, you'll always have mul/div, compression, fusion (not actually instructions), privilege, single precision, double precision, bit manipulation, and probably a few others.

Where you'll run into mul/div missing or no floats are microcontrollers or "Larabee" style GPU cores. In all of those cases, you'll be coding to a very specific core, so that won't really matter.

Thankfully, we've had ways to specify and/or check these kinds of things for decades.

Re:BeagleV – An affordable RISC-V computer designed to run L... by IshKebab on Wednesday January 13, 2021 @02:55PM (#25767157)
> leaves you still checking for support for: SSE3, SSE4...

Find me a processor that supports SSE4 but not SSE3. That's the problem. With x86 you pretty much can say "we're targeting processors made after 2010" or whatever and that's that. You make one binary and it works.

RISC-V allows a combinatorial explosion of possible CPUs. You can have a CPU that supports extension X and not Y, but another one that supports Y and not X.

Re:BeagleV – An affordable RISC-V computer designed to run L... by brucehoult on Thursday January 14, 2021 @06:53PM (#25784841)
If you're in an embedded situation where you're building all the software yourself then that's fine.

If you're on a general purpose PC/smartphone with packaged software then the OS vendor specifies a base set of extensions that everything must implement -- for Linux at the moment that is RV64IMAFDC aka RV64GC.

All of those extensions (except maybe A) are very generally useful and pervasive in code.

Some other extensions, such as the Vector extension, will provide significant benefits to applications that don't even know whether the system they are running on has them -- you'll just get dynamically linked to a library version that uses V or doesn't, as appropriate.

To take a very trivial example, on a system with V, every application will automatically use highly efficient (and also very short) V versions of memcpy, memcmp, memset, bzero, strlen, strcpy, strcmp and similar.

The same will apply to libraries for bignums, BLAS, jpeg and other media types, and many others.

Re:BeagleV – An affordable RISC-V computer designed to run L... by brucehoult on Wednesday January 13, 2021 @10:42AM (#25763369)
Do you have a reason to think the matrix instructions in the M1 are not those specified in Armv8.6-A?
Re:BeagleV – An affordable RISC-V computer designed to run L... by hajile on Wednesday January 13, 2021 @10:53AM (#25763548)
I don't know, but you can look further here.

https://gist.github.com/dougallj/7a75a3be1ec69ca550e7c36dc75...

Re:BeagleV – An affordable RISC-V computer designed to run L... by saagarjha on Wednesday January 13, 2021 @06:18PM (#25769383)
They're proprietary.