Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jit: Incomplete muldivmod #297

Open
jserv opened this issue Dec 16, 2023 · 0 comments
Open

jit: Incomplete muldivmod #297

jserv opened this issue Dec 16, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jserv
Copy link
Contributor

jserv commented Dec 16, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants