@@ -325,6 +325,9 @@ const opcode0x13func3Table: FuncTable<I_Type> = new Map([
325325 } else if ( func7 === 0x14 ) { // bseti (Zbb)
326326 const result = rs1Value | ( 1 << shamt ) ;
327327 registerSet . setRegister ( rd , result ) ;
328+ } else if ( func7 === 0x24 ) { // bclri (Zbs)
329+ const result = rs1Value & ~ ( 1 << shamt ) ;
330+ registerSet . setRegister ( rd , result ) ;
328331 } else if ( immU === 0b011000000001 ) { // ctz (Zbb)
329332 let tmp = rs1Value >>> 0 ;
330333 if ( tmp === 0 ) {
@@ -392,6 +395,10 @@ const opcode0x13func3Table: FuncTable<I_Type> = new Map([
392395 const result = rs1Value >> shamt ;
393396 registerSet . setRegister ( rd , result ) ;
394397
398+ } else if ( func7 === 0x24 ) { // bexti (Zbs)
399+ const result = ( rs1Value >>> shamt ) & 1 ;
400+ registerSet . setRegister ( rd , result ) ;
401+
395402 } else throw Error ( `Unknown instruction, func7: 0x${ func7 . toString ( 16 ) } ` ) ;
396403 } ] ,
397404
@@ -508,6 +515,10 @@ const opcode0x33func3Table: FuncTable<R_Type> = new Map([
508515 const index = rs2Value & 31 ;
509516 const result = rs1Value | ( 1 << index ) ;
510517 registerSet . setRegister ( rd , result ) ;
518+ } else if ( func7 === 0x24 ) { // bclr (Zbs)
519+ const index = rs2Value & 31 ;
520+ const result = rs1Value & ~ ( 1 << index ) ;
521+ registerSet . setRegister ( rd , result ) ;
511522 } else throw Error ( `Unknown instruction, func7: 0x${ func7 . toString ( 16 ) } ` ) ;
512523 } ] ,
513524
0 commit comments