Webcentive RISC-V Reference

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

31201915141211760
001010000111rs1101rd0010011

Match 0x28705013, mask 0xfff0707f. Source: orc.b rd rs1 31..20=0x287 14..12=0x5 6..0=0x13 in riscv-opcodes/extensions/rv_zbb.

FieldBitsriscv-opcodes name
rs119:15rs1
rd11:7rd

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.

Specification and related pages