target/whirl.c
static void generate_op_command(WhirlCodeSegment *segment, RingState *state, OpCmd cmd) {
    if (state->active_ring == MATH_RING) {
        // If we're on the wrong ring, we need to execute a nop command to switch to
        // the operations ring
        generate_math_command(segment, state, MATH_NOOP);
    }

    if (should_switch(state->cur_op_pos, cmd, state->op_dir)) {
        emit_zero(segment, state);
    }

    while (state->cur_op_pos != cmd) {
        emit_one(segment, state);
    }

    emit_zero(segment, state);
    emit_zero(segment, state);
}
// Generates the Whirl code to execute a command on the operations ring, taking
// into account the current state of the command rings
Generates the Whirl code to execute a command on the operations ring, taking
into account the current state of the command rings
Generates the Whirl code to execute a command on the operations ring taking into account the current state of the command rings
static void generate_op_command(WhirlCodeSegment *segment, RingState *state, OpCmd cmd) {
    if (state->active_ring == MATH_RING) {
        generate_math_command(segment, state, MATH_NOOP);
    }
    if (should_switch(state->cur_op_pos, cmd, state->op_dir)) {
        emit_zero(segment, state);
    }
    while (state->cur_op_pos != cmd) {
        emit_one(segment, state);
    }
    emit_zero(segment, state);
    emit_zero(segment, state);
}
static void generate_op_command ( WhirlCodeSegment * segment , RingState * state , OpCmd cmd ) { if ( state -> active_ring == MATH_RING ) { generate_math_command ( segment , state , MATH_NOOP ) ; } if ( should_switch ( state -> cur_op_pos , cmd , state -> op_dir ) ) { emit_zero ( segment , state ) ; } while ( state -> cur_op_pos != cmd ) { emit_one ( segment , state ) ; } emit_zero ( segment , state ) ; emit_zero ( segment , state ) ; }
Generates the Whirl code to execute a command on the operations ring, taking
into account the current state of the command rings
Generates the Whirl code to execute a command on the operations ring taking into account the current state of the command rings
// If we're on the wrong ring, we need to execute a nop command to switch to // the operations ring