30 karma · joined Oct 13, 2021 (5y ago) · 40 submissions
comment 3y ago · link · parent
1. The `memcpy` idea is trivial. I know it's there to serve a different argument. But saying "professional" can't think of `memcpy` is clickbait.
2. Having a bad char table makes a totally different algorithm. A "professional" should at least finish reading their textbook, instead of writing the naive algorithm in Version 3.
comment 3y ago · link · parent
comment 4y ago · link · parent
This seems to be a fundamental conflict of interest between server-side programming and client-side sandboxing. Now the preventive security measures cost us not only performance on the table, but also privilege spam.
comment 4y ago · link · parent
comment 4y ago · link · parent
These four points all have direct benefits on hardware design. And compressed ISA like RVC and Thumb checks them all.
On the contrary, "fewer instruction types", "orthognoal instructions" never had any real benefit beyond perceptual aesthetics, so as a result they are long abandoned.
comment 4y ago · link · parent
comment 4y ago · link · parent
No one can master these three fields all at once. No one. Not even Linus (who would be a master software developer + a decent compiler specialist).
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
When you have the hammer, it becomes a crime to not hit the nail. Especially so when you find out you have a better hammer than your hammer contractor.
comment 4y ago · link · parent
comment 4y ago · link · parent
For server/professional market, RISC-V still lacks a selling point. Perhaps something like a pointer masking, memory tagging, or transactional memory in the J and T extensions which are still in very early stages.
comment 4y ago · link · parent
The author starts with a apparently meaningless `int x = a[i];`, but did not ask an obvious question before digging in: what usually goes before and after this statement and together what will they produce? A formal RISC-V code analysis usually does not go like this.
`int x = a[i];` is the kind of expression that strikes you as useful at the first glance, but then nothing. If you visit an array, then on x64/ARM/RISC-V, they are all compiled down to 2 instructions per iteration. Not 1 vs 2 vs 3 as suggested by the article. RISV-V may have one or two more instructions outside the loop but that's it.
comment 4y ago · link · parent
Imaging someone uses quantum gravity to explain why Australians stand upside down on a globe.
comment 4y ago · link · parent
comment 4y ago · link · parent
comment 4y ago · link · parent
> But that instruction is not a gather load instruction. This instructoin is just a shuffle instruction.
I think on the contrary, x86's permute/shuffle/gather naming is a horrible legacy mess (plus broadcast and other stuff). The channels width, the source selection, the IMM encoding, all basically nonsense and horrifically non-orthogonal.
`vrgather` is literally "gather from register, vector". In risc-v, you can gather from 8 consecutive vector registers (maximum size of a vector register group). That means 1024bits on a bare minimum Zv128b machine. This channel width blows out the 256bits/128bits channel nonsense even in AVX512 and deserve a name closer to memory gather.
comment 4y ago · link · parent
So that immediately rules out buffer overflows, use-after-free, double-free, non-atomic data race, dangling pointers, wrong cast, etc.
Some people think memory leaking counts, but I have the same view as Rust. Memory leaking does not corrupt the correctness of a program. And there is no accepted method to universally define "memory leaking" in the first place.
comment 4y ago · link · parent
Zba and Zbb are both mandatory extensions. Zbc, Zbkb, Zbkc, Zbkx are all supported extensions. Zba and Zbb contain most useful bitmanip instructions. For example, POPCOUNT is in Zbb.
Implementations are free to choose their extension combinations and go out of standard profiles. But doing so will void them from mainstream *nix support.
Edit: Also for the already sold units, there is a RVA20 profile without any bitmanip which most of them will match. You can assume no newer application uarch will use RVA20 since year 2022.
comment 4y ago · link · parent
So for those scenarios, I haven't heard of code-size problem argument against RISC-V.