rv32emu icon indicating copy to clipboard operation
rv32emu copied to clipboard

jit: Incomplete `muldivmod`

Open jserv opened this issue 1 year ago • 0 comments

Function muldivmod in src/jit_x64.c is incomplete:

    /* Short circuit for imm == 0 */
    if (!reg && imm == 0) {
        assert(NULL);                                                                                                                                         
        if (div || mul) {
            /* For division and multiplication, set result to zero. */
            emit_alu32(state, 0x31, dst, dst);
        } else {
            /* For modulo, set result to dividend. */
            emit_mov(state, dst, dst);
        }
        return;
    }

When imm equals to zero, there is no chance to resume the execution.

jserv avatar Dec 16 '23 17:12 jserv