gen/genascon.c
static void alloc_low_reg(int *reg)
{
    unsigned index;
    if (*reg != -1) {
        fprintf(stderr, "Temporary register wasn't previously released\n");
        exit(1);
    }
    for (index = num_regs; index > 0; --index) {
        if (!reg_in_use[index - 1]) {
            reg_in_use[index - 1] = 1;
            reg_used[index - 1] = 1;
            *reg = regs[index - 1];
            return;
        }
    }
    fprintf(stderr, "Ran out of temporary registers\n");
    exit(1);
}
// Allocate an unused register, starting with low registers
// because we know we won't need the value in a high reg later.
Allocate an unused register, starting with low registers
because we know we won't need the value in a high reg later.
Allocate an unused register starting with low registers because we know we won ' t need the value in a high reg later .
static void alloc_low_reg(int *reg)
{
    unsigned index;
    if (*reg != -1) {
        fprintf(stderr, "Temporary register wasn't previously released\n");
        exit(1);
    }
    for (index = num_regs; index > 0; --index) {
        if (!reg_in_use[index - 1]) {
            reg_in_use[index - 1] = 1;
            reg_used[index - 1] = 1;
            *reg = regs[index - 1];
            return;
        }
    }
    fprintf(stderr, "Ran out of temporary registers\n");
    exit(1);
}
static void alloc_low_reg ( int * reg ) { unsigned index ; if ( * reg != -1 ) { fprintf ( stderr , " \n " ) ; exit ( 1 ) ; } for ( index = num_regs ; index > 0 ; -- index ) { if ( ! reg_in_use [ index - 1 ] ) { reg_in_use [ index - 1 ] = 1 ; reg_used [ index - 1 ] = 1 ; * reg = regs [ index - 1 ] ; return ; } } fprintf ( stderr , " \n " ) ; exit ( 1 ) ; }
Allocate an unused register, starting with low registers
because we know we won't need the value in a high reg later.
Allocate an unused register starting with low registers because we know we won ' t need the value in a high reg later .