Revision e4d5434c tcg/tcg.c

b/tcg/tcg.c
1196 1196
        if (!ts->mem_coherent) {
1197 1197
            if (!ts->mem_allocated) 
1198 1198
                temp_allocate_frame(s, temp);
1199
            tcg_out_st(s, reg, ts->mem_reg, ts->mem_offset);
1199
            tcg_out_st(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1200 1200
        }
1201 1201
        ts->val_type = TEMP_VAL_MEM;
1202 1202
        s->reg_to_temp[reg] = -1;
......
1296 1296
        } else {
1297 1297
            reg = tcg_reg_alloc(s, arg_ct->u.regs, s->reserved_regs);
1298 1298
        }
1299
        tcg_out_ld(s, reg, ts->mem_reg, ts->mem_offset);
1299
        tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1300 1300
    } else if (ts->val_type == TEMP_VAL_CONST) {
1301 1301
        if (ots->val_type == TEMP_VAL_REG) {
1302 1302
            reg = ots->reg;
......
1343 1343
        ts = &s->temps[arg];
1344 1344
        if (ts->val_type == TEMP_VAL_MEM) {
1345 1345
            reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1346
            tcg_out_ld(s, reg, ts->mem_reg, ts->mem_offset);
1346
            tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1347 1347
            ts->val_type = TEMP_VAL_REG;
1348 1348
            ts->reg = reg;
1349 1349
            ts->mem_coherent = 1;
......
1501 1501
        arg = args[nb_oargs + i];
1502 1502
        ts = &s->temps[arg];
1503 1503
        if (ts->val_type == TEMP_VAL_REG) {
1504
            tcg_out_st(s, ts->reg, TCG_REG_CALL_STACK, stack_offset);
1504
            tcg_out_st(s, ts->type, ts->reg, TCG_REG_CALL_STACK, stack_offset);
1505 1505
        } else if (ts->val_type == TEMP_VAL_MEM) {
1506 1506
            reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type], 
1507 1507
                                s->reserved_regs);
1508 1508
            /* XXX: not correct if reading values from the stack */
1509
            tcg_out_ld(s, reg, ts->mem_reg, ts->mem_offset);
1510
            tcg_out_st(s, reg, TCG_REG_CALL_STACK, stack_offset);
1509
            tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1510
            tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
1511 1511
        } else if (ts->val_type == TEMP_VAL_CONST) {
1512 1512
            reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type], 
1513 1513
                                s->reserved_regs);
1514 1514
            /* XXX: sign extend may be needed on some targets */
1515 1515
            tcg_out_movi(s, ts->type, reg, ts->val);
1516
            tcg_out_st(s, reg, TCG_REG_CALL_STACK, stack_offset);
1516
            tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
1517 1517
        } else {
1518 1518
            tcg_abort();
1519 1519
        }
......
1532 1532
                tcg_out_mov(s, reg, ts->reg);
1533 1533
            }
1534 1534
        } else if (ts->val_type == TEMP_VAL_MEM) {
1535
            tcg_out_ld(s, reg, ts->mem_reg, ts->mem_offset);
1535
            tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1536 1536
        } else if (ts->val_type == TEMP_VAL_CONST) {
1537 1537
            /* XXX: sign extend ? */
1538 1538
            tcg_out_movi(s, ts->type, reg, ts->val);
......
1549 1549
    const_func_arg = 0;
1550 1550
    if (ts->val_type == TEMP_VAL_MEM) {
1551 1551
        reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1552
        tcg_out_ld(s, reg, ts->mem_reg, ts->mem_offset);
1552
        tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1553 1553
        func_arg = reg;
1554 1554
    } else if (ts->val_type == TEMP_VAL_REG) {
1555 1555
        reg = ts->reg;

Also available in: Unified diff