RISC-V: They should have known better

(dmitry.gr)

125 points | by kaycebasques 3 hours ago

17 comments

  • wren6991 1 hour ago
    RISC-V is... fine. It satisfies my two requirements for an ISA as a hobby CPU designer, which are:

    1. Supported in mainline LLVM and GCC.

    2. I can implement it without lawyers sending me a love letter.

    Everything else, I can fix in post. There are enough good ideas spread across the extensions that I can assemble a reasonably put-together, curated embedded ISA with competitive performance and code density that admits a simple implementation.

    I think Dmitry's points are largely on-target, though I have filed my usual statutory complaint that every rant that includes a bitfield diagram for the RISC-V J format should accompany it with a similar diagram for the Arm T32 BL encoding.

    • spicyjpeg 48 minutes ago
      RISC-V is in many aspects just legally-distinct-MIPS, from the base instruction set all the way up to how certain extensions introduce kludges that are very reminiscent of later MIPS additions. While I do somewhat agree on the fact it was a huge missed opportunity to improve upon MIPS's technical flaws in order to realistically compete against the likes of ARMv8, we still have to keep in mind that the primary driving force behind RISC-V is and has always been fixing the legal flaws instead.

      There is indeed plenty of value to be had from a standardized (if poorly) PlayStation-1-era instruction set you can safely implement in silicon with no risk of a zombie company husk coming after you, especially in the ASIC space where (as Dmitry himself recognized) anything is better than an 8051 core you need a copy of Keil C51 and a lot of patience to write code for. Even if you end up having to add custom extensions, it still is a much better starting point than coming up with your own bespoke ISA, building a toolchain around it and convincing potential customers that your proprietary architecture is worth the effort to deal with over another vendor's licensed Cortex-M cores with full GCC and LLVM support.

      • inigyou 46 minutes ago
        Has it been proven that no patent troll holds a patent covering RISC-V?

        Of course not because that's impossible to prove.

        • wren6991 44 minutes ago
        • fluffybucktsnek 30 minutes ago
          > Of course not because that's impossible to prove.

          Why?

          • hyperhello 27 minutes ago
            It's supposed to be impossible to prove a negative. But it might still happen some day. We just don't know.
            • MobiusHorizons 8 minutes ago
              Well played
            • fluffybucktsnek 9 minutes ago
              "it's impossible to prove a negative" is a simplification. A negation is just the oppositive of an affirmation. If the affirmation is "there is an element E of an infinite set S that satisfies property P", the negation would be "there is no E in S that satisfy P", which would make proving by enumeration require checking every element of an infinite set, which is impossible. But other forms of proof might be possible.

              The set of US patents, however, are not infinite and, IIRC, is also public. That said, IP laws are a mess.

    • amluto 34 minutes ago
      You can’t fix the mutually incompatible overlapping encodings in post.
      • wren6991 25 minutes ago
        They actually did do that. C was split into ZcfZcdZca, so you can choose a non-overlapping subset. It doesn't affect an RV32 non-F core anyway.
      • monocasa 26 minutes ago
        Practically you don't simultaneously want those overlapping encodings.
    • zephen 1 hour ago
      > RISC-V is... fine

      Exactly.

      > It satisfies my two requirements for an ISA as a hobby CPU designer...

      You probably have some unstated requirements as well, such as available toolchains and "vetted well enough to actually be able to run code."

      Risc-V now occupies the Schelling point for people who, for whatever reason (rent-seeking and security top the list) want to leave the x86 and Arm ecosystems.

      • andrewflnr 1 hour ago
        They did explicitly specify:

        > 1. Supported in mainline LLVM and GCC.

        Which pretty well encapsulates the ecosystem requirements.

  • bjornnn 1 hour ago
    the significance and allure of risc-v, the reason china is investing heavily in it right now, has little to do with the technical details of how it works under the hood, it's the fact that it is an open standard not encumbered by intellectual property law. even if it isn't technically the best general-purpose processor architecture, it sets an important precedent by proving that it is possible to develop an open public architecture that the world can use to build computing devices without being extorted by a multinational corporation charging licensing fees or a geopolitical superpower enacting tariffs and sanctions.
    • rayiner 34 minutes ago
      Isn't almost everything in MIPS long outside patent protection?
    • zephen 1 hour ago
      > it's the fact that it is an open standard not encumbered by intellectual property law.

      There are actually many of those. But Risc-V has become, through effective marketing, the Schelling point for anybody who wants to avoid the x86 and Arm ecosystems, both for the rent-seeking behaviors you mention, and also, in some instances, for security reasons.

      And, as others have mentioned, the ISA doesn't really matter. As long as it's agreed upon, then the CPU vendors can optimize on one side, and the compiler writers on the other side.

      Sure, Risc-V has its warts, but you can certainly say the same about all the rest.

      • mhh__ 49 minutes ago
        The ISA not mattering I think isn't as true when you account cost e.g. in a huge OOO cpu all the fusions and so on are afaict fairly doable but if you are on a cheaper / worse CPU all those extra bytes in the instruction stream do add up.
        • wren6991 29 minutes ago
          The RISC-V fusion arguments from back in ~2018 didn't really pan out. A lot of those fusion opportunities are just instructions now. slli + add? Zba (sh*add). slli + srli? Zbb (zext.*). slli + srai? Believe it or not, also Zbb (sext.*).

          Look at that pair of RVC instructions you used instead of a single 32-bit opcode. They are:

          * Taking up valuable compressed instruction space; each compressed codepoint has an opportunity cost of 64k uncompressed ones.

          * Limited in which registers they can use (usually x8..x15).

          * Often clobber their input operand instead of giving a free move.

          Also consider that the frequency data that drove the RVC compression decisions was driven by the lack of architecturally fused instructions like sh*add, so any arguments you derive from that data are circular. An instruction can be a good uarch fusion target because it's compressed, and a good compression target because you didn't fuse it in the architecture.

          I think designing for uarch fusion in your ISA is coming at it from the wrong end. Fusion is something uarch designers do to make up for shortcomings in the ISA.

  • tonypapousek 5 minutes ago
    Always good to see stuff from Dmitry; his presentation (Linux/4004) at last year’s Teardown was awesome.
  • kev009 2 hours ago
    It's basically MIPS all over again

    The conclusion is honest, and you can of course brute force any ISA into any role. I used to loathe x86 for that reason, but now that I'm older I respect the game.

    • api 1 hour ago
      X86 is the best argument that you can build a fast efficient RISC-V chip... because the X86 instruction set is a much bigger mess.

      It just blows my mind sometimes when designers don't learn insanely obvious lessons from the past, basic stuff like "complexity is evil" and "make the fast path overlap with the most common use cases" and "a standard with N optional extensions is actually N! (N factorial) standards."

      That being said all real world architectures seem to have messy corners and warts. RISC-V was a chance to do away with a lot of that and they... didn't?

      • rayiner 31 minutes ago
        > X86 is the best argument that you can build a fast efficient RISC-V chip... because the X86 instruction set is a much bigger mess.

        I don't think that's actually true. There's weird historical baggage and whatnot. But if you're running in long mode, it's actually a fairly sensible architecture with useful memory addressing modes.

    • kjs3 2 hours ago
      I think MIPS is a great example, and even there I don't think there's the bizarre bifurcation of ISA options RISC-V brings to the table.

      As a fellow olderster, I can't help but think that after almost 50 years of "ISA X is sooooo much better than x86 it's obvious ISA X is the future and x86 will be dead Real Soon Now (for whatever todays version of x86 is)" I can only shake my head ruefully and say "ping me when that happens".

      Controversial Take (that history proves isn't): Software matters; ISAs don't.

      • kevin_thibedeau 54 minutes ago
        x86 chips don't truly exist anymore. They only use it as a compressed ISA for a more capable internal representation that can be freely updated at any time.
        • kjs3 43 minutes ago
          I keep seeing this line of reasoning and have no idea why it's relevant. You don't program that 'internal representation'. The software people want to run only care if that software doesn't run. Cyrix, Transmeta,NexGen, Centaur, WinChip, etc., etc, theoretically had "more capable internal representation". The only thing that actually matters is "does it run the exact same x86 software I bought X many years ago" and "does it run it at a decent price/performance ratio". Everything else is dick measuring.

          Today, we have Intel and AMD, and some bit-player embedded folks.

        • jcranmer 14 minutes ago
          This is a load of bullshit that largely exists as copium to explain how x86 did the impossible and made a superscalar CISC processor. x86 is doing the same thing that (to my knowledge) all high-end processors do, yet no one tries to call out those chips as compiling to a different internal ISA. But you also don't see any chips trying to run with multiple ISA modes: the closest you get is 32-bit and 64-bit modes coexisting, or ARM's Thumb instruction set.
        • monocasa 23 minutes ago
          Sort of.

          They always had a much cleaner instruction set internally, going back to the 8086.

  • Retr0id 2 hours ago
    I wrote an RV64IMA emulator recently. I just needed a virtual CPU core that could boot linux, and RV64IMA seemed like the simplest way to do that - and I think that's more or less true.

    But then I wanted to be compatible with off-the-shelf toolchains and binaries, and I found myself needing to extend the ISA profile to RV64GC. Not a huge lift, but it involved pulling in a softfloat library. That got me as far as booting Alpine linux.

    And then I wanted to be able to boot Ubuntu, which needed RVA23, which was comparatively a much bigger lift, involving the vector instruction set among many other things. At this point I think I'd have been better off just emulating aarch64.

  • gblargg 1 hour ago
    Just noting, even if instructions were 100000000000000 bits long, reserving a single bit for 16-bit encoding would waste 50% of the instruction space.
  • UncleOxidant 50 minutes ago
    Is there a RISC-VI in the works where they try to learn from the RISC-V mistakes to make improvements?
    • dmitrygr 49 minutes ago
      Given the amount of learning that could have been done before RISC-V and wasn’t, I wouldn’t have such high hopes.
      • phire 13 minutes ago
        Considering just how many of the problems seem to come from RISC-V being a clean-sheet design, I suspect we would be better off not doing another.

        What I am interested in is the idea doing an AArch64 style revamp of the ISA, were much of the non-encoding semantic stuff is kept, but the entire instruction encoding (plus all the CSRs, and other things) are reworked to be sane.

        You might even do two reworkings in parallel, with one variable-width encoding optimised for microcontrollers, thumb-style; And the other being a fixed-width encoding optimised for wide out-of-order cores.

        And at the same time, you make a bunch of extensions mandatory, and unify others into bigger chunks; Code compiled to one of these two encodings would know it had access to a much wider range of instructions.

        The idea would be that any C code targeting RISC-V can be compiled to this encoding with close to zero changes, and that mechanical translation of exiting RISC-V binary code should be "possible", as none of the underlying semantics have changed. And the same would help any core wanting to natively support both (or all three) encodings, you would only need a front-end translator.

  • eek2121 1 hour ago
    Started reading, however I wanted to add this in: a lot of people expect RISC-V to do too many things, and nearly all of those things are "beat every other architecture out there in every way/shape/form, while also being open".

    The reality? The fastest "available" RISC-V CPUs don't match the best chips in terms of speed, power consumption, or die area. "available" obviously means the chips that have been released to the public and can be independently benchmarked.

    I do think that is okay, however I also think that those involved with RISC-V aren't helping much, and current attempts at standardizing seem to be just creating a bigger problem.

    That being said, RISC-V does seem to perform well in specific niches.

  • hn_submit 2 hours ago
    Why is he complaining about everything being optional in RISC-V? Isn't that the whole idea of RISC-V? The market can sort it out for themselves. RISC-V is already dominant in the MCU space despite its flaws, and many of them will be solved in due time.

    Most MCUs are used for dead-simple solutions, like electric blankets and microwaves with segment displays or LEDs. Whether their interrupts are handled in 44 or 22 cycles doesn't really matter that much.

    And RISC-V does have a link register, making returning much faster when the parameters for the interrupt can all fit in registers and no external memory access is needed, as is the case with most MCUs which put the stack in RAM. To fetch the return address an external memory access is always needed even if there are no parameters.

    • tsukikage 2 hours ago
      He explains, at length: there is no sane way to determine what the hardware you are running on actually supports, and so there is no sane way to ship compiled code that is both compatible and performant.

      We already had the mystery meat CPU wars several decades ago. We know how to make sane ISAs now and should be past that.

      • mappu 1 hour ago
        I'm not sure this is a real problem - for embedded you know a priori - for arbitrary desktop/SBC machines, misa will be available in kernel mode and /proc/cpuinfo will be available in user mode.
        • monocasa 21 minutes ago
          Well, misa won't be in most cases since you'll be running ins mode rather than m mode for most kernels on an application core (and misa won't tell you about the X* and Z* extensions).

          But you'll practically be passed a device tree from SBI that will tell you.

      • hn_submit 2 hours ago
        You don't need to probe what hardware you're running on because you know being the manufacturer. The code is bespoke for your solution and nothing more. No foreign code is going to run on it.

        Different problems require different solutions. An electric blanket doesn't need a barrel shifter for multiplication or even floating point hardware. The ISA can change depending on what's needed to solve a particular problem, not to provide an "one size fits all" solution.

        • jcranmer 33 minutes ago
          I'm not an embedded programmer myself, but from what I've heard... it's actually a pretty big assumption that the software people know what model hardware they're running on.

          Especially consider the possibility that a product manager decides to swap out the core for a different core to save 5¢ on the BOM. Does the product manager know to ask if the two cores follow the same RISC-V profile? Do the software programmers think to ask? How about communicating the change to all of the vendors or contractors providing you binary blobs? I don't know how likely it would be for a scenario like he author here describes, but it is definitely a plausible scenario.

          • monocasa 19 minutes ago
            That doesn't really happen in the embedded space.

            Even if the core was supported just fine, all of the IO mux stuff is pretty much guaranteed to be different even with the same chip in a different package.

            You're looking at explicit support for each chip.

          • hn_submit 28 minutes ago
            If the product manager isn't an engineer he shouldn't be making these decisions.
        • kjs3 1 hour ago
          I don't think I've read a more "doesn't actually know anything about how software is produced, but with absolute confidence knows everything about it" post in a very long time.
          • hn_submit 1 hour ago
            So you write software for a platform you know nothing about?
            • Twirrim 26 minutes ago
              > So you write software for a platform you know nothing about?

              That's how a sizeable chunk of software is written and shipped.

              Runtime detection of CPU features is very much a thing, and is in fact used extensively in software you use or interact with every single day.

              Just as a quick example, OpenSSL's approach for x86_64 is OPENSSL_ia32cap

              https://docs.openssl.org/master/man3/OPENSSL_ia32cap/

              This ensures (in theory, at least) that even if you're using your linux distribution's openssl library which is more generically targeted, you will get optimal/native runtime performance for your actual CPU.

            • dmitrygr 1 hour ago
              Very often. Yes. Or software that will run on any similar arch by auto detecting the environment.
            • kjs3 1 hour ago
              So you know nothing about me but engage in ad homen attacks because your fragile ego has been questioned. Keep digging, kid, keep digging.
              • fluffybucktsnek 22 minutes ago
                Both of your post are actual ad hominem towards OP. In the first, you just said they didn't know how software is developed, without elaborating. With this in mind, their reply is less of an ad hominem and more of an inquiry. In the next, you accuse them of having a fragile ego and being a kid. Not very insightful.
                • kjs3 17 minutes ago
                  LOL. Thanks Dad.
        • exmadscientist 1 hour ago
          > You don't need to probe what hardware you're running on because you know being the manufacturer. The code is bespoke for your solution and nothing more. No foreign code is going to run on it.

          In practice, this is not the case. The scenarios mentioned in the article involving binary blobs are pretty common, as well as other similar scenarios.

          Really, I'm going to go out and say it bluntly: it is just completely freaking stupid to make an architecture where everything is optional but you have no way to query what's present. If you're going to go the optional-pieces route, you have to have a query mechanism of some sort. As the article explains, you cannot even trap instructions on RISC-V to figure out what your core supports, because bad instructions might belong to some other option. Complete. Idiocy.

    • nickff 1 hour ago
      >"RISC-V is already dominant in the MCU space[...]"

      Where are you getting the idea that RISC-V is dominant? As someone who works in this space, that doesn't jive with my experience or the sources I've seen.[1] 32-bit microcontrollers only recently achieved a majority market share for gosh sakes!

      RISC-V is claiming that they have achieved 25% market share across selected segments, but they're still behind ARM (and x86).[2]

      [1] https://www.grandviewresearch.com/industry-analysis/microcon...

      [2] https://www.aestechno.com/en/risc-v-2026-arm-x86-market/

      • hn_submit 19 minutes ago
        It's used widely in Chinese stuff (which is basically everything) so in terms of volume it's probably already dominant.

        In terms of dollar volume ARM is still the leader, especially for higher-end (application level MCUs) stuff. RISC-V MCUs with MMUs or MPUs are scarce at the moment.

      • gertop 56 minutes ago
        Risc-v is nowhere near dominant, people are just being swayed by headlines such as Western Digital or Nvidia shipping billions of risc-v cores.

        I do find it odd that you go on and compare to x86 marketshare however, the topic you've quoted is very clearly about MCU and whilst 8086 MCU still exists they haven't been used in greenfield projects for decades. Let alone any more recent x86 implementation.

    • walrus01 2 hours ago
      > The market can sort it out for themselves

      Because nobody will write software for 300 unique hardware variations of a platform that have inconsistent capabilities. Consistency is one of the reasons why x86-64 with extensions like like SSE, AVX2 etc is popular.

      • kjs3 1 hour ago
        Noone uses an 8051 because it's elegant. Billions are still still sold every year because no matter if you learned it in the 70s or last week and no matter who made it, the basics are exactly alike. Software matters; ISAs don't.
        • monocasa 16 minutes ago
          Every time I've seen someone use an 8051 in the past twenty years, it's had new, bespoke software written for it. They were more used because they were a known quantity with the parents obviously dead rather than support for existing codebases.
        • lowbloodsugar 32 minutes ago
          >You learned it in the 70s [emphasis mine]

          I really don't know anything about this space, but you just said that 8051 is dominant because it has one dominant architecture since the 70s. It has hundreds of manufacturers making identical parts.

          As you say, software matters. If the Software can't run because of hundreds of extensions that can't be checked for, then you're going to pick a target that works, no? So in fact the ISA matters most: which ISA has the most software? Which ISA means my software runs on the most devices?

          • kjs3 20 minutes ago
            I really don't know anything about this space

            And yet you couldn't help yourself...

            but you just said that 8051 is dominant

            I said absolutely no such thing.

            If the Software can't run because of hundreds of extensions

            The software in the x86 world runs because there aren't hundreds of mutually incompatible extensions. I think the last time there was a major completely incompatible x86 ISA divergence was AMD "3DNow" vs other SIMD extensions. AFAIK the rest were "processor X got feature Y later than competitor Z".

            Which ISA means my software runs on the most devices?

            Easiest question evah: x86.

      • hn_submit 1 hour ago
        I believe the market will standardize on certain extensions for specific solutions. No one is going to make a mobile phone with only RV32I, for example.
        • monocasa 15 minutes ago
          Yeah, that's the point of the profiles. A curated set of extensions for common use cases like application cores for generic software to target.
      • fluffybucktsnek 1 hour ago
        > Because nobody will write software for 300 unique hardware variations

        Who said they have to? One can select a RISC-V configuration for a baseline for a particular purpose. Desktop? Choose the one that's most powerful.

        ARM is more popular than x86 and is less consistent than it.

  • ethin 2 hours ago
    I can definitely see his argument, although I still do believe RISC-V did a lot of things better than x86...

    I really do hope that the arch is eventually able to fix this. Better that there be an open ISA than them all be closed IMO.

    • wmf 2 hours ago
      Better than x86 is a low bar when ARMv8 exists.
    • hn_submit 1 hour ago
      He has good points, except he misses the goal posts completely.
    • kjs3 2 hours ago
      Yeah...risc-v can learn from 50 years of x86 (among others). And yet.......
  • mappu 2 hours ago
    RVA23 hardware is available (e.g. SpacemiT K3)
    • Joel_Mckay 1 hour ago
      Some are already on RVA23.1 even before the standard made it to more than 4 manufacturers product lines.

      The meme joke about standards is sadly relevant for riscv. =3

      https://xkcd.com/927/

      • d-us-vb 56 minutes ago
        As I’ve come to understand it, standards simplify intensionally, not extensionally. For those who select a part that is compliant with a standard, more standards to choose from is better because engineers are able to make better tradeoffs; they’re not forced to select a part that does way more than the application needs thus making the product more expensive if there are lots of “competing” standards: some do less some do more.

        For RV, a litany of standardized modules creates a system where each capability that the module provides will have a standard interface. No manufacturer is forced to invent extensions bespoke to their implementation, but they’re not forced to support everything the most powerful models do either.

        Just my two cents.

  • __d 2 hours ago
    So … use RISC-V as the strawman, and create a community-based RISC-6 that doesn’t have these weaknesses? Better to get in now before it becomes too solidly entrenched.
    • inigyou 2 hours ago
      You can't make a community-based ISA, it's not possible unless you have a community-based fab. He who makes the chips makes the rules.
      • monocasa 13 minutes ago
        I mean, a shuttle run is pretty cheap these days. If you have silicon, and customers, scaling past a shuttle run that worked is pretty low additional cost.
    • IshKebab 2 hours ago
      Likely impossible unless you somehow come up with something vastly better (unlikely).

      None of these things are remotely bad enough to make the downsides of using another ISA palatable.

      • NetMageSCW 2 hours ago
        Anther ISA like ARM? It seems pretty palatable to just about everyone not academic.
        • duskwuff 1 hour ago
          The ARM ISAs are not free to implement. ARM holds patents relevant to the ISA.
          • phendrenad2 1 hour ago
            Until the patents expire, which many have already.
        • IshKebab 1 hour ago
          You're vastly underestimating the amount of work that has gone into RISC-V that would need to be redone. It's not just a spec. There's an absolute mountain of software and hardware supporting it.
  • exmadscientist 2 hours ago
    > After being asked for the Nth time to explain, I decided to put it all down in one place so that I could simply link to it when asked next.

    Bookmarked, because I've needed the same.

    The worst part of all this is that they really should have known better by now. In 1980 you could make these kinds of mistakes, because this was pretty new territory. In 2020, doing this just makes you stupid. Or ignorant. Or both.

    • NetMageSCW 2 hours ago
      I’m not so sure - the 6502 existed in 1980 and showed the way.
      • bsder 1 hour ago
        6809 is a better exemplar, but, yeah, we knew this stuff way back when.

        The problem is that everybody around RISC-V wants to sell IP instead of a chip. Most of the worst brain damage follows from that.

        The rest of the brain damage follows from "We want to compete with ARM A-Series cores." No. Just ... no. Nobody willing to spend that much on a processor gives one iota of damn about ARM licensing fees.

        So, the semiconductor market wants a cheap, consistent chip that operates in the deep embedded space while the RISC-V ecosystem considers the mere thought of that to be icky beyond reason. And China will push on this like Longsoon and pray that somebody figures out how to make it not suck (Prediction: they won't succeed.)

        And, the worst part is that RISC-V has basically lost its window. The single possible advantage that RISC-V had was that as people converged to a shared tooling ecosystem it would create lockout. Unfortunately, that convergence never happened so, at best, we got some shared compilers. And, now, AIs can basically one shot all your other tools around it and probably the compiler not far behind. And there goes your ecosystem lockout.

        • hn_submit 1 hour ago
          Because selling "bits" is very lucrative, whilst actual hardware can lead to huge losses if it doesn't sell. Just ask Microsoft.

          It's no wonder Microsoft is pulling out of the game console market and handing it over to PC manufacturers to make the actual hardware.

  • brcmthrowaway 2 hours ago
    > What does a cheap microcontroller core need? Let's inspect what they are used for. Typical use cases are to interface with and quickly reconfigure hardware blocks in a larger chip, eg in an MP3 player, an SD card, or a USB stick. The hard work is done by custom IP and the CPU core is just there to occasionally prod a register or configure something.

    He forgot electronic cigarettes (vapes)

  • IshKebab 2 hours ago
    I think a lot of this criticism is completely true. However it's also overblown. I do think the ISA matters, but little mistakes like these definitely don't matter enough to preclude making M-series class chips. The reason it hasn't happened yet is simply time. It takes a really really long time to build up to that level of performance.

    They've definitely gone overboard on the optionality stuff though. I don't think it matters too much for the actual CPU design but it makes verification and writing portable software a huge pain. Profiles definitely help but still...

    Oh also I feel like you could probably come up with an equally compelling list about any other ISA. It's not like the fact that something has flaws means it's bad.

    • NetMageSCW 2 hours ago
      I don’t think making optional what optional features are available is a little mistake. It is a torpedo to the waterline.
      • IshKebab 1 hour ago
        It's not. In practice you have two scenarios:

        1. You have a microcontroller. You're compiling code yourself and the docs tells you what features are available and which compiler flags to use.

        2. You are writing application code. In that case you simply target RVA23.

        The edge case is the same edge case where you use CPUID on x86, I.e. you want to target say RVA23 and RVA28 in the same binary. In that case you do have to use the OS APIs to discover what is supported... which is slightly annoying, but in practice you're just calling a different function.

        In theory `mconfigptr` will eventually make this a lot nicer but nobody has put in the effort to define how it works yet (last I heard they were looking at ASN.1 sick emoji).

        • yjftsjthsd-h 48 minutes ago
          > You are writing application code. In that case you simply target RVA23.

          You're allowed to not handle a majority of extant Linux-capable machines, but it seems like an awkward position.

    • eek2121 1 hour ago
      ALL chip designs are an exercise of minmaxing these 3 variables:

      1) power

      2) performance

      3) die area

      SOME chip designs also care about a 4th:

      4) die area.

      NO design has the best of all...it is impossible since you have to trade 1 for another. The reason x86 has been dominate for so long is that is strikes a good balance across all areas, especially #4. A good balance is what you need for a good chip.

      EDIT: oh and you can't beat the system I mentioned above. The laws of physics are the reason why.

      • Tuna-Fish 22 minutes ago
        You forgot the variable that RISC-V chose to maximize:

        5) Weird principles that are completely detached from anyone's actual needs and that are carried to a length similar to religious convictions.

        My biggest personal pet peeve about the architecture is the JAL instruction.

        That is, PC-relative jump and link immediate, which jumps to an PC + sign extended immediate value and stores the address of the next instruction in a register. This is your most basic function call instruction. It only has an immediate range of 21 bits. Even a few bits scavenged from somewhere would really help it, ±megabyte of range is in the vicinity of what you need for internal calls but not generally enough.

        It's a 32-bit instruction, so why can it only support 21 bits of immediate? Because the people who made RISC-V decided that implicit register arguments are works of the devil, and that you need to use any register as argument for any instruction. Therefore the RISC-V JAL instruction contains a 6-bit field for destination register, which is where they store the next instruction address. Never mind that there is not and will never be a compiler that emits anything but the ABI compliant return address register "ra" to that field, we decided we won't have implicit arguments so by god we are going to pointlessly sacrifice 5 bits⁰ of space in every single fucking branch, often forcing the user to construct the address in a register and use more instructions instead, which is much worse than it sounds, because branch prediction is easier for immediate branches.

        This is not the biggest actual problem with the architecture. They added an instruction that adds upper immediate bits to PC, which the any core that implements instruction fusion fuses with jalr. But that sacrifices the low-end, that doesn't fuse anything, and uses two instructions for an extremely common pattern that everyone else manages in one. The reason I hate this one so much because there is no actual reason to make this mistake. A five minute conversation between two engineers should have killed this one in the crib, literally everyone knows not to do this. Apparently other than the RISC-V folks.

        0: I give them one bit, because the opcode is short and they use the zero register to suppress the link and turn it into a normal jump.

  • brcmthrowaway 2 hours ago
    What happened to the Rivos accelerator cores?
    • tsukikage 2 hours ago
      Meta acquired Rivos last year.
    • IshKebab 2 hours ago
      They got bought by Meta who then fired half of them.
  • brcmthrowaway 2 hours ago
    It's clear that RISC-V started as an academic exercise (albeit from a group with esteemed credentials) and they had to bolt on these hacks to make it work in industry.

    Sad.