The specification of bitmanip instructions became stable from draft: https://github.com/riscv/riscv-bitmanip
So I propose to support these instructions, which could make following benefits.
- Accelerate several math.bits functions, such as bits.CountLeadingZeros
- Accelerate logal and/ori/xori, for example, "x=x&0xfffeffff" can be simplifed to a single instruction "bclri $16, Reg"
- integer extension can be simplifed with a single "bext" from current pari of arithmetic left/right shift.
- others
However, there is no real world hardware support them now, but we can implement them in the assmbler by now.
One concern, Go's riscv64 implies the i-a-m-f-d extensions (also known as rv64g ), do we need something like GORISCV64=GB to enable the B-extension instrutions?
The specification of bitmanip instructions became stable from draft: https://github.com/riscv/riscv-bitmanip
So I propose to support these instructions, which could make following benefits.
However, there is no real world hardware support them now, but we can implement them in the assmbler by now.
One concern, Go's riscv64 implies the i-a-m-f-d extensions (also known as rv64g ), do we need something like GORISCV64=GB to enable the B-extension instrutions?