@@ -150,21 +150,21 @@ class ReplayCacheIntrinsics : public HookCode {
150150 bool checkInstruction (insn_t insn) {
151151 const auto rvinsn = (riscv_insn)insn->id ;
152152 switch (rvinsn) {
153- case RISCV_INS_AUIPC : {
153+ case RISCV_INS_C_LI : {
154154 // Extract the operands
155155 const auto rd = insn->detail ->riscv .operands [0 ];
156- const auto imm20 = insn->detail ->riscv .operands [1 ];
156+ const auto imm = insn->detail ->riscv .operands [1 ];
157157 assert (rd.type == RISCV_OP_REG);
158- assert (imm20 .type == RISCV_OP_IMM);
158+ assert (imm .type == RISCV_OP_IMM);
159159
160160 // Process in case rd is x31 (t6)
161161 if (rd.reg == RISCV_REG_X31) {
162162 // Read the immediate value
163- const auto imm1_value = imm20 .imm ;
164- p_debug << printLeader () << " AUIPC x31, " << imm1_value << " : " ;
163+ const auto imm_value = imm .imm ;
164+ p_debug << printLeader () << " C.LI x31, " << imm_value << " : " ;
165165
166166 bool was_cache_instr = false ;
167- switch (imm1_value ) {
167+ switch (imm_value ) {
168168 case 0 : p_debug << " start region" << std::endl;
169169 // Store the PC for verification
170170 last_region_register_value = getRegisterValue (_Arch::Register::REG_PC);
@@ -186,10 +186,10 @@ class ReplayCacheIntrinsics : public HookCode {
186186 power_failure_generator.failNext ();
187187 break ;
188188 default :
189- assert (false && " AUIPC immediate for region register not recognized" );
189+ assert (false && " C.LI immediate for region register not recognized" );
190190 break ;
191191 }
192- // Adjust for any effects that this special AUIPC instruction might have had
192+ // Adjust for any effects that this special instruction might have had
193193 setRegisterValue (_Arch::Register::REG_X31, last_region_register_value);
194194 if (was_cache_instr)
195195 return true ;
0 commit comments