functions.c
// Load an 8-byte of a struct/union that exclusively have floats and doubles in it into a register.
// The struct/union already has an alignment of either 4 or 8, so it can be loaded with simple instructions.
Load an 8-byte of a struct/union that exclusively have floats and doubles in it into a register.
The struct/union already has an alignment of either 4 or 8, so it can be loaded with simple instructions.
Load an 8 - byte of a struct / union that exclusively have floats and doubles in it into a register . The struct / union already has an alignment of either 4 or 8 so it can be loaded with simple instructions .
static int make_sse_struct_or_union_arg_move_instructions(
    Function *function, Tac *ir, Value *param, int preg_class, int register_index,
    FunctionParamLocation *pl, RegisterSet *register_set) {
    if (debug_function_arg_mapping) printf("Adding arg move from struct to SSE register_index=%d register size=%d\n", register_index, pl->stru_size);
    if (pl->stru_size == 4) {
        Value *temp = load_struct_scalar(function, ir, param, pl, new_type(TYPE_FLOAT));
        return add_arg_move_to_register(function, ir, new_type(TYPE_FLOAT), temp, preg_class, register_index, register_set);
    }
    else if (pl->stru_size == 8 && pl->stru_member_count == 1) {
        Value *temp = load_struct_scalar(function, ir, param, pl, new_type(TYPE_DOUBLE));
        return add_arg_move_to_register(function, ir, new_type(TYPE_DOUBLE), temp, preg_class, register_index, register_set);
    }
    else {
        Value *temp_int = load_struct_scalar(function, ir, param, pl, new_type(TYPE_LONG));
        Value *temp_sse = new_value();
        temp_sse->type = new_type(TYPE_DOUBLE);
        temp_sse->vreg = ++function->vreg_count;
        insert_instruction_from_operation(ir, IR_MOVE_PREG_CLASS, temp_sse, temp_int, 0, 1);
        return add_arg_move_to_register(function, ir, new_type(TYPE_DOUBLE), temp_sse, preg_class, register_index, register_set);
    }
}
static int make_sse_struct_or_union_arg_move_instructions ( Function * function , Tac * ir , Value * param , int preg_class , int register_index , FunctionParamLocation * pl , RegisterSet * register_set ) { if ( debug_function_arg_mapping ) printf ( " \n " , register_index , pl -> stru_size ) ; if ( pl -> stru_size == 4 ) { Value * temp = load_struct_scalar ( function , ir , param , pl , new_type ( TYPE_FLOAT ) ) ; return add_arg_move_to_register ( function , ir , new_type ( TYPE_FLOAT ) , temp , preg_class , register_index , register_set ) ; } else if ( pl -> stru_size == 8 && pl -> stru_member_count == 1 ) { Value * temp = load_struct_scalar ( function , ir , param , pl , new_type ( TYPE_DOUBLE ) ) ; return add_arg_move_to_register ( function , ir , new_type ( TYPE_DOUBLE ) , temp , preg_class , register_index , register_set ) ; } else { Value * temp_int = load_struct_scalar ( function , ir , param , pl , new_type ( TYPE_LONG ) ) ; Value * temp_sse = new_value ( ) ; temp_sse -> type = new_type ( TYPE_DOUBLE ) ; temp_sse -> vreg = ++ function -> vreg_count ; insert_instruction_from_operation ( ir , IR_MOVE_PREG_CLASS , temp_sse , temp_int , 0 , 1 ) ; return add_arg_move_to_register ( function , ir , new_type ( TYPE_DOUBLE ) , temp_sse , preg_class , register_index , register_set ) ; } }
Load an 8-byte of a struct/union that exclusively have floats and doubles in it into a register.
Load an 8 - byte of a struct / union that exclusively have floats and doubles in it into a register .
// Move a single float // Move a single double // Move two floats. It must first be loaded into an integer register and then // copied to an SSE register.