Lines Matching defs:reg

271 void tcg_set_frame(TCGContext *s, int reg,
276 s->frame_reg = reg;
300 static inline int tcg_global_reg_new_internal(TCGType type, int reg,
311 if (tcg_regset_test_reg(s->reserved_regs, reg))
319 ts->reg = reg;
322 tcg_regset_set_reg(s->reserved_regs, reg);
326 TCGv_i32 tcg_global_reg_new_i32(int reg, const char *name)
330 idx = tcg_global_reg_new_internal(TCG_TYPE_I32, reg, name);
334 TCGv_i64 tcg_global_reg_new_i64(int reg, const char *name)
338 idx = tcg_global_reg_new_internal(TCG_TYPE_I64, reg, name);
342 static inline int tcg_global_mem_new_internal(TCGType type, int reg,
360 ts->mem_reg = reg;
375 ts->mem_reg = reg;
395 ts->mem_reg = reg;
403 TCGv_i32 tcg_global_mem_new_i32(int reg, tcg_target_long offset,
408 idx = tcg_global_mem_new_internal(TCG_TYPE_I32, reg, offset, name);
412 TCGv_i64 tcg_global_mem_new_i64(int reg, tcg_target_long offset,
417 idx = tcg_global_mem_new_internal(TCG_TYPE_I64, reg, offset, name);
1369 printf("%s", tcg_target_reg_names[ts->reg]);
1398 int reg, k;
1402 for(reg = 0; reg < TCG_TARGET_NB_REGS; reg++) {
1403 k = s->reg_to_temp[reg];
1407 ts->reg != reg) {
1409 tcg_target_reg_names[reg]);
1418 s->reg_to_temp[ts->reg] != k) {
1422 printf("reg state:\n");
1447 /* free register 'reg' by spilling the corresponding temporary if necessary */
1448 static void tcg_reg_free(TCGContext *s, int reg)
1453 temp = s->reg_to_temp[reg];
1460 tcg_out_st(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1463 s->reg_to_temp[reg] = -1;
1470 int i, reg;
1477 reg = tcg_target_reg_alloc_order[i];
1478 if (tcg_regset_test_reg(reg_ct, reg) && s->reg_to_temp[reg] == -1)
1479 return reg;
1484 reg = tcg_target_reg_alloc_order[i];
1485 if (tcg_regset_test_reg(reg_ct, reg)) {
1486 tcg_reg_free(s, reg);
1487 return reg;
1499 int reg;
1505 tcg_reg_free(s, ts->reg);
1511 reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
1515 tcg_out_movi(s, ts->type, reg, ts->val);
1516 tcg_out_st(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1552 s->reg_to_temp[ts->reg] = -1;
1574 tcg_out_movi(s, ots->type, ots->reg, val);
1578 s->reg_to_temp[ots->reg] = -1;
1589 int reg;
1601 s->reg_to_temp[ots->reg] = -1;
1602 reg = ts->reg;
1603 s->reg_to_temp[reg] = -1;
1607 reg = ots->reg;
1609 reg = tcg_reg_alloc(s, arg_ct->u.regs, s->reserved_regs);
1611 if (ts->reg != reg) {
1612 tcg_out_mov(s, ots->type, reg, ts->reg);
1617 reg = ots->reg;
1619 reg = tcg_reg_alloc(s, arg_ct->u.regs, s->reserved_regs);
1621 tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1624 reg = ots->reg;
1625 tcg_out_movi(s, ots->type, reg, ts->val);
1629 s->reg_to_temp[ots->reg] = -1;
1637 s->reg_to_temp[reg] = args[0];
1638 ots->reg = reg;
1649 int i, k, nb_iargs, nb_oargs, reg;
1672 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1673 tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1675 ts->reg = reg;
1677 s->reg_to_temp[reg] = arg;
1686 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1687 tcg_out_movi(s, ts->type, reg, ts->val);
1689 ts->reg = reg;
1691 s->reg_to_temp[reg] = arg;
1709 reg = ts->reg;
1710 if (tcg_regset_test_reg(arg_ct->u.regs, reg)) {
1716 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1717 tcg_out_mov(s, ts->type, reg, ts->reg);
1719 new_args[i] = reg;
1721 tcg_regset_set_reg(allocated_regs, reg);
1735 s->reg_to_temp[ts->reg] = -1;
1743 for(reg = 0; reg < TCG_TARGET_NB_REGS; reg++) {
1744 if (tcg_regset_test_reg(tcg_target_call_clobber_regs, reg)) {
1745 tcg_reg_free(s, reg);
1764 reg = new_args[arg_ct->alias_index];
1767 reg = ts->reg;
1769 tcg_regset_test_reg(arg_ct->u.regs, reg)) {
1772 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1774 tcg_regset_set_reg(allocated_regs, reg);
1778 s->reg_to_temp[ts->reg] = -1;
1780 ts->reg = reg;
1784 s->reg_to_temp[reg] = arg;
1787 new_args[i] = reg;
1797 reg = new_args[i];
1798 if (ts->fixed_reg && ts->reg != reg) {
1799 tcg_out_mov(s, ts->type, ts->reg, reg);
1814 int nb_iargs, nb_oargs, flags, nb_regs, i, reg, nb_params;
1853 tcg_out_st(s, ts->type, ts->reg, TCG_REG_CALL_STACK, stack_offset);
1855 reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
1858 tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1859 tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
1861 reg = tcg_reg_alloc(s, tcg_target_available_regs[ts->type],
1864 tcg_out_movi(s, ts->type, reg, ts->val);
1865 tcg_out_st(s, ts->type, reg, TCG_REG_CALL_STACK, stack_offset);
1881 reg = tcg_target_call_iarg_regs[i];
1882 tcg_reg_free(s, reg);
1884 if (ts->reg != reg) {
1885 tcg_out_mov(s, ts->type, reg, ts->reg);
1888 tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1891 tcg_out_movi(s, ts->type, reg, ts->val);
1895 tcg_regset_set_reg(allocated_regs, reg);
1906 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1907 tcg_out_ld(s, ts->type, reg, ts->mem_reg, ts->mem_offset);
1908 func_arg = reg;
1909 tcg_regset_set_reg(allocated_regs, reg);
1911 reg = ts->reg;
1912 if (!tcg_regset_test_reg(arg_ct->u.regs, reg)) {
1913 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1914 tcg_out_mov(s, ts->type, reg, ts->reg);
1916 func_arg = reg;
1917 tcg_regset_set_reg(allocated_regs, reg);
1923 reg = tcg_reg_alloc(s, arg_ct->u.regs, allocated_regs);
1924 tcg_out_movi(s, ts->type, reg, func_addr);
1925 func_arg = reg;
1926 tcg_regset_set_reg(allocated_regs, reg);
1940 s->reg_to_temp[ts->reg] = -1;
1947 for(reg = 0; reg < TCG_TARGET_NB_REGS; reg++) {
1948 if (tcg_regset_test_reg(tcg_target_call_clobber_regs, reg)) {
1949 tcg_reg_free(s, reg);
1969 reg = tcg_target_call_oarg_regs[i];
1970 assert(s->reg_to_temp[reg] == -1);
1972 if (ts->reg != reg) {
1973 tcg_out_mov(s, ts->type, ts->reg, reg);
1977 s->reg_to_temp[ts->reg] = -1;
1979 ts->reg = reg;
1981 s->reg_to_temp[reg] = arg;
2091 s->reg_to_temp[ts->reg] = -1;