Lines Matching defs:unwind

189 /* Return the frame unwind state for the current function, allocating
194 tic6x_unwind_info *unwind;
196 unwind = seg_info (now_seg)->tc_segment_info_data.unwind;
197 if (unwind)
198 return unwind;
200 unwind = seg_info (now_seg)->tc_segment_info_data.text_unwind;
201 if (unwind)
202 return unwind;
204 unwind =XNEW (tic6x_unwind_info);
205 seg_info (now_seg)->tc_segment_info_data.unwind = unwind;
206 memset (unwind, 0, sizeof (*unwind));
207 return unwind;
377 tic6x_unwind_info *unwind = tic6x_get_unwind ();
381 if (unwind->data_bytes == 0)
384 if (unwind->data_bytes != -1)
392 if (unwind->personality_routine || unwind->personality_index != -1)
395 unwind->personality_index = -2;
402 tic6x_unwind_info *unwind = tic6x_get_unwind ();
404 if (!unwind->saved_seg)
410 if (unwind->table_entry || unwind->personality_index == -2)
416 if (unwind->personality_index == -1 && unwind->personality_routine == NULL)
429 tic6x_unwind_info *unwind = tic6x_get_unwind ();
431 if (unwind->data_bytes != 0)
435 if (!unwind->table_entry)
438 subseg_set (unwind->saved_seg, unwind->saved_subseg);
441 unwind->saved_seg = NULL;
442 unwind->table_entry = NULL;
443 unwind->data_bytes = 0;
450 tic6x_unwind_info *unwind = tic6x_get_unwind ();
453 if (unwind->personality_routine || unwind->personality_index != -1)
466 unwind->personality_index = exp.X_add_number;
475 tic6x_unwind_info *unwind = tic6x_get_unwind ();
477 if (unwind->personality_routine || unwind->personality_index != -1)
481 unwind->personality_routine = symbol_find_or_make (name);
4590 /* Initialize the DWARF-2 unwind information for this procedure. */
4605 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4676 seg_info (now_seg)->tc_segment_info_data.text_unwind = unwind;
4696 /* Map from dwarf register number to unwind frame register number. */
4727 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4731 if (unwind->table_entry == NULL)
4733 tic6x_start_unwind_section (unwind->saved_seg, 0);
4736 unwind->table_entry = expr_build_dot ();
4738 unwind->frag_start = ptr;
4754 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4756 unwind->data_bytes++;
4758 if (unwind->data_bytes == 5)
4760 if (unwind->personality_index == -1)
4763 unwind->personality_index = 1;
4764 tic6x_flush_unwind_word (0x81000000 | ((unwind->data >> 8) & 0xffff));
4765 unwind->data = ((unwind->data & 0xff) << 8) | byte;
4766 unwind->data_bytes++;
4770 tic6x_flush_unwind_word (unwind->data);
4771 unwind->data = byte;
4776 unwind->data = (unwind->data << 8) | byte;
4777 if ((unwind->data_bytes & 3) == 0 && unwind->data_bytes > 4)
4779 tic6x_flush_unwind_word (unwind->data);
4780 unwind->data = 0;
4807 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4809 unwind->personality_index = -1;
4810 unwind->personality_routine = NULL;
4811 if (unwind->table_entry)
4814 unwind->table_entry = NULL;
4815 unwind->data_bytes = -1;
4826 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4832 tic6x_start_unwind_section (unwind->saved_seg, 1);
4841 fix_new (frag_now, where, 4, unwind->function_start, 0, 1,
4848 if (unwind->personality_index >= 0 && unwind->personality_index < 5
4849 && !(marked_pr_dependency & (1 << unwind->personality_index)))
4859 symbolS *pr = symbol_find_or_make (name[unwind->personality_index]);
4862 |= 1 << unwind->personality_index;
4865 if (unwind->table_entry)
4868 fix_new (frag_now, where + 4, 4, unwind->table_entry, 0, 1,
4874 md_number_to_chars (ptr + 4, unwind->data, 4);
4884 tic6x_unwind_info *unwind = tic6x_get_unwind ();
4885 unsigned safe_mask = unwind->safe_mask;
4886 unsigned compact_mask = unwind->compact_mask;
4887 unsigned reg_saved_mask = unwind->reg_saved_mask;
4888 offsetT cfa_offset = unwind->cfa_offset;
4892 if (unwind->personality_index == -2)
4895 unwind->data = 1;
4900 if (unwind->personality_index == -1 && unwind->personality_routine == NULL)
4904 unwind->personality_index = -1;
4906 unwind->personality_index = 3;
4908 unwind->personality_index = 4;
4912 unwind->table_entry = NULL;
4913 if (unwind->personality_index == 3 || unwind->personality_index == 4)
4921 || (unwind->personality_index == 3 && compact_mask != 0)
4922 || (unwind->personality_index == 4 && safe_mask != 0))
4928 unwind->data = (1u << 31) | (unwind->personality_index << 24);
4929 if (unwind->cfa_reg == 15)
4930 unwind->data |= 0x7f << 17;
4932 unwind->data |= cfa_offset << (17 - 3);
4934 if (unwind->personality_index == 3)
4935 unwind->data |= safe_mask << 4;
4937 unwind->data |= compact_mask << 4;
4938 unwind->data |= unwind->return_reg;
4939 unwind->data_bytes = 4;
4943 if (unwind->personality_routine)
4945 unwind->data = 0;
4946 unwind->data_bytes = 5;
4950 fix_new (frag_now, where, 4, unwind->personality_routine, 0, 1,
4953 else if (unwind->personality_index > 0)
4955 unwind->data = 0x8000 | (unwind->personality_index << 8);
4956 unwind->data_bytes = 2;
4960 unwind->data = 0x80;
4961 unwind->data_bytes = 1;
4964 if (unwind->return_reg != UNWIND_B3)
4966 tic6x_unwind_byte (UNWIND_OP_RET | unwind->return_reg);
4969 if (unwind->cfa_reg == 15)
4993 tic6x_unwind_2byte (UNWIND_OP2_POP | unwind->safe_mask);
4994 else if (unwind->pop_rts)
4997 tic6x_unwind_2byte (UNWIND_OP2_POP_COMPACT | unwind->compact_mask);
5004 tic6x_unwind_byte (UNWIND_OP_POP_REG | unwind->saved_reg_count);
5006 for (cur_offset = 0; unwind->saved_reg_count > 0; cur_offset -= 4)
5011 if (!unwind->reg_saved[reg])
5014 if (unwind->reg_offset[reg] == cur_offset)
5016 unwind->saved_reg_count--;
5031 while ((unwind->data_bytes & 3) != 0)
5034 if (unwind->personality_index == -1 && unwind->personality_routine == NULL)
5035 unwind->personality_index = 0;
5039 if (need_extab && !unwind->table_entry)
5041 if (unwind->data_bytes != 4)
5044 tic6x_flush_unwind_word (unwind->data);
5046 else if (unwind->table_entry && !need_extab)
5054 if (unwind->table_entry)
5057 if (unwind->data_bytes > 0x400)
5060 if (unwind->personality_index == -1)
5062 tmp = md_chars_to_number (unwind->frag_start + 4, 4);
5063 tmp |= (valueT) ((unwind->data_bytes - 8) >> 2) << 24;
5064 md_number_to_chars (unwind->frag_start + 4, tmp, 4);
5066 else if (unwind->personality_index == 1 || unwind->personality_index == 2)
5068 tmp = md_chars_to_number (unwind->frag_start, 4);
5069 tmp |= ((unwind->data_bytes - 4) >> 2) << 16;
5070 md_number_to_chars (unwind->frag_start, tmp, 4);
5081 tic6x_unwind_info *unwind = tic6x_get_unwind ();
5090 unwind->cfa_reg = 31;
5091 unwind->return_reg = UNWIND_B3;
5092 unwind->saved_reg_count = 0;
5093 unwind->pop_rts = FALSE;
5095 unwind->saved_seg = now_seg;
5096 unwind->saved_subseg = now_subseg;
5099 unwind->reg_saved[reg] = FALSE;
5110 unwind->cfa_reg = insn->u.ri.reg;
5115 unwind->cfa_reg = insn->u.r;
5126 unwind->reg_saved[reg] = FALSE;
5137 unwind->reg_saved[reg] = TRUE;
5138 unwind->reg_offset[reg] = insn->u.ri.offset;
5140 unwind->return_reg = UNWIND_B3;
5159 unwind->return_reg = reg;
5160 unwind->reg_saved[UNWIND_B3] = FALSE;
5161 if (unwind->reg_saved[reg])
5183 if (unwind->cfa_reg != 15 && unwind->cfa_reg != 31)
5186 unwind->cfa_reg);
5190 if (unwind->cfa_reg == 15)
5210 if (unwind->reg_saved[reg])
5220 if (!unwind->reg_saved[reg])
5225 && unwind->reg_saved[reg + 1]
5232 if (save_offset != unwind->reg_offset[reg + 1]
5233 || save_offset - 4 != unwind->reg_offset[reg])
5240 if (save_offset != unwind->reg_offset[reg])
5260 if (!unwind->reg_saved[reg])
5267 if (!unwind->reg_saved[reg2]
5285 if (save_offset + 4 - high_offset != unwind->reg_offset[reg]
5286 || save_offset + high_offset != unwind->reg_offset[reg2])
5294 if (save_offset != unwind->reg_offset[reg])
5320 if (unwind->reg_offset[reg] != pop_rts_offset[reg] * 4)
5326 unwind->pop_rts = TRUE;
5337 if (!unwind->reg_saved[reg])
5340 unwind->saved_reg_count++;
5345 if (unwind->reg_offset[reg] > 0 || unwind->reg_offset[reg] < -0x800
5346 || (unwind->reg_offset[reg] & 3) != 0)
5352 if (unwind->reg_offset[reg] < save_offset)
5353 save_offset = unwind->reg_offset[reg] - 4;
5360 if (unwind->cfa_reg == 31 && !reg_saved_mask)
5370 unwind->safe_mask = safe_mask;
5371 unwind->compact_mask = compact_mask;
5372 unwind->reg_saved_mask = reg_saved_mask;
5373 unwind->cfa_offset = cfa_offset;
5374 unwind->function_start = fde->start_address;