tcg.c (313bdea84d2912fdbb139e746bd9346b3d85ebdc) | tcg.c (5e3d0c199f4edf4ecdf8100464da441c60ce36e3) |
---|---|
1/* 2 * Tiny Code Generator for QEMU 3 * 4 * Copyright (c) 2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 137 unchanged lines hidden (view full) --- 146} 147#endif 148static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, 149 intptr_t arg2); 150static bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, 151 TCGReg base, intptr_t ofs); 152static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target, 153 const TCGHelperInfo *info); | 1/* 2 * Tiny Code Generator for QEMU 3 * 4 * Copyright (c) 2008 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 137 unchanged lines hidden (view full) --- 146} 147#endif 148static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, 149 intptr_t arg2); 150static bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, 151 TCGReg base, intptr_t ofs); 152static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target, 153 const TCGHelperInfo *info); |
154static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKind kind, int slot); |
|
154static bool tcg_target_const_match(int64_t val, TCGType type, int ct); 155#ifdef TCG_TARGET_NEED_LDST_LABELS 156static int tcg_out_ldst_finalize(TCGContext *s); 157#endif 158 159TCGContext tcg_init_ctx; 160__thread TCGContext *tcg_ctx; 161 --- 573 unchanged lines hidden (view full) --- 735 case dh_typecode_ptr: 736 info->nr_out = 1; 737 info->out_kind = TCG_CALL_RET_NORMAL; 738 break; 739 case dh_typecode_i64: 740 case dh_typecode_s64: 741 info->nr_out = 64 / TCG_TARGET_REG_BITS; 742 info->out_kind = TCG_CALL_RET_NORMAL; | 155static bool tcg_target_const_match(int64_t val, TCGType type, int ct); 156#ifdef TCG_TARGET_NEED_LDST_LABELS 157static int tcg_out_ldst_finalize(TCGContext *s); 158#endif 159 160TCGContext tcg_init_ctx; 161__thread TCGContext *tcg_ctx; 162 --- 573 unchanged lines hidden (view full) --- 736 case dh_typecode_ptr: 737 info->nr_out = 1; 738 info->out_kind = TCG_CALL_RET_NORMAL; 739 break; 740 case dh_typecode_i64: 741 case dh_typecode_s64: 742 info->nr_out = 64 / TCG_TARGET_REG_BITS; 743 info->out_kind = TCG_CALL_RET_NORMAL; |
743 assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs)); | 744 /* Query the last register now to trigger any assert early. */ 745 tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1); |
744 break; 745 case dh_typecode_i128: 746 info->nr_out = 128 / TCG_TARGET_REG_BITS; 747 info->out_kind = TCG_CALL_RET_NORMAL; /* TODO */ 748 switch (/* TODO */ TCG_CALL_RET_NORMAL) { 749 case TCG_CALL_RET_NORMAL: | 746 break; 747 case dh_typecode_i128: 748 info->nr_out = 128 / TCG_TARGET_REG_BITS; 749 info->out_kind = TCG_CALL_RET_NORMAL; /* TODO */ 750 switch (/* TODO */ TCG_CALL_RET_NORMAL) { 751 case TCG_CALL_RET_NORMAL: |
750 assert(info->nr_out <= ARRAY_SIZE(tcg_target_call_oarg_regs)); | 752 /* Query the last register now to trigger any assert early. */ 753 tcg_target_call_oarg_reg(info->out_kind, info->nr_out - 1); |
751 break; 752 case TCG_CALL_RET_BY_REF: 753 /* 754 * Allocate the first argument to the output. 755 * We don't need to store this anywhere, just make it 756 * unavailable for use in the input loop below. 757 */ 758 cum.arg_slot = 1; --- 3828 unchanged lines hidden (view full) --- 4587 4588 tcg_out_call(s, tcg_call_func(op), info); 4589 4590 /* Assign output registers and emit moves if needed. */ 4591 switch (info->out_kind) { 4592 case TCG_CALL_RET_NORMAL: 4593 for (i = 0; i < nb_oargs; i++) { 4594 TCGTemp *ts = arg_temp(op->args[i]); | 754 break; 755 case TCG_CALL_RET_BY_REF: 756 /* 757 * Allocate the first argument to the output. 758 * We don't need to store this anywhere, just make it 759 * unavailable for use in the input loop below. 760 */ 761 cum.arg_slot = 1; --- 3828 unchanged lines hidden (view full) --- 4590 4591 tcg_out_call(s, tcg_call_func(op), info); 4592 4593 /* Assign output registers and emit moves if needed. */ 4594 switch (info->out_kind) { 4595 case TCG_CALL_RET_NORMAL: 4596 for (i = 0; i < nb_oargs; i++) { 4597 TCGTemp *ts = arg_temp(op->args[i]); |
4595 TCGReg reg = tcg_target_call_oarg_regs[i]; | 4598 TCGReg reg = tcg_target_call_oarg_reg(TCG_CALL_RET_NORMAL, i); |
4596 4597 /* ENV should not be modified. */ 4598 tcg_debug_assert(!temp_readonly(ts)); 4599 4600 set_temp_val_reg(s, ts, reg); 4601 ts->mem_coherent = 0; 4602 } 4603 break; --- 723 unchanged lines hidden --- | 4599 4600 /* ENV should not be modified. */ 4601 tcg_debug_assert(!temp_readonly(ts)); 4602 4603 set_temp_val_reg(s, ts, reg); 4604 ts->mem_coherent = 0; 4605 } 4606 break; --- 723 unchanged lines hidden --- |