←back to thread

154 points rbanffy | 2 comments | | HN request time: 0.436s | source
Show context
dlcarrier ◴[] No.45075524[source]
It's interesting that a high-performance computing core has added instructions for bit manipulation. They're really common on low-power embedded cores, where bit manipulating inputs and outputs is more common. They can save a lot of instructions when needed, though. For example, clearing a bit in a variable, without an express instruction, requires raising two to the power of the bit, inverting the result, anding that with the variable, then writing the result back to the variable. Depending on the language, it looks something like this:

    Variable &=~(2^Bit)
The series of bitwise operators looks more grawlix (https://en.wikipedia.org/wiki/Grawlix) than instructions, as though yelling pejoratives at the bit is what clears it.
replies(4): >>45075580 #>>45075627 #>>45075809 #>>45075920 #
1. bri3d ◴[] No.45075580[source]
The bit manipulation instructions are a required part of the RVA23 baseline standard, so we're likely to see them in almost all general purpose RISC-V cores in the future.
replies(1): >>45075929 #
2. Arnavion ◴[] No.45075929[source]
Since RVA22 actually. B = Zba + Zbb + Zbs and RVA22 requires those individually.