Lines Matching defs:fragp
65 static void s3_frag_check (fragS * fragp ATTRIBUTE_UNUSED);
70 static int s3_estimate_size_before_relax (fragS * fragp, asection * sec ATTRIBUTE_UNUSED);
71 static int s3_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTRIBUTE_UNUSED);
72 static void s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp);
5792 char *fragp;
5849 fragp = frag_more (7 * 4);
5850 md_number_to_chars (fragp, (valueT) s3_cur_proc_ptr->reg_mask, 4);
5851 md_number_to_chars (fragp + 4, (valueT) s3_cur_proc_ptr->reg_offset, 4);
5852 md_number_to_chars (fragp + 8, (valueT) s3_cur_proc_ptr->fpreg_mask, 4);
5853 md_number_to_chars (fragp + 12, (valueT) s3_cur_proc_ptr->leaf, 4);
5854 md_number_to_chars (fragp + 16, (valueT) s3_cur_proc_ptr->frame_offset, 4);
5855 md_number_to_chars (fragp + 20, (valueT) s3_cur_proc_ptr->frame_reg, 4);
5856 md_number_to_chars (fragp + 24, (valueT) s3_cur_proc_ptr->pc_reg, 4);
6721 s3_frag_check (fragS * fragp ATTRIBUTE_UNUSED)
6723 know (fragp->insn_addr <= s3_RELAX_PAD_BYTE);
6798 s3_judge_size_before_relax (fragS * fragp, asection *sec)
6803 change = s3_nopic_need_relax (fragp->fr_symbol, 0);
6805 change = s3_pic_need_relax (fragp->fr_symbol, sec);
6811 if (fragp->fr_opcode == NULL)
6813 fragp->fr_fix = s3_RELAX_NEW (fragp->fr_subtype);
6814 fragp->fr_opcode = fragp->fr_literal + s3_RELAX_RELOC1 (fragp->fr_subtype);
6815 return s3_RELAX_NEW (fragp->fr_subtype) - s3_RELAX_OLD (fragp->fr_subtype);
6823 s3_estimate_size_before_relax (fragS * fragp, asection * sec ATTRIBUTE_UNUSED)
6825 if ((s3_RELAX_TYPE (fragp->fr_subtype) == Insn_GP)
6826 || (s3_RELAX_TYPE (fragp->fr_subtype) == Insn_PIC))
6827 return s3_judge_size_before_relax (fragp, sec);
6833 s3_relax_branch_inst32 (fragS * fragp)
6835 fragp->fr_opcode = NULL;
6840 s3_relax_branch_inst16 (fragS * fragp)
6843 int frag_addr = fragp->fr_address + fragp->insn_addr;
6850 relaxable_p = s3_RELAX_OPT (fragp->fr_subtype);
6852 s = fragp->fr_symbol;
6861 inst_value = s3_md_chars_to_number (fragp->fr_literal, s3_INSN16_SIZE);
6870 && fragp->fr_fix == 2
6877 fragp->fr_opcode = fragp->fr_literal + s3_RELAX_RELOC1 (fragp->fr_subtype);
6878 fragp->fr_fix = 4;
6886 s3_relax_cmpbranch_inst32 (fragS * fragp)
6892 long frag_addr = fragp->fr_address + fragp->insn_addr;
6897 relaxable_p = s3_RELAX_OPT (fragp->fr_subtype);
6899 s = fragp->fr_symbol;
6908 inst_value = s3_md_chars_to_number (fragp->fr_literal, s3_INSN_SIZE);
6919 bcmp to cmp!+beq/bne ,here need to record fragp->fr_opcode
6922 if (fragp->fr_fix == 6)
6930 && fragp->fr_fix == 4
6936 fragp->fr_opcode = fragp->fr_literal + s3_RELAX_RELOC1 (fragp->fr_subtype);
6937 fragp->fr_fix = 6;
6944 fragp->fr_opcode = NULL;
6951 s3_relax_other_inst32 (fragS * fragp)
6953 int relaxable_p = s3_RELAX_OPT (fragp->fr_subtype);
6956 && fragp->fr_fix == 4)
6958 fragp->fr_opcode = fragp->fr_literal + s3_RELAX_RELOC1 (fragp->fr_subtype);
6959 fragp->fr_fix = 2;
6975 s3_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTRIBUTE_UNUSED)
6981 if ((fragp->fr_address) % 2 != 0)
6983 if ((fragp->fr_address + fragp->insn_addr) % 2 != 0)
6985 fragp->insn_addr = 1;
6991 switch (s3_RELAX_TYPE (fragp->fr_subtype))
6994 grows += s3_relax_branch_inst32 (fragp);
6998 grows += s3_relax_branch_inst16 (fragp);
7002 grows += s3_relax_cmpbranch_inst32 (fragp);
7011 grows += s3_relax_other_inst32 (fragp);
7016 if (adjust_align_p && fragp->insn_addr)
7018 fragp->fr_fix += fragp->insn_addr;
7025 s3_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp)
7032 r_old = s3_RELAX_OLD (fragp->fr_subtype);
7033 r_new = s3_RELAX_NEW (fragp->fr_subtype);
7035 /* fragp->fr_opcode indicates whether this frag should be relaxed. */
7036 if (fragp->fr_opcode == NULL)
7038 memcpy (backup, fragp->fr_literal, r_old);
7039 fragp->fr_fix = r_old;
7043 memcpy (backup, fragp->fr_literal + r_old, r_new);
7044 fragp->fr_fix = r_new;
7047 fixp = fragp->tc_frag_data.fixp;
7048 while (fixp && fixp->fx_frag == fragp && fixp->fx_where < r_old)
7050 if (fragp->fr_opcode)
7054 while (fixp && fixp->fx_frag == fragp)
7056 if (fragp->fr_opcode)
7057 fixp->fx_where -= r_old + fragp->insn_addr;
7063 if (fragp->insn_addr)
7065 s3_md_number_to_chars (fragp->fr_literal, 0x0, fragp->insn_addr);
7067 memcpy (fragp->fr_literal + fragp->insn_addr, backup, fragp->fr_fix);
7068 fragp->fr_fix += fragp->insn_addr;
7556 score_frag_check (fragS * fragp ATTRIBUTE_UNUSED)
7559 s3_frag_check (fragp);
7561 s7_frag_check (fragp);
7609 md_estimate_size_before_relax (fragS * fragp, asection * sec ATTRIBUTE_UNUSED)
7612 return s3_estimate_size_before_relax (fragp, sec);
7614 return s7_estimate_size_before_relax (fragp, sec);
7618 score_relax_frag (asection * sec ATTRIBUTE_UNUSED, fragS * fragp, long stretch ATTRIBUTE_UNUSED)
7621 return s3_relax_frag (sec, fragp, stretch);
7623 return s7_relax_frag (sec, fragp, stretch);
7627 md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED, fragS * fragp)
7630 return s3_convert_frag (abfd, sec, fragp);
7632 return s7_convert_frag (abfd, sec, fragp);