Webcentive RISC-V Reference

c.or

Or

Extension
C
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.or xd, xs2
Length
16-bit (compressed)

Encoding

1513121097654210
100011rs1′/rs2′10rs2′01

Match 0x8c41, mask 0xfc63. Source: c.or rd_rs1_p rs2_p 1..0=1 15..13=4 12..10=0b011 6..5=2 in riscv-opcodes/extensions/rv_c.

FieldBitsriscv-opcodes name
rs1′/rs2′9:7rd_rs1_p
rs2′4:2rs2_p

Description

Or xd with xs2, and store the result in xd The xd and xs2 register indexes should be used as xd+8 and xs2+8 (registers x8-x15). C.OR expands into or xd, xd, xs2.

Description from riscv-unified-db, reformatted.

Operation

XReg t0 = X[creg2reg(xd)];
XReg t1 = X[creg2reg(xs2)];
X[creg2reg(xd)] = t0 | t1;

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages