orc.b
Bitware OR-combine, byte granule
This instruction is defined by:
-
anyOf:
-
B, version >= 0
-
Zbb, version >= 0
-
This instruction is included in the following profiles:
-
RVA22U64 (Mandatory)
Synopsis
Combines the bits within each byte using bitwise logical OR. This sets the bits of each byte in the result rd to all zeros if no bit within the respective byte of rs is set, or to all ones if any bit within the respective byte of rs is set.
Execution
-
IDL
-
Sail
if (implemented?(ExtensionName::B) && (CSR[misa].B == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
XReg input = X[rs1];
XReg output = 0;
for (U32 i = 0; i < (xlen() - 8); i = i + 8) {
output[(i + 7):i] = (input[(i + 7):i] == 0) ? 8'd0 : ~8'd0;
}
X[rd] = output;
{
let rs1_val = X(rs1);
result : xlenbits = zeros();
foreach (i from 0 to (sizeof(xlen) - 8) by 8)
result[(i + 7) .. i] = if rs1_val[(i + 7) .. i] == zeros()
then 0x00
else 0xFF;
X(rd) = result;
RETIRE_SUCCESS
}