orc.b
Bitware OR-combine, byte granule
- Extension
- Zbb
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
orc.b xd, xs1- Length
- 32-bit
Encoding
| 3120 | 1915 | 1412 | 117 | 60 | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 001010000111 | rs1 | 101 | rd | 0010011 | |||||||||||||||||||||||||||
Match 0x28705013, mask 0xfff0707f. Source: orc.b rd rs1 31..20=0x287 14..12=0x5 6..0=0x13 in riscv-opcodes/extensions/rv_zbb.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
Combines the bits within each byte using bitwise logical OR. This sets the bits of each byte in the result xd to all zeros if no bit within the respective byte of xs1 is set, or to all ones if any bit within the respective byte of xs1 is set.
Description from riscv-unified-db, reformatted.
Operation
XReg input = X[xs1];
XReg output = 0;
for (U32 i=0; i < xlen(); i = i+8) {
output[(i+7):i] = (input[(i+7):i] == 0) ? 8'd0 : ~8'd0;
}
X[xd] = output;Pseudocode in riscv-unified-db’s IDL, quoted unchanged.