diff --git a/hdl/rv_opcodes.vh b/hdl/rv_opcodes.vh index 33b1160..66668b4 100644 --- a/hdl/rv_opcodes.vh +++ b/hdl/rv_opcodes.vh @@ -67,6 +67,44 @@ localparam RV_DIVU = 32'b0000001??????????101?????0110011; localparam RV_REM = 32'b0000001??????????110?????0110011; localparam RV_REMU = 32'b0000001??????????111?????0110011; +// B extension 1.0 rc: (Zba, Zbb, Zbc, Zbs) +// Zba (address generation) +localparam RV_SH1ADD = 32'b0010000??????????010?????0110011; +localparam RV_SH2ADD = 32'b0010000??????????100?????0110011; +localparam RV_SH3ADD = 32'b0010000??????????110?????0110011; +// Zbb (basic bit manipulation +localparam RV_ANDN = 32'b0100000??????????111?????0110011; +localparam RV_CLZ = 32'b011000000000?????001?????0010011; +localparam RV_CPOP = 32'b011000000010?????001?????0010011; +localparam RV_CTZ = 32'b011000000001?????001?????0010011; +localparam RV_MAX = 32'b0000101??????????110?????0110011; +localparam RV_MAXU = 32'b0000101??????????111?????0110011; +localparam RV_MIN = 32'b0000101??????????100?????0110011; +localparam RV_MINU = 32'b0000101??????????101?????0110011; +localparam RV_ORC_B = 32'b001010000111?????101?????0010011; +localparam RV_ORN = 32'b0100000??????????110?????0110011; +localparam RV_REV8 = 32'b011010011000?????101?????0010011; +localparam RV_ROL = 32'b0110000??????????001?????0110011; +localparam RV_ROR = 32'b0110000??????????101?????0110011; +localparam RV_RORI = 32'b0110000??????????101?????0010011; +localparam RV_SEXT_B = 32'b011000000100?????001?????0010011; +localparam RV_SEXT_H = 32'b011000000101?????001?????0010011; +localparam RV_XNOR = 32'b0100000??????????100?????0110011; +localparam RV_ZEXT_H = 32'b000010000000?????100?????0110011; +// Zbc (carry-less multiply) +localparam RV_CLMUL = 32'b0000101??????????001?????0110011; +localparam RV_CLMULH = 32'b0000101??????????011?????0110011; +localparam RV_CLMULR = 32'b0000101??????????010?????0110011; +// Zbs (single-bit manipulation) +localparam RV_BCLR = 32'b0100100??????????001?????0110011; +localparam RV_BCLRI = 32'b0100100??????????001?????0010011; +localparam RV_BEXT = 32'b0100100??????????101?????0110011; +localparam RV_BEXTI = 32'b0100100??????????101?????0010011; +localparam RV_BINV = 32'b0110100??????????001?????0110011; +localparam RV_BINVI = 32'b0110100??????????001?????0010011; +localparam RV_BSET = 32'b0010100??????????001?????0110011; +localparam RV_BSETI = 32'b0010100??????????001?????0010011; + // C Extension localparam RV_C_ADDI4SPN = 16'b000???????????00; // *** illegal if imm 0 localparam RV_C_LW = 16'b010???????????00;