📄 tc-ia64.c
字号:
as_bad ("qualifying predicate not followed by instruction");}voidia64_do_align (nbytes) int nbytes;{ char *saved_input_line_pointer = input_line_pointer; input_line_pointer = ""; s_align_bytes (nbytes); input_line_pointer = saved_input_line_pointer;}voidia64_cons_align (nbytes) int nbytes;{ if (md.auto_align) { char *saved_input_line_pointer = input_line_pointer; input_line_pointer = ""; s_align_bytes (nbytes); input_line_pointer = saved_input_line_pointer; }}/* Output COUNT bytes to a memory location. */static unsigned char *vbyte_mem_ptr = NULL;voidoutput_vbyte_mem (count, ptr, comment) int count; char *ptr; char *comment ATTRIBUTE_UNUSED;{ int x; if (vbyte_mem_ptr == NULL) abort (); if (count == 0) return; for (x = 0; x < count; x++) *(vbyte_mem_ptr++) = ptr[x];}/* Count the number of bytes required for records. */static int vbyte_count = 0;voidcount_output (count, ptr, comment) int count; char *ptr ATTRIBUTE_UNUSED; char *comment ATTRIBUTE_UNUSED;{ vbyte_count += count;}static voidoutput_R1_format (f, rtype, rlen) vbyte_func f; unw_record_type rtype; int rlen;{ int r = 0; char byte; if (rlen > 0x1f) { output_R3_format (f, rtype, rlen); return; } if (rtype == body) r = 1; else if (rtype != prologue) as_bad ("record type is not valid"); byte = UNW_R1 | (r << 5) | (rlen & 0x1f); (*f) (1, &byte, NULL);}static voidoutput_R2_format (f, mask, grsave, rlen) vbyte_func f; int mask, grsave; unsigned long rlen;{ char bytes[20]; int count = 2; mask = (mask & 0x0f); grsave = (grsave & 0x7f); bytes[0] = (UNW_R2 | (mask >> 1)); bytes[1] = (((mask & 0x01) << 7) | grsave); count += output_leb128 (bytes + 2, rlen, 0); (*f) (count, bytes, NULL);}static voidoutput_R3_format (f, rtype, rlen) vbyte_func f; unw_record_type rtype; unsigned long rlen;{ int r = 0, count; char bytes[20]; if (rlen <= 0x1f) { output_R1_format (f, rtype, rlen); return; } if (rtype == body) r = 1; else if (rtype != prologue) as_bad ("record type is not valid"); bytes[0] = (UNW_R3 | r); count = output_leb128 (bytes + 1, rlen, 0); (*f) (count + 1, bytes, NULL);}static voidoutput_P1_format (f, brmask) vbyte_func f; int brmask;{ char byte; byte = UNW_P1 | (brmask & 0x1f); (*f) (1, &byte, NULL);}static voidoutput_P2_format (f, brmask, gr) vbyte_func f; int brmask; int gr;{ char bytes[2]; brmask = (brmask & 0x1f); bytes[0] = UNW_P2 | (brmask >> 1); bytes[1] = (((brmask & 1) << 7) | gr); (*f) (2, bytes, NULL);}static voidoutput_P3_format (f, rtype, reg) vbyte_func f; unw_record_type rtype; int reg;{ char bytes[2]; int r = 0; reg = (reg & 0x7f); switch (rtype) { case psp_gr: r = 0; break; case rp_gr: r = 1; break; case pfs_gr: r = 2; break; case preds_gr: r = 3; break; case unat_gr: r = 4; break; case lc_gr: r = 5; break; case rp_br: r = 6; break; case rnat_gr: r = 7; break; case bsp_gr: r = 8; break; case bspstore_gr: r = 9; break; case fpsr_gr: r = 10; break; case priunat_gr: r = 11; break; default: as_bad ("Invalid record type for P3 format."); } bytes[0] = (UNW_P3 | (r >> 1)); bytes[1] = (((r & 1) << 7) | reg); (*f) (2, bytes, NULL);}static voidoutput_P4_format (f, imask, imask_size) vbyte_func f; unsigned char *imask; unsigned long imask_size;{ imask[0] = UNW_P4; (*f) (imask_size, imask, NULL);}static voidoutput_P5_format (f, grmask, frmask) vbyte_func f; int grmask; unsigned long frmask;{ char bytes[4]; grmask = (grmask & 0x0f); bytes[0] = UNW_P5; bytes[1] = ((grmask << 4) | ((frmask & 0x000f0000) >> 16)); bytes[2] = ((frmask & 0x0000ff00) >> 8); bytes[3] = (frmask & 0x000000ff); (*f) (4, bytes, NULL);}static voidoutput_P6_format (f, rtype, rmask) vbyte_func f; unw_record_type rtype; int rmask;{ char byte; int r = 0; if (rtype == gr_mem) r = 1; else if (rtype != fr_mem) as_bad ("Invalid record type for format P6"); byte = (UNW_P6 | (r << 4) | (rmask & 0x0f)); (*f) (1, &byte, NULL);}static voidoutput_P7_format (f, rtype, w1, w2) vbyte_func f; unw_record_type rtype; unsigned long w1; unsigned long w2;{ char bytes[20]; int count = 1; int r = 0; count += output_leb128 (bytes + 1, w1, 0); switch (rtype) { case mem_stack_f: r = 0; count += output_leb128 (bytes + count, w2 >> 4, 0); break; case mem_stack_v: r = 1; break; case spill_base: r = 2; break; case psp_sprel: r = 3; break; case rp_when: r = 4; break; case rp_psprel: r = 5; break; case pfs_when: r = 6; break; case pfs_psprel: r = 7; break; case preds_when: r = 8; break; case preds_psprel: r = 9; break; case lc_when: r = 10; break; case lc_psprel: r = 11; break; case unat_when: r = 12; break; case unat_psprel: r = 13; break; case fpsr_when: r = 14; break; case fpsr_psprel: r = 15; break; default: break; } bytes[0] = (UNW_P7 | r); (*f) (count, bytes, NULL);}static voidoutput_P8_format (f, rtype, t) vbyte_func f; unw_record_type rtype; unsigned long t;{ char bytes[20]; int r = 0; int count = 2; bytes[0] = UNW_P8; switch (rtype) { case rp_sprel: r = 1; break; case pfs_sprel: r = 2; break; case preds_sprel: r = 3; break; case lc_sprel: r = 4; break; case unat_sprel: r = 5; break; case fpsr_sprel: r = 6; break; case bsp_when: r = 7; break; case bsp_psprel: r = 8; break; case bsp_sprel: r = 9; break; case bspstore_when: r = 10; break; case bspstore_psprel: r = 11; break; case bspstore_sprel: r = 12; break; case rnat_when: r = 13; break; case rnat_psprel: r = 14; break; case rnat_sprel: r = 15; break; case priunat_when_gr: r = 16; break; case priunat_psprel: r = 17; break; case priunat_sprel: r = 18; break; case priunat_when_mem: r = 19; break; default: break; } bytes[1] = r; count += output_leb128 (bytes + 2, t, 0); (*f) (count, bytes, NULL);}static voidoutput_P9_format (f, grmask, gr) vbyte_func f; int grmask; int gr;{ char bytes[3]; bytes[0] = UNW_P9; bytes[1] = (grmask & 0x0f); bytes[2] = (gr & 0x7f); (*f) (3, bytes, NULL);}static voidoutput_P10_format (f, abi, context) vbyte_func f; int abi; int context;{ char bytes[3]; bytes[0] = UNW_P10; bytes[1] = (abi & 0xff); bytes[2] = (context & 0xff); (*f) (3, bytes, NULL);}static voidoutput_B1_format (f, rtype, label) vbyte_func f; unw_record_type rtype; unsigned long label;{ char byte; int r = 0; if (label > 0x1f) { output_B4_format (f, rtype, label); return; } if (rtype == copy_state) r = 1; else if (rtype != label_state) as_bad ("Invalid record type for format B1"); byte = (UNW_B1 | (r << 5) | (label & 0x1f)); (*f) (1, &byte, NULL);}static voidoutput_B2_format (f, ecount, t) vbyte_func f; unsigned long ecount; unsigned long t;{ char bytes[20]; int count = 1; if (ecount > 0x1f) { output_B3_format (f, ecount, t); return; } bytes[0] = (UNW_B2 | (ecount & 0x1f)); count += output_leb128 (bytes + 1, t, 0); (*f) (count, bytes, NULL);}static voidoutput_B3_format (f, ecount, t) vbyte_func f; unsigned long ecount; unsigned long t;{ char bytes[20]; int count = 1; if (ecount <= 0x1f) { output_B2_format (f, ecount, t); return; } bytes[0] = UNW_B3; count += output_leb128 (bytes + 1, t, 0); count += output_leb128 (bytes + count, ecount, 0); (*f) (count, bytes, NULL);}static voidoutput_B4_format (f, rtype, label) vbyte_func f; unw_record_type rtype; unsigned long label;{ char bytes[20]; int r = 0; int count = 1; if (label <= 0x1f) { output_B1_format (f, rtype, label); return; } if (rtype == copy_state) r = 1; else if (rtype != label_state) as_bad ("Invalid record type for format B1"); bytes[0] = (UNW_B4 | (r << 3)); count += output_leb128 (bytes + 1, label, 0); (*f) (count, bytes, NULL);}static charformat_ab_reg (ab, reg) int ab; int reg;{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -