/* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
IND_DTR,
IND_ITR,
IND_IBR,
- IND_MEM,
IND_MSR,
IND_PKR,
IND_PMC,
struct hash_control *const_hash; /* constant hash table */
struct hash_control *entry_hash; /* code entry hint hash table */
- symbolS *regsym[REG_NUM];
-
/* If X_op is != O_absent, the registername for the instruction's
qualifying predicate. If NULL, p0 is assumed for instructions
- that are predicatable. */
+ that are predictable. */
expressionS qp;
/* Optimize for which CPU. */
int pointer_size; /* size in bytes of a pointer */
int pointer_size_shift; /* shift size of a pointer for alignment */
+
+ symbolS *indregsym[IND_RR - IND_CPUID + 1];
}
md;
#define AR_BSP 17
#define AR_BSPSTORE 18
#define AR_RNAT 19
+#define AR_FCR 21
+#define AR_EFLAG 24
+#define AR_CSD 25
+#define AR_SSD 26
+#define AR_CFLG 27
+#define AR_FSR 28
+#define AR_FIR 29
+#define AR_FDR 30
+#define AR_CCV 32
#define AR_UNAT 36
#define AR_FPSR 40
#define AR_ITC 44
+#define AR_RUC 45
#define AR_PFS 64
#define AR_LC 65
+#define AR_EC 66
static const struct
{
const char *name;
- int regnum;
+ unsigned int regnum;
}
ar[] =
{
- {"ar.k0", 0}, {"ar.k1", 1}, {"ar.k2", 2}, {"ar.k3", 3},
- {"ar.k4", 4}, {"ar.k5", 5}, {"ar.k6", 6}, {"ar.k7", 7},
- {"ar.rsc", 16}, {"ar.bsp", 17},
- {"ar.bspstore", 18}, {"ar.rnat", 19},
- {"ar.fcr", 21}, {"ar.eflag", 24},
- {"ar.csd", 25}, {"ar.ssd", 26},
- {"ar.cflg", 27}, {"ar.fsr", 28},
- {"ar.fir", 29}, {"ar.fdr", 30},
- {"ar.ccv", 32}, {"ar.unat", 36},
- {"ar.fpsr", 40}, {"ar.itc", 44},
- {"ar.pfs", 64}, {"ar.lc", 65},
- {"ar.ec", 66},
+ {"ar.k0", AR_K0}, {"ar.k1", AR_K0 + 1},
+ {"ar.k2", AR_K0 + 2}, {"ar.k3", AR_K0 + 3},
+ {"ar.k4", AR_K0 + 4}, {"ar.k5", AR_K0 + 5},
+ {"ar.k6", AR_K0 + 6}, {"ar.k7", AR_K7},
+ {"ar.rsc", AR_RSC}, {"ar.bsp", AR_BSP},
+ {"ar.bspstore", AR_BSPSTORE}, {"ar.rnat", AR_RNAT},
+ {"ar.fcr", AR_FCR}, {"ar.eflag", AR_EFLAG},
+ {"ar.csd", AR_CSD}, {"ar.ssd", AR_SSD},
+ {"ar.cflg", AR_CFLG}, {"ar.fsr", AR_FSR},
+ {"ar.fir", AR_FIR}, {"ar.fdr", AR_FDR},
+ {"ar.ccv", AR_CCV}, {"ar.unat", AR_UNAT},
+ {"ar.fpsr", AR_FPSR}, {"ar.itc", AR_ITC},
+ {"ar.ruc", AR_RUC}, {"ar.pfs", AR_PFS},
+ {"ar.lc", AR_LC}, {"ar.ec", AR_EC},
};
+/* control registers: */
+
+#define CR_DCR 0
+#define CR_ITM 1
+#define CR_IVA 2
+#define CR_PTA 8
+#define CR_GPTA 9
#define CR_IPSR 16
#define CR_ISR 17
#define CR_IIP 19
#define CR_IFS 23
#define CR_IIM 24
#define CR_IHA 25
+#define CR_LID 64
#define CR_IVR 65
#define CR_TPR 66
#define CR_EOI 67
#define CR_IRR0 68
#define CR_IRR3 71
+#define CR_ITV 72
+#define CR_PMV 73
+#define CR_CMCV 74
#define CR_LRR0 80
#define CR_LRR1 81
-/* control registers: */
static const struct
{
const char *name;
- int regnum;
+ unsigned int regnum;
}
cr[] =
{
- {"cr.dcr", 0},
- {"cr.itm", 1},
- {"cr.iva", 2},
- {"cr.pta", 8},
- {"cr.gpta", 9},
- {"cr.ipsr", 16},
- {"cr.isr", 17},
- {"cr.iip", 19},
- {"cr.ifa", 20},
- {"cr.itir", 21},
- {"cr.iipa", 22},
- {"cr.ifs", 23},
- {"cr.iim", 24},
- {"cr.iha", 25},
- {"cr.lid", 64},
- {"cr.ivr", 65},
- {"cr.tpr", 66},
- {"cr.eoi", 67},
- {"cr.irr0", 68},
- {"cr.irr1", 69},
- {"cr.irr2", 70},
- {"cr.irr3", 71},
- {"cr.itv", 72},
- {"cr.pmv", 73},
- {"cr.cmcv", 74},
- {"cr.lrr0", 80},
- {"cr.lrr1", 81}
+ {"cr.dcr", CR_DCR},
+ {"cr.itm", CR_ITM},
+ {"cr.iva", CR_IVA},
+ {"cr.pta", CR_PTA},
+ {"cr.gpta", CR_GPTA},
+ {"cr.ipsr", CR_IPSR},
+ {"cr.isr", CR_ISR},
+ {"cr.iip", CR_IIP},
+ {"cr.ifa", CR_IFA},
+ {"cr.itir", CR_ITIR},
+ {"cr.iipa", CR_IIPA},
+ {"cr.ifs", CR_IFS},
+ {"cr.iim", CR_IIM},
+ {"cr.iha", CR_IHA},
+ {"cr.lid", CR_LID},
+ {"cr.ivr", CR_IVR},
+ {"cr.tpr", CR_TPR},
+ {"cr.eoi", CR_EOI},
+ {"cr.irr0", CR_IRR0},
+ {"cr.irr1", CR_IRR0 + 1},
+ {"cr.irr2", CR_IRR0 + 2},
+ {"cr.irr3", CR_IRR3},
+ {"cr.itv", CR_ITV},
+ {"cr.pmv", CR_PMV},
+ {"cr.cmcv", CR_CMCV},
+ {"cr.lrr0", CR_LRR0},
+ {"cr.lrr1", CR_LRR1}
};
#define PSR_MFL 4
static const struct
{
const char *name;
- int regnum;
+ unsigned int regnum;
}
indirect_reg[] =
{
unw_rec_list *list;
unw_rec_list *tail;
- /* Any unwind entires that should be attached to the current slot
+ /* Any unwind entries that should be attached to the current slot
that an insn is being constructed for. */
unw_rec_list *current_entry;
static void dot_entry PARAMS ((int));
static void dot_mem_offset PARAMS ((int));
static void add_unwind_entry PARAMS((unw_rec_list *, int));
-static symbolS *declare_register PARAMS ((const char *name, int regnum));
-static void declare_register_set PARAMS ((const char *, int, int));
+static symbolS *declare_register PARAMS ((const char *name, unsigned int regnum));
+static void declare_register_set PARAMS ((const char *, unsigned int, unsigned int));
static unsigned int operand_width PARAMS ((enum ia64_opnd));
static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode *idesc,
int index,
sof = ins + locs + outs;
if (sof > 96)
{
- as_bad ("Size of frame exceeds maximum of 96 registers");
+ as_bad (_("Size of frame exceeds maximum of 96 registers"));
return 0;
}
if (rots > sof)
{
- as_warn ("Size of rotating registers exceeds frame size");
+ as_warn (_("Size of rotating registers exceeds frame size"));
return 0;
}
md.in.base = REG_GR + 32;
dwarf2_where (&CURR_SLOT.debug_line);
CURR_SLOT.debug_line.flags |= DWARF2_FLAG_BASIC_BLOCK;
dwarf2_gen_line_info (frag_now_fix (), &CURR_SLOT.debug_line);
+ dwarf2_consume_line_info ();
}
CURR_SLOT.label_fixups = 0;
subseg_set (saved_seg, saved_subseg);
if (md.qp.X_op == O_register)
- as_bad ("qualifying predicate not followed by instruction");
+ as_bad (_("qualifying predicate not followed by instruction"));
}
static void
if (rtype == body)
r = 1;
else if (rtype != prologue)
- as_bad ("record type is not valid");
+ as_bad (_("record type is not valid"));
byte = UNW_R1 | (r << 5) | (rlen & 0x1f);
(*f) (1, &byte, NULL);
if (rtype == body)
r = 1;
else if (rtype != prologue)
- as_bad ("record type is not valid");
+ as_bad (_("record type is not valid"));
bytes[0] = (UNW_R3 | r);
count = output_leb128 (bytes + 1, rlen, 0);
(*f) (count + 1, bytes, NULL);
r = 11;
break;
default:
- as_bad ("Invalid record type for P3 format.");
+ as_bad (_("Invalid record type for P3 format."));
}
bytes[0] = (UNW_P3 | (r >> 1));
bytes[1] = (((r & 1) << 7) | reg);
if (rtype == gr_mem)
r = 1;
else if (rtype != fr_mem)
- as_bad ("Invalid record type for format P6");
+ as_bad (_("Invalid record type for format P6"));
byte = (UNW_P6 | (r << 4) | (rmask & 0x0f));
(*f) (1, &byte, NULL);
}
if (rtype == copy_state)
r = 1;
else if (rtype != label_state)
- as_bad ("Invalid record type for format B1");
+ as_bad (_("Invalid record type for format B1"));
byte = (UNW_B1 | (r << 5) | (label & 0x1f));
(*f) (1, &byte, NULL);
if (rtype == copy_state)
r = 1;
else if (rtype != label_state)
- as_bad ("Invalid record type for format B1");
+ as_bad (_("Invalid record type for format B1"));
bytes[0] = (UNW_B4 | (r << 3));
count += output_leb128 (bytes + 1, label, 0);
if (rtype == spill_sprel)
r = 1;
else if (rtype != spill_psprel)
- as_bad ("Invalid record type for format X1");
+ as_bad (_("Invalid record type for format X1"));
bytes[1] = ((r << 7) | format_ab_reg (ab, reg));
count += output_leb128 (bytes + 2, t, 0);
count += output_leb128 (bytes + count, w1, 0);
if (rtype == spill_sprel_p)
r = 1;
else if (rtype != spill_psprel_p)
- as_bad ("Invalid record type for format X3");
+ as_bad (_("Invalid record type for format X3"));
bytes[1] = ((r << 7) | (qp & 0x3f));
bytes[2] = format_ab_reg (ab, reg);
count += output_leb128 (bytes + 3, t, 0);
{
unw_rec_list *cur, *prev;
- as_warn ("Previous .save incomplete");
+ as_warn (_("Previous .save incomplete"));
for (cur = unwind.list, prev = NULL; cur; )
if (&cur->r.record.p == unwind.pending_saves)
{
}
break;
case spill_mask:
- as_bad ("spill_mask record unimplemented.");
+ as_bad (_("spill_mask record unimplemented."));
break;
case priunat_when_gr:
case priunat_when_mem:
ptr->r.record.x.t);
break;
default:
- as_bad ("record_type_not_valid");
+ as_bad (_("record_type_not_valid"));
break;
}
}
{
if (i >= imask_size)
{
- as_bad ("Ignoring attempt to spill beyond end of region");
+ as_bad (_("Ignoring attempt to spill beyond end of region"));
return;
}
break;
case rs_space:
- as_fatal ("only constant space allocation is supported");
+ as_fatal (_("Only constant space allocation is supported"));
break;
case rs_align:
case rs_org:
if (first_frag->fr_symbol)
{
- as_fatal ("only constant offsets are supported");
+ as_fatal (_("Only constant offsets are supported"));
break;
}
case rs_fill:
first_addr = (unsigned long) &first_frag->fr_literal;
/* This can happen if there is section switching in the middle of a
- function, causing the frag chain for the function to be broken. */
+ function, causing the frag chain for the function to be broken.
+ It is too difficult to recover safely from this problem, so we just
+ exit with an error. */
if (first_frag == NULL)
- {
- /* We get six warnings for one problem, because of the loop in
- fixup_unw_records, and because fixup_unw_records is called 3
- times: once before creating the variant frag, once to estimate
- its size, and once to relax it. This is unreasonable, so we use
- a static var to make sure we only emit the warning once. */
- static int warned = 0;
-
- if (!warned)
- {
- as_warn ("Corrupted unwind info due to unsupported section switching");
- warned = 1;
- }
-
- return index;
- }
+ as_fatal (_("Section switching in code is not supported."));
}
/* Add in the used part of the last frag. */
for (ptr = list; ptr; ptr = ptr->next)
{
if (ptr->slot_number == SLOT_NUM_NOT_SET)
- as_bad (" Insn slot not set in unwind record.");
+ as_bad (_(" Insn slot not set in unwind record."));
t = slot_index (ptr->slot_number, ptr->slot_frag,
first_addr, first_frag, before_relax);
switch (ptr->r.type)
case frgr_mem:
if (!region)
{
- as_bad ("frgr_mem record before region record!");
+ as_bad (_("frgr_mem record before region record!"));
return;
}
region->r.record.r.mask.fr_mem |= ptr->r.record.p.frmask;
case fr_mem:
if (!region)
{
- as_bad ("fr_mem record before region record!");
+ as_bad (_("fr_mem record before region record!"));
return;
}
region->r.record.r.mask.fr_mem |= ptr->r.record.p.frmask;
case gr_mem:
if (!region)
{
- as_bad ("gr_mem record before region record!");
+ as_bad (_("gr_mem record before region record!"));
return;
}
region->r.record.r.mask.gr_mem |= ptr->r.record.p.grmask;
case br_mem:
if (!region)
{
- as_bad ("br_mem record before region record!");
+ as_bad (_("br_mem record before region record!"));
return;
}
region->r.record.r.mask.br_mem |= ptr->r.record.p.brmask;
case gr_gr:
if (!region)
{
- as_bad ("gr_gr record before region record!");
+ as_bad (_("gr_gr record before region record!"));
return;
}
set_imask (region, ptr->r.record.p.grmask, t, 2);
case br_gr:
if (!region)
{
- as_bad ("br_gr record before region record!");
+ as_bad (_("br_gr record before region record!"));
return;
}
set_imask (region, ptr->r.record.p.brmask, t, 3);
if (pad != 0)
md_number_to_chars (frag->fr_literal + len + 8 - md.pointer_size + pad, 0,
md.pointer_size - pad);
+ /* Fill the unwind personality with zeros. */
+ if (frag->fr_offset)
+ md_number_to_chars (frag->fr_literal + size - md.pointer_size, 0,
+ md.pointer_size);
frag->fr_fix += size;
frag->fr_type = rs_fill;
*qp = e->X_add_number - REG_P;
if (e->X_op != O_register || *qp > 63)
{
- as_bad ("First operand to .%s must be a predicate", po);
+ as_bad (_("First operand to .%s must be a predicate"), po);
*qp = 0;
}
else if (*qp == 0)
- as_warn ("Pointless use of p0 as first operand to .%s", po);
+ as_warn (_("Pointless use of p0 as first operand to .%s"), po);
if (sep == ',')
sep = parse_operand (e, ',');
else
case REG_AR + AR_LC: *regp = 10; break;
default:
- as_bad ("Operand %d to .%s must be a preserved register", n, po);
+ as_bad (_("Operand %d to .%s must be a preserved register"), n, po);
break;
}
}
*regp = reg - REG_BR;
}
else
- as_bad ("Operand %d to .%s must be a writable register", n, po);
+ as_bad (_("Operand %d to .%s must be a writable register"), n, po);
}
static void
ch = get_symbol_end ();
ia64_canonicalize_symbol_name (radix);
if (strcasecmp (radix, "C"))
- as_bad ("Radix `%s' unsupported or invalid", radix);
+ as_bad (_("Radix `%s' unsupported or invalid"), radix);
*input_line_pointer = ch;
demand_empty_rest_of_line ();
}
{
if (md.unwind_check == unwind_check_warning)
{
- as_warn (".%s outside of %s", directive, region);
+ as_warn (_(".%s outside of %s"), directive, region);
return -1;
}
else
{
- as_bad (".%s outside of %s", directive, region);
+ as_bad (_(".%s outside of %s"), directive, region);
ignore_rest_of_line ();
return 0;
}
if (!warned)
{
warned = 1;
- as_warn ("Tags on unwind pseudo-ops aren't supported, yet");
+ as_warn (_("Tags on unwind pseudo-ops aren't supported, yet"));
}
}
*input_line_pointer = ch;
if (e.X_op != O_constant)
{
- as_bad ("First operand to .fframe must be a constant");
+ as_bad (_("First operand to .fframe must be a constant"));
e.X_add_number = 0;
}
add_unwind_entry (output_mem_stack_f (e.X_add_number), sep);
reg = e.X_add_number - REG_GR;
if (e.X_op != O_register || reg > 127)
{
- as_bad ("First operand to .vframe must be a general register");
+ as_bad (_("First operand to .vframe must be a general register"));
reg = 0;
}
add_unwind_entry (output_mem_stack_v (), sep);
add_unwind_entry (output_psp_gr (reg), NOT_A_CHAR);
else if (reg != unwind.prologue_gr
+ (unsigned) popcount (unwind.prologue_mask & (-2 << 1)))
- as_warn ("Operand of .vframe contradicts .prologue");
+ as_warn (_("Operand of .vframe contradicts .prologue"));
}
static void
int sep;
if (psp)
- as_warn (".vframepsp is meaningless, assuming .vframesp was meant");
+ as_warn (_(".vframepsp is meaningless, assuming .vframesp was meant"));
if (!in_prologue ("vframesp"))
return;
sep = parse_operand (&e, ',');
if (e.X_op != O_constant)
{
- as_bad ("Operand to .vframesp must be a constant (sp-relative offset)");
+ as_bad (_("Operand to .vframesp must be a constant (sp-relative offset)"));
e.X_add_number = 0;
}
add_unwind_entry (output_mem_stack_v (), sep);
/* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */
if (e1.X_op != O_register)
{
- as_bad ("First operand to .save not a register");
+ as_bad (_("First operand to .save not a register"));
reg1 = REG_PR; /* Anything valid is good here. */
}
reg2 = e2.X_add_number - REG_GR;
if (e2.X_op != O_register || reg2 > 127)
{
- as_bad ("Second operand to .save not a valid register");
+ as_bad (_("Second operand to .save not a valid register"));
reg2 = 0;
}
switch (reg1)
add_unwind_entry (output_pfs_gr (reg2), NOT_A_CHAR);
else if (reg2 != unwind.prologue_gr
+ (unsigned) popcount (unwind.prologue_mask & (-4 << 1)))
- as_warn ("Second operand of .save contradicts .prologue");
+ as_warn (_("Second operand of .save contradicts .prologue"));
break;
case REG_AR + AR_LC:
add_unwind_entry (output_lc_when (), sep);
if (! (unwind.prologue_mask & 8))
add_unwind_entry (output_rp_gr (reg2), NOT_A_CHAR);
else if (reg2 != unwind.prologue_gr)
- as_warn ("Second operand of .save contradicts .prologue");
+ as_warn (_("Second operand of .save contradicts .prologue"));
break;
case REG_PR:
add_unwind_entry (output_preds_when (), sep);
add_unwind_entry (output_preds_gr (reg2), NOT_A_CHAR);
else if (reg2 != unwind.prologue_gr
+ (unsigned) popcount (unwind.prologue_mask & (-1 << 1)))
- as_warn ("Second operand of .save contradicts .prologue");
+ as_warn (_("Second operand of .save contradicts .prologue"));
break;
case REG_PRIUNAT:
add_unwind_entry (output_priunat_when_gr (), sep);
add_unwind_entry (output_priunat_gr (reg2), NOT_A_CHAR);
break;
default:
- as_bad ("First operand to .save not a valid register");
+ as_bad (_("First operand to .save not a valid register"));
add_unwind_entry (NULL, sep);
break;
}
sep = parse_operand (&e1, ',');
if (e1.X_op != O_register || e1.X_add_number != REG_GR + 12)
- as_bad ("First operand to .restore must be stack pointer (sp)");
+ as_bad (_("First operand to .restore must be stack pointer (sp)"));
if (sep == ',')
{
sep = parse_operand (&e2, ',');
if (e2.X_op != O_constant || e2.X_add_number < 0)
{
- as_bad ("Second operand to .restore must be a constant >= 0");
+ as_bad (_("Second operand to .restore must be a constant >= 0"));
e2.X_add_number = 0;
}
ecount = e2.X_add_number;
if (ecount >= unwind.prologue_count)
{
- as_bad ("Epilogue count of %lu exceeds number of nested prologues (%u)",
+ as_bad (_("Epilogue count of %lu exceeds number of nested prologues (%u)"),
ecount + 1, unwind.prologue_count);
ecount = 0;
}
text_name = sec_text_name;
if (strncmp (text_name, "_info", 5) == 0)
{
- as_bad ("Illegal section name `%s' (causes unwind section name clash)",
+ as_bad (_("Illegal section name `%s' (causes unwind section name clash)"),
text_name);
ignore_rest_of_line ();
return;
if (group_name == NULL)
{
- as_bad ("Group section `%s' has no group signature",
+ as_bad (_("Group section `%s' has no group signature"),
sec_text_name);
ignore_rest_of_line ();
return;
reg = e.X_add_number - REG_BR;
if (e.X_op != O_register || reg > 7)
{
- as_bad ("First operand to .altrp not a valid branch register");
+ as_bad (_("First operand to .altrp not a valid branch register"));
reg = 0;
}
add_unwind_entry (output_rp_br (reg), 0);
/* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */
if (e1.X_op != O_register)
{
- as_bad ("First operand to .%s not a register", po);
+ as_bad (_("First operand to .%s not a register"), po);
reg1 = REG_PR; /* Anything valid is good here. */
}
if (e2.X_op != O_constant)
{
- as_bad ("Second operand to .%s not a constant", po);
+ as_bad (_("Second operand to .%s not a constant"), po);
val = 0;
}
: output_priunat_sprel) (val), NOT_A_CHAR);
break;
default:
- as_bad ("First operand to .%s not a valid register", po);
+ as_bad (_("First operand to .%s not a valid register"), po);
add_unwind_entry (NULL, sep);
break;
}
|| e.X_add_number <= 0
|| e.X_add_number > 0xf)
{
- as_bad ("First operand to .save.g must be a positive 4-bit constant");
+ as_bad (_("First operand to .save.g must be a positive 4-bit constant"));
grmask = 0;
}
reg = e.X_add_number - REG_GR;
if (e.X_op != O_register || reg > 127)
{
- as_bad ("Second operand to .save.g must be a general register");
+ as_bad (_("Second operand to .save.g must be a general register"));
reg = 0;
}
else if (reg > 128U - n)
{
- as_bad ("Second operand to .save.g must be the first of %d general registers", n);
+ as_bad (_("Second operand to .save.g must be the first of %d general registers"), n);
reg = 0;
}
add_unwind_entry (output_gr_gr (grmask, reg), 0);
|| e.X_add_number <= 0
|| e.X_add_number > 0xfffff)
{
- as_bad ("Operand to .save.f must be a positive 20-bit constant");
+ as_bad (_("Operand to .save.f must be a positive 20-bit constant"));
e.X_add_number = 0;
}
add_unwind_entry (output_fr_mem (e.X_add_number), 0);
|| e.X_add_number <= 0
|| e.X_add_number > 0x1f)
{
- as_bad ("First operand to .save.b must be a positive 5-bit constant");
+ as_bad (_("First operand to .save.b must be a positive 5-bit constant"));
brmask = 0;
}
reg = e.X_add_number - REG_GR;
if (e.X_op != O_register || reg > 127)
{
- as_bad ("Second operand to .save.b must be a general register");
+ as_bad (_("Second operand to .save.b must be a general register"));
reg = 0;
}
else if (reg > 128U - n)
{
- as_bad ("Second operand to .save.b must be the first of %d general registers", n);
+ as_bad (_("Second operand to .save.b must be the first of %d general registers"), n);
reg = 0;
}
add_unwind_entry (output_br_gr (brmask, reg), 0);
|| e1.X_add_number < 0
|| e1.X_add_number > 0xf)
{
- as_bad ("First operand to .save.gf must be a non-negative 4-bit constant");
+ as_bad (_("First operand to .save.gf must be a non-negative 4-bit constant"));
e1.X_op = O_absent;
e1.X_add_number = 0;
}
|| e2.X_add_number < 0
|| e2.X_add_number > 0xfffff)
{
- as_bad ("Second operand to .save.gf must be a non-negative 20-bit constant");
+ as_bad (_("Second operand to .save.gf must be a non-negative 20-bit constant"));
e2.X_op = O_absent;
e2.X_add_number = 0;
}
&& e2.X_op == O_constant
&& e1.X_add_number == 0
&& e2.X_add_number == 0)
- as_bad ("Operands to .save.gf may not be both zero");
+ as_bad (_("Operands to .save.gf may not be both zero"));
add_unwind_entry (output_frgr_mem (e1.X_add_number, e2.X_add_number), 0);
}
if (e.X_op != O_constant)
{
- as_bad ("Operand to .spill must be a constant");
+ as_bad (_("Operand to .spill must be a constant"));
e.X_add_number = 0;
}
add_unwind_entry (output_spill_base (e.X_add_number), 0);
e.X_op = O_absent;
if (e.X_op != O_constant)
{
- as_bad ("Operand %d to .%s must be a constant", 2 + pred, po);
+ as_bad (_("Operand %d to .%s must be a constant"), 2 + pred, po);
e.X_add_number = 0;
}
if (lpc != NULL)
return lpc->prologue_count;
- as_bad ("Missing .label_state %ld", lbl);
+ as_bad (_("Missing .label_state %ld"), lbl);
return 1;
}
save_prologue_count (e.X_add_number, unwind.prologue_count);
else
{
- as_bad ("Operand to .label_state must be a constant");
+ as_bad (_("Operand to .label_state must be a constant"));
e.X_add_number = 0;
}
add_unwind_entry (output_label_state (e.X_add_number), 0);
unwind.prologue_count = get_saved_prologue_count (e.X_add_number);
else
{
- as_bad ("Operand to .copy_state must be a constant");
+ as_bad (_("Operand to .copy_state must be a constant"));
e.X_add_number = 0;
}
add_unwind_entry (output_copy_state (e.X_add_number), 0);
if (e1.X_op != O_constant)
{
- as_bad ("First operand to .unwabi must be a constant");
+ as_bad (_("First operand to .unwabi must be a constant"));
e1.X_add_number = 0;
}
if (e2.X_op != O_constant)
{
- as_bad ("Second operand to .unwabi must be a constant");
+ as_bad (_("Second operand to .unwabi must be a constant"));
e2.X_add_number = 0;
}
{
(md.unwind_check == unwind_check_warning
? as_warn
- : as_bad) ("Missing .endp after previous .proc");
+ : as_bad) (_("Missing .endp after previous .proc"));
while (unwind.proc_pending.next)
{
pending = unwind.proc_pending.next;
c = get_symbol_end ();
p = input_line_pointer;
if (!*name)
- as_bad ("Empty argument of .proc");
+ as_bad (_("Empty argument of .proc"));
else
{
sym = symbol_find_or_make (name);
if (S_IS_DEFINED (sym))
- as_bad ("`%s' was already defined", name);
+ as_bad (_("`%s' was already defined"), name);
else if (!last_pending)
{
unwind.proc_pending.sym = sym;
if (!in_procedure ("body"))
return;
if (!unwind.prologue && !unwind.body && unwind.insn)
- as_warn ("Initial .body should precede any instructions");
+ as_warn (_("Initial .body should precede any instructions"));
check_pending_save ();
unwind.prologue = 0;
return;
if (unwind.prologue)
{
- as_bad (".prologue within prologue");
+ as_bad (_(".prologue within prologue"));
ignore_rest_of_line ();
return;
}
if (!unwind.body && unwind.insn)
- as_warn ("Initial .prologue should precede any instructions");
+ as_warn (_("Initial .prologue should precede any instructions"));
if (!is_it_end_of_statement ())
{
if (e.X_op != O_constant
|| e.X_add_number < 0
|| e.X_add_number > 0xf)
- as_bad ("First operand to .prologue must be a positive 4-bit constant");
+ as_bad (_("First operand to .prologue must be a positive 4-bit constant"));
else if (e.X_add_number == 0)
- as_warn ("Pointless use of zero first operand to .prologue");
+ as_warn (_("Pointless use of zero first operand to .prologue"));
else
mask = e.X_add_number;
n = popcount (mask);
&& e.X_add_number < 128)
{
if (md.unwind_check == unwind_check_error)
- as_warn ("Using a constant as second operand to .prologue is deprecated");
+ as_warn (_("Using a constant as second operand to .prologue is deprecated"));
grsave = e.X_add_number;
}
else if (e.X_op != O_register
|| (grsave = e.X_add_number - REG_GR) > 127)
{
- as_bad ("Second operand to .prologue must be a general register");
+ as_bad (_("Second operand to .prologue must be a general register"));
grsave = 0;
}
else if (grsave > 128U - n)
{
- as_bad ("Second operand to .prologue must be the first of %d general registers", n);
+ as_bad (_("Second operand to .prologue must be the first of %d general registers"), n);
grsave = 0;
}
symbolS *sym = pending->sym;
if (!S_IS_DEFINED (sym))
- as_bad ("`%s' was not defined within procedure", S_GET_NAME (sym));
+ as_bad (_("`%s' was not defined within procedure"), S_GET_NAME (sym));
else if (S_GET_SIZE (sym) == 0
&& symbol_get_obj (sym)->size == NULL)
{
if (!*name)
(md.unwind_check == unwind_check_warning
? as_warn
- : as_bad) ("Empty argument of .endp");
+ : as_bad) (_("Empty argument of .endp"));
else
{
symbolS *sym = symbol_find (name);
}
}
if (!sym || !pending)
- as_warn ("`%s' was not specified with previous .proc", name);
+ as_warn (_("`%s' was not specified with previous .proc"), name);
}
*p = c;
SKIP_WHITESPACE ();
if (unwind.proc_pending.sym
&& S_GET_NAME (unwind.proc_pending.sym)
&& strcmp (S_GET_NAME (unwind.proc_pending.sym), FAKE_LABEL_NAME))
- as_warn ("`%s' should be an operand to this .endp",
+ as_warn (_("`%s' should be an operand to this .endp"),
S_GET_NAME (unwind.proc_pending.sym));
while (unwind.proc_pending.next)
{
return;
err:
- as_bad ("Comma expected");
+ as_bad (_("Comma expected"));
ignore_rest_of_line ();
}
dot_rot (type)
int type;
{
- unsigned num_regs, num_alloced = 0;
+ offsetT num_regs;
+ valueT num_alloced = 0;
struct dynreg **drpp, *dr;
int ch, base_reg = 0;
char *name, *start;
SKIP_WHITESPACE ();
if (*input_line_pointer != '[')
{
- as_bad ("Expected '['");
+ as_bad (_("Expected '['"));
goto err;
}
++input_line_pointer; /* skip '[' */
if (*input_line_pointer++ != ']')
{
- as_bad ("Expected ']'");
+ as_bad (_("Expected ']'"));
+ goto err;
+ }
+ if (num_regs <= 0)
+ {
+ as_bad (_("Number of elements must be positive"));
goto err;
}
SKIP_WHITESPACE ();
case DYNREG_GR:
if (num_alloced > md.rot.num_regs)
{
- as_bad ("Used more than the declared %d rotating registers",
+ as_bad (_("Used more than the declared %d rotating registers"),
md.rot.num_regs);
goto err;
}
case DYNREG_FR:
if (num_alloced > 96)
{
- as_bad ("Used more than the available 96 rotating registers");
+ as_bad (_("Used more than the available 96 rotating registers"));
goto err;
}
break;
case DYNREG_PR:
if (num_alloced > 48)
{
- as_bad ("Used more than the available 48 rotating registers");
+ as_bad (_("Used more than the available 48 rotating registers"));
goto err;
}
break;
if (hash_insert (md.dynreg_hash, name, dr))
{
- as_bad ("Attempt to redefine register set `%s'", name);
+ as_bad (_("Attempt to redefine register set `%s'"), name);
obstack_free (¬es, name);
goto err;
}
else if (strcmp (option, "abi64") == 0)
md.flags |= EF_IA_64_ABI64;
else
- as_bad ("Unknown psr option `%s'", option);
+ as_bad (_("Unknown psr option `%s'"), option);
*input_line_pointer = ch;
SKIP_WHITESPACE ();
if (input_line_pointer == start)
{
- as_bad ("Missing section name");
+ as_bad (_("Missing section name"));
ignore_rest_of_line ();
return;
}
SKIP_WHITESPACE ();
if (*input_line_pointer != ',')
{
- as_bad ("Comma expected after section name");
+ as_bad (_("Comma expected after section name"));
ignore_rest_of_line ();
return;
}
section_count = bfd_count_sections(stdoutput);
obj_elf_section (0);
if (section_count != bfd_count_sections(stdoutput))
- as_warn ("Creating sections with .xdataN/.xrealN/.xstringZ is deprecated.");
+ as_warn (_("Creating sections with .xdataN/.xrealN/.xstringZ is deprecated."));
input_line_pointer = end;
saved_auto_align = md.auto_align;
if (ua)
}
static void
-dot_xstringer (zero)
- int zero;
+dot_xstringer (int zero)
{
cross_section (zero, stringer, 0);
}
SKIP_WHITESPACE ();
}
- SKIP_WHITESPACE ();
while (1)
{
valueT bits = 1;
- int regno;
+ int sep, regno;
expressionS pr, *pr1, *pr2;
- expression_and_evaluate (&pr);
+ sep = parse_operand (&pr, ',');
if (pr.X_op == O_register
&& pr.X_add_number >= REG_P
&& pr.X_add_number <= REG_P + 63)
if (mask & bits)
as_warn (_("Duplicate predicate register ignored"));
mask |= bits;
- if (*input_line_pointer != ',')
+ if (sep != ',')
break;
- ++input_line_pointer;
- SKIP_WHITESPACE ();
}
switch (type)
{ "xreal8", dot_xfloat_cons, 'd' },
{ "xreal10", dot_xfloat_cons, 'x' },
{ "xreal16", dot_xfloat_cons, 'X' },
- { "xstring", dot_xstringer, 0 },
- { "xstringz", dot_xstringer, 1 },
+ { "xstring", dot_xstringer, 8 + 0 },
+ { "xstringz", dot_xstringer, 8 + 1 },
/* unaligned versions: */
{ "xdata2.ua", dot_xdata_ua, 2 },
{ "real8", stmt_float_cons, 'd' },
{ "real10", stmt_float_cons, 'x' },
{ "real16", stmt_float_cons, 'X' },
- { "string", stringer, 0 },
- { "stringz", stringer, 1 },
+ { "string", stringer, 8 + 0 },
+ { "stringz", stringer, 8 + 1 },
/* unaligned versions: */
{ "data2.ua", stmt_cons_ua, 2 },
static symbolS *
declare_register (name, regnum)
const char *name;
- int regnum;
+ unsigned int regnum;
{
const char *err;
symbolS *sym;
- sym = symbol_new (name, reg_section, regnum, &zero_address_frag);
+ sym = symbol_create (name, reg_section, regnum, &zero_address_frag);
err = hash_insert (md.reg_hash, S_GET_NAME (sym), (PTR) sym);
if (err)
static void
declare_register_set (prefix, num_regs, base_regnum)
const char *prefix;
- int num_regs;
- int base_regnum;
+ unsigned int num_regs;
+ unsigned int base_regnum;
{
char name[8];
- int i;
+ unsigned int i;
for (i = 0; i < num_regs; ++i)
{
- sprintf (name, "%s%u", prefix, i);
+ snprintf (name, sizeof (name), "%s%u", prefix, i);
declare_register (name, base_regnum + i);
}
}
return OPERAND_MATCH;
break;
+ case IA64_OPND_IMMU5b:
+ if (e->X_op == O_constant)
+ {
+ val = e->X_add_number;
+ if (val >= 32 && val <= 63)
+ return OPERAND_MATCH;
+ else
+ return OPERAND_OUT_OF_RANGE;
+ }
+ break;
+
case IA64_OPND_CCNT5:
case IA64_OPND_CNT5:
case IA64_OPND_CNT6:
end = strchr (input_line_pointer, '=');
if (!end)
{
- as_bad ("Expected separator `='");
+ as_bad (_("Expected separator `='"));
return 0;
}
input_line_pointer = end + 1;
if (sep == '=')
{
if (num_outputs > 0)
- as_bad ("Duplicate equal sign (=) in instruction");
+ as_bad (_("Duplicate equal sign (=) in instruction"));
else
num_outputs = i + 1;
}
}
if (sep != '\0')
{
- as_bad ("Illegal operand separator `%c'", sep);
+ as_bad (_("Illegal operand separator `%c'"), sep);
return 0;
}
if (!idesc)
{
if (expected_operand)
- as_bad ("Operand %u of `%s' should be %s",
+ as_bad (_("Operand %u of `%s' should be %s"),
error_pos + 1, mnemonic,
elf64_ia64_operands[expected_operand].desc);
else if (highest_unmatched_operand < 0 && !(highest_unmatched_operand & 1))
- as_bad ("Wrong number of output operands");
+ as_bad (_("Wrong number of output operands"));
else if (highest_unmatched_operand < 0 && !(highest_unmatched_operand & 2))
- as_bad ("Wrong number of input operands");
+ as_bad (_("Wrong number of input operands"));
else
- as_bad ("Operand mismatch");
+ as_bad (_("Operand mismatch"));
return 0;
}
case 0:
break;
default:
- as_warn ("Invalid use of `%c%d' as output operand", reg_class, regno);
+ as_warn (_("Invalid use of `%c%d' as output operand"), reg_class, regno);
break;
case 'm':
- as_warn ("Invalid use of `r%d' as base update address operand", regno);
+ as_warn (_("Invalid use of `r%d' as base update address operand"), regno);
break;
}
}
else
reg_class = 0;
if (reg_class)
- as_warn ("Invalid duplicate use of `%c%d'", reg_class, reg1);
+ as_warn (_("Invalid duplicate use of `%c%d'"), reg_class, reg1);
}
else if (((reg1 >= REG_FR && reg1 <= REG_FR + 31
&& reg2 >= REG_FR && reg2 <= REG_FR + 31)
|| (reg1 >= REG_FR + 32 && reg1 <= REG_FR + 127
&& reg2 >= REG_FR + 32 && reg2 <= REG_FR + 127))
&& ! ((reg1 ^ reg2) & 1))
- as_warn ("Invalid simultaneous use of `f%d' and `f%d'",
+ as_warn (_("Invalid simultaneous use of `f%d' and `f%d'"),
reg1 - REG_FR, reg2 - REG_FR);
else if ((reg1 >= REG_FR && reg1 <= REG_FR + 31
&& reg2 >= REG_FR + 32 && reg2 <= REG_FR + 127)
|| (reg1 >= REG_FR + 32 && reg1 <= REG_FR + 127
&& reg2 >= REG_FR && reg2 <= REG_FR + 31))
- as_warn ("Dangerous simultaneous use of `f%d' and `f%d'",
+ as_warn (_("Dangerous simultaneous use of `f%d' and `f%d'"),
reg1 - REG_FR, reg2 - REG_FR);
return idesc;
}
err = (*odesc->insert) (odesc, val, &insn);
if (err)
as_bad_where (slot->src_file, slot->src_line,
- "Bad operand value: %s", err);
+ _("Bad operand value: %s"), err);
if (idesc->flags & IA64_OPCODE_PSEUDO)
{
if ((idesc->flags & IA64_OPCODE_F2_EQ_F3)
int addr_mod;
first = (md.curr_slot + NUM_SLOTS - md.num_slots_in_use) % NUM_SLOTS;
- know (first >= 0 & first < NUM_SLOTS);
+ know (first >= 0 && first < NUM_SLOTS);
n = MIN (3, md.num_slots_in_use);
/* Determine template: user user_template if specified, best match
if (manual_bundling && !manual_bundling_off)
{
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "`%s' must be last in bundle", idesc->name);
+ _("`%s' must be last in bundle"), idesc->name);
if (i < 2)
manual_bundling = -1; /* Suppress meaningless post-loop errors. */
}
default:
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "Internal error: don't know how to force %s to end"
- "of instruction group", idesc->name);
+ _("Internal error: don't know how to force %s to end of instruction group"),
+ idesc->name);
required_slot = i;
break;
}
&& (template ^ required_template) > 1)))
{
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "`%s' must be last in instruction group",
+ _("`%s' must be last in instruction group"),
idesc->name);
if (i < 2 && required_slot == 2 && !manual_bundling_off)
manual_bundling = -1; /* Suppress meaningless post-loop errors. */
changing NOPs in front of this slot. */
for (j = i; j < 3; ++j)
insn[j] = nop[ia64_templ_desc[required_template].exec_unit[j]];
+
+ /* We just picked a template that includes the stop bit in the
+ middle, so we don't need another one emitted later. */
+ md.slot[curr].end_of_insn_group = 0;
}
template = required_template;
}
if (manual_bundling)
{
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "Label must be first in a bundle");
+ _("Label must be first in a bundle"));
manual_bundling = -1; /* Suppress meaningless post-loop errors. */
}
/* This insn must go into the first slot of a bundle. */
case hint_b_ok:
break;
case hint_b_warning:
- as_warn ("hint in B unit may be treated as nop");
+ as_warn (_("hint in B unit may be treated as nop"));
break;
case hint_b_error:
/* When manual bundling is off and there is no
if (!manual_bundling && user_template < 0)
insn_unit = IA64_UNIT_I;
else
- as_bad ("hint in B unit can't be used");
+ as_bad (_("hint in B unit can't be used"));
break;
}
}
insn_unit = IA64_UNIT_I;
}
else
- as_fatal ("emit_one_bundle: unexpected dynamic op");
+ as_fatal (_("emit_one_bundle: unexpected dynamic op"));
- sprintf (mnemonic, "%s.%c", idesc->name, "?imbfxx"[insn_unit]);
+ snprintf (mnemonic, sizeof (mnemonic), "%s.%c",
+ idesc->name, "?imbfxx"[insn_unit]);
opnd1 = idesc->operands[0];
opnd2 = idesc->operands[1];
ia64_free_opcode (idesc);
fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8,
&ifix->expr, ifix->is_pcrel, ifix->code);
fix->tc_fix_data.opnd = ifix->opnd;
- fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22);
fix->fx_file = md.slot[curr].src_file;
fix->fx_line = md.slot[curr].src_line;
}
curr = (curr + 1) % NUM_SLOTS;
idesc = md.slot[curr].idesc;
}
- if (manual_bundling > 0)
+
+ /* A user template was specified, but the first following instruction did
+ not fit. This can happen with or without manual bundling. */
+ if (md.num_slots_in_use > 0 && last_slot < 0)
+ {
+ as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
+ _("`%s' does not fit into %s template"),
+ idesc->name, ia64_templ_desc[template].name);
+ /* Drop first insn so we don't livelock. */
+ --md.num_slots_in_use;
+ know (curr == first);
+ ia64_free_opcode (md.slot[curr].idesc);
+ memset (md.slot + curr, 0, sizeof (md.slot[curr]));
+ md.slot[curr].user_template = -1;
+ }
+ else if (manual_bundling > 0)
{
if (md.num_slots_in_use > 0)
{
if (last_slot >= 2)
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "`%s' does not fit into bundle", idesc->name);
- else if (last_slot < 0)
- {
- as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "`%s' does not fit into %s template",
- idesc->name, ia64_templ_desc[template].name);
- /* Drop first insn so we don't livelock. */
- --md.num_slots_in_use;
- know (curr == first);
- ia64_free_opcode (md.slot[curr].idesc);
- memset (md.slot + curr, 0, sizeof (md.slot[curr]));
- md.slot[curr].user_template = -1;
- }
+ _("`%s' does not fit into bundle"), idesc->name);
else
{
const char *where;
else
where = "slot 3";
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "`%s' can't go in %s of %s template",
+ _("`%s' can't go in %s of %s template"),
idesc->name, where, ia64_templ_desc[template].name);
}
}
else
as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line,
- "Missing '}' at end of file");
+ _("Missing '}' at end of file"));
}
+
know (md.num_slots_in_use < NUM_SLOTS);
t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46);
void
md_begin ()
{
- int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum, ok;
+ int i, j, k, t, goodness, best, ok;
const char *err;
char name[8];
err = hash_insert (md.pseudo_hash, pseudo_opcode[i].name,
(void *) (pseudo_opcode + i));
if (err)
- as_fatal ("ia64.md_begin: can't hash `%s': %s",
+ as_fatal (_("ia64.md_begin: can't hash `%s': %s"),
pseudo_opcode[i].name, err);
}
md.entry_hash = hash_new ();
/* general registers: */
-
- total = 128;
- for (i = 0; i < total; ++i)
- {
- sprintf (name, "r%d", i - REG_GR);
- md.regsym[i] = declare_register (name, i);
- }
+ declare_register_set ("r", 128, REG_GR);
+ declare_register ("gp", REG_GR + 1);
+ declare_register ("sp", REG_GR + 12);
+ declare_register ("tp", REG_GR + 13);
+ declare_register_set ("ret", 4, REG_GR + 8);
/* floating point registers: */
- total += 128;
- for (; i < total; ++i)
- {
- sprintf (name, "f%d", i - REG_FR);
- md.regsym[i] = declare_register (name, i);
- }
-
- /* application registers: */
- total += 128;
- ar_base = i;
- for (; i < total; ++i)
- {
- sprintf (name, "ar%d", i - REG_AR);
- md.regsym[i] = declare_register (name, i);
- }
+ declare_register_set ("f", 128, REG_FR);
+ declare_register_set ("farg", 8, REG_FR + 8);
+ declare_register_set ("fret", 8, REG_FR + 8);
- /* control registers: */
- total += 128;
- cr_base = i;
- for (; i < total; ++i)
- {
- sprintf (name, "cr%d", i - REG_CR);
- md.regsym[i] = declare_register (name, i);
- }
+ /* branch registers: */
+ declare_register_set ("b", 8, REG_BR);
+ declare_register ("rp", REG_BR + 0);
/* predicate registers: */
- total += 64;
- for (; i < total; ++i)
- {
- sprintf (name, "p%d", i - REG_P);
- md.regsym[i] = declare_register (name, i);
- }
+ declare_register_set ("p", 64, REG_P);
+ declare_register ("pr", REG_PR);
+ declare_register ("pr.rot", REG_PR_ROT);
- /* branch registers: */
- total += 8;
- for (; i < total; ++i)
- {
- sprintf (name, "b%d", i - REG_BR);
- md.regsym[i] = declare_register (name, i);
- }
+ /* application registers: */
+ declare_register_set ("ar", 128, REG_AR);
+ for (i = 0; i < NELEMS (ar); ++i)
+ declare_register (ar[i].name, REG_AR + ar[i].regnum);
+
+ /* control registers: */
+ declare_register_set ("cr", 128, REG_CR);
+ for (i = 0; i < NELEMS (cr); ++i)
+ declare_register (cr[i].name, REG_CR + cr[i].regnum);
- md.regsym[REG_IP] = declare_register ("ip", REG_IP);
- md.regsym[REG_CFM] = declare_register ("cfm", REG_CFM);
- md.regsym[REG_PR] = declare_register ("pr", REG_PR);
- md.regsym[REG_PR_ROT] = declare_register ("pr.rot", REG_PR_ROT);
- md.regsym[REG_PSR] = declare_register ("psr", REG_PSR);
- md.regsym[REG_PSR_L] = declare_register ("psr.l", REG_PSR_L);
- md.regsym[REG_PSR_UM] = declare_register ("psr.um", REG_PSR_UM);
+ declare_register ("ip", REG_IP);
+ declare_register ("cfm", REG_CFM);
+ declare_register ("psr", REG_PSR);
+ declare_register ("psr.l", REG_PSR_L);
+ declare_register ("psr.um", REG_PSR_UM);
for (i = 0; i < NELEMS (indirect_reg); ++i)
{
- regnum = indirect_reg[i].regnum;
- md.regsym[regnum] = declare_register (indirect_reg[i].name, regnum);
- }
-
- /* define synonyms for application registers: */
- for (i = REG_AR; i < REG_AR + NELEMS (ar); ++i)
- md.regsym[i] = declare_register (ar[i - REG_AR].name,
- REG_AR + ar[i - REG_AR].regnum);
+ unsigned int regnum = indirect_reg[i].regnum;
- /* define synonyms for control registers: */
- for (i = REG_CR; i < REG_CR + NELEMS (cr); ++i)
- md.regsym[i] = declare_register (cr[i - REG_CR].name,
- REG_CR + cr[i - REG_CR].regnum);
-
- declare_register ("gp", REG_GR + 1);
- declare_register ("sp", REG_GR + 12);
- declare_register ("rp", REG_BR + 0);
+ md.indregsym[regnum - IND_CPUID] = declare_register (indirect_reg[i].name, regnum);
+ }
/* pseudo-registers used to specify unwind info: */
declare_register ("psp", REG_PSP);
- declare_register_set ("ret", 4, REG_GR + 8);
- declare_register_set ("farg", 8, REG_FR + 8);
- declare_register_set ("fret", 8, REG_FR + 8);
-
for (i = 0; i < NELEMS (const_bits); ++i)
{
err = hash_insert (md.const_hash, const_bits[i].name,
(PTR) (const_bits + i));
if (err)
- as_fatal ("Inserting \"%s\" into constant hash table failed: %s",
+ as_fatal (_("Inserting \"%s\" into constant hash table failed: %s"),
name, err);
}
}
if (md.qp.X_op == O_register)
- as_bad ("qualifying predicate not followed by instruction");
+ as_bad (_("qualifying predicate not followed by instruction"));
md.qp.X_op = O_absent;
if (ignore_input ())
else if (input_line_pointer[-1] == '{')
{
if (md.manual_bundling)
- as_warn ("Found '{' when manual bundling is already turned on");
+ as_warn (_("Found '{' when manual bundling is already turned on"));
else
CURR_SLOT.manual_bundling_on = 1;
md.manual_bundling = 1;
else if (input_line_pointer[-1] == '}')
{
if (!md.manual_bundling)
- as_warn ("Found '}' when manual bundling is off");
+ as_warn (_("Found '}' when manual bundling is off"));
else
PREV_SLOT.manual_bundling_off = 1;
md.manual_bundling = 0;
expression_and_evaluate (&md.qp);
if (*input_line_pointer++ != ')')
{
- as_bad ("Expected ')'");
+ as_bad (_("Expected ')'"));
return 0;
}
if (md.qp.X_op != O_register)
{
- as_bad ("Qualifying predicate expected");
+ as_bad (_("Qualifying predicate expected"));
return 0;
}
if (md.qp.X_add_number < REG_P || md.qp.X_add_number >= REG_P + 64)
{
- as_bad ("Predicate register expected");
+ as_bad (_("Predicate register expected"));
return 0;
}
return 1;
if (md.qp.X_op == O_register)
{
- as_bad ("Tag must come before qualifying predicate.");
+ as_bad (_("Tag must come before qualifying predicate."));
return 0;
}
{
/* Put ':' back for error messages' sake. */
*input_line_pointer++ = ':';
- as_bad ("Expected ':'");
+ as_bad (_("Expected ':'"));
return 0;
}
*input_line_pointer++ = ':';
if (*input_line_pointer++ != ']')
{
- as_bad ("Expected ']'");
+ as_bad (_("Expected ']'"));
return 0;
}
if (! tag)
{
- as_bad ("Tag name expected");
+ as_bad (_("Tag name expected"));
return 0;
}
return 1;
operatorT op;
expressionS *r;
{
- unsigned num_regs;
-
- if (op == O_index)
+ if (op != O_index)
+ return 0;
+ resolve_expression (l);
+ if (l->X_op == O_register)
{
- if (l->X_op == O_register && r->X_op == O_constant)
+ unsigned num_regs = l->X_add_number >> 16;
+
+ resolve_expression (r);
+ if (num_regs)
{
- num_regs = (l->X_add_number >> 16);
- if ((unsigned) r->X_add_number >= num_regs)
+ /* Left side is a .rotX-allocated register. */
+ if (r->X_op != O_constant)
{
- if (!num_regs)
- as_bad ("No current frame");
- else
- as_bad ("Index out of range 0..%u", num_regs - 1);
+ as_bad (_("Rotating register index must be a non-negative constant"));
+ r->X_add_number = 0;
+ }
+ else if ((valueT) r->X_add_number >= num_regs)
+ {
+ as_bad (_("Index out of range 0..%u"), num_regs - 1);
r->X_add_number = 0;
}
l->X_add_number = (l->X_add_number & 0xffff) + r->X_add_number;
return 1;
}
- else if (l->X_op == O_register && r->X_op == O_register)
+ else if (l->X_add_number >= IND_CPUID && l->X_add_number <= IND_RR)
{
- if (l->X_add_number < IND_CPUID || l->X_add_number > IND_RR
- || l->X_add_number == IND_MEM)
+ if (r->X_op != O_register
+ || r->X_add_number < REG_GR
+ || r->X_add_number > REG_GR + 127)
{
- as_bad ("Indirect register set name expected");
- l->X_add_number = IND_CPUID;
+ as_bad (_("Indirect register index must be a general register"));
+ r->X_add_number = REG_GR;
}
l->X_op = O_index;
- l->X_op_symbol = md.regsym[l->X_add_number];
+ l->X_op_symbol = md.indregsym[l->X_add_number - IND_CPUID];
l->X_add_number = r->X_add_number;
return 1;
}
}
- return 0;
+ as_bad (_("Index can only be applied to rotating or indirect registers"));
+ /* Fall back to some register use of which has as little as possible
+ side effects, to minimize subsequent error messages. */
+ l->X_op = O_register;
+ l->X_add_number = REG_GR + 3;
+ return 1;
}
int
end = input_line_pointer;
if (*nextcharP != '(')
{
- as_bad ("Expected '('");
+ as_bad (_("Expected '('"));
break;
}
/* Skip '('. */
expression (e);
if (*input_line_pointer != ')')
{
- as_bad ("Missing ')'");
+ as_bad (_("Missing ')'"));
goto done;
}
/* Skip ')'. */
{
if (e->X_op != O_pseudo_fixup)
{
- as_bad ("Not a symbolic expression");
+ as_bad (_("Not a symbolic expression"));
goto done;
}
if (idx != FUNC_LT_RELATIVE)
{
- as_bad ("Illegal combination of relocation functions");
+ as_bad (_("Illegal combination of relocation functions"));
goto done;
}
switch (S_GET_VALUE (e->X_op_symbol))
case FUNC_TP_RELATIVE:
idx = FUNC_LT_TP_RELATIVE; break;
default:
- as_bad ("Illegal combination of relocation functions");
+ as_bad (_("Illegal combination of relocation functions"));
goto done;
}
}
if (regnum >= dr->num_regs)
{
if (!dr->num_regs)
- as_bad ("No current frame");
+ as_bad (_("No current frame"));
else
- as_bad ("Register number out of range 0..%u",
+ as_bad (_("Register number out of range 0..%u"),
dr->num_regs - 1);
regnum = 0;
}
if (len <= 0)
{
if (full > 0)
- as_bad ("Standalone `#' is illegal");
+ as_bad (_("Standalone `#' is illegal"));
}
else if (len < full - 1)
- as_warn ("Redundant `#' suffix operators");
+ as_warn (_("Redundant `#' suffix operators"));
name[len] = '\0';
return name;
}
cannot statically be determined, all source registers are marked used.
12) This insn only reads the specified predicate register when that
register is the PR[qp].
- 13) This reference to ld-c only applies to teh GR whose value is loaded
+ 13) This reference to ld-c only applies to the GR whose value is loaded
with data returned from memory, not the post-incremented address register.
14) The RSE resource includes the implementation-specific RSE internal
state resources. At least one (and possibly more) of these resources are
IC:rse-writers.
15+16) Represents reserved instructions, which the assembler does not
generate.
+ 17) CR[TPR] has a RAW dependency only between mov-to-CR-TPR and
+ mov-to-PSR-l or ssm instructions that set PSR.i, PSR.pp or PSR.up.
Memory resources (i.e. locations in memory) are *not* marked or tracked by
this code; there are no dependency violations based on memory access.
CURR_SLOT.opnd[index].X_add_number - REG_AR;
if (regno == AR_ITC
+ || regno == AR_RUC
|| (index == 0
- && (regno == AR_ITC
- || regno == AR_RSC
+ && (regno == AR_RSC
|| (regno >= AR_K0
&& regno <= AR_K7))))
{
break;
case IA64_RS_CRX:
- /* Handle all CR[REG] resources */
- if (note == 0 || note == 1)
+ /* Handle all CR[REG] resources.
+ ??? FIXME: The rule 17 isn't really handled correctly. */
+ if (note == 0 || note == 1 || note == 17)
{
if (idesc->operands[!rsrc_write] == IA64_OPND_CR3)
{
int certain = (matchtype == 1 && CURR_SLOT.qp_regno == 0);
if (path != 0)
- sprintf (pathmsg, " when entry is at label '%s'",
+ snprintf (pathmsg, sizeof (pathmsg),
+ " when entry is at label '%s'",
md.entry_labels[path - 1]);
if (matchtype == 1 && rs->index >= 0)
- sprintf (indexmsg, ", specific resource number is %d",
+ snprintf (indexmsg, sizeof (indexmsg),
+ ", specific resource number is %d",
rs->index);
- sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s",
+ snprintf (msg, sizeof (msg),
+ "Use of '%s' %s %s dependency '%s' (%s)%s%s",
idesc->name,
(certain ? "violates" : "may violate"),
dv_mode[dep->mode], dep->name,
{
as_warn ("%s", msg);
if (path < md.path)
- as_warn (_("Only the first path encountering the conflict "
- "is reported"));
+ as_warn (_("Only the first path encountering the conflict is reported"));
as_warn_where (rs->file, rs->line,
- _("This is the location of the "
- "conflicting usage"));
+ _("This is the location of the conflicting usage"));
/* Don't bother checking other paths, to avoid duplicating
the same warning */
break;
*input_line_pointer = ch;
if (!idesc)
{
- as_bad ("Unknown opcode `%s'", mnemonic);
+ as_bad (_("Unknown opcode `%s'"), mnemonic);
goto done;
}
else if (ar_is_only_in_memory_unit (CURR_SLOT.opnd[rop].X_add_number))
unit = 'm';
if (unit != 'a' && unit != idesc->name [4])
- as_bad ("AR %d can only be accessed by %c-unit",
+ as_bad (_("AR %d can only be accessed by %c-unit"),
(int) (CURR_SLOT.opnd[rop].X_add_number - REG_AR),
TOUPPER (unit));
}
case hint_b_ok:
break;
case hint_b_warning:
- as_warn ("hint.b may be treated as nop");
+ as_warn (_("hint.b may be treated as nop"));
break;
case hint_b_error:
- as_bad ("hint.b shouldn't be used");
+ as_bad (_("hint.b shouldn't be used"));
break;
}
}
if ((flags & IA64_OPCODE_NO_PRED) != 0 && qp_regno != 0)
{
- as_bad ("`%s' cannot be predicated", idesc->name);
+ as_bad (_("`%s' cannot be predicated"), idesc->name);
goto done;
}
CURR_SLOT.idesc = idesc;
as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line);
dwarf2_where (&CURR_SLOT.debug_line);
+ dwarf2_consume_line_info ();
/* Add unwind entries, if there are any. */
if (unwind.current_entry)
expression_and_evaluate (e);
if (*input_line_pointer != ']')
{
- as_bad ("Closing bracket missing");
+ as_bad (_("Closing bracket missing"));
goto err;
}
else
{
- if (e->X_op != O_register)
- as_bad ("Register expected as index");
+ if (e->X_op != O_register
+ || e->X_add_number < REG_GR
+ || e->X_add_number > REG_GR + 127)
+ {
+ as_bad (_("Index must be a general register"));
+ e->X_add_number = REG_GR;
+ }
++input_line_pointer;
e->X_op = O_index;
/* FALLTHRU */
default:
- as_bad ("Unsupported fixup size %d", nbytes);
+ as_bad (_("Unsupported fixup size %d"), nbytes);
ignore_rest_of_line ();
return;
}
}
/* This should be an error, but since previously there wasn't any
- diagnostic here, dont't make it fail because of this for now. */
- as_warn ("Cannot express %s%d%s relocation", type, width, suffix);
+ diagnostic here, don't make it fail because of this for now. */
+ as_warn (_("Cannot express %s%d%s relocation"), type, width, suffix);
return r_type;
}
}
case BFD_RELOC_IA64_LTOFF_FPTR64I:
if (fix->fx_offset != 0)
as_bad_where (fix->fx_file, fix->fx_line,
- "No addend allowed in @fptr() relocation");
+ _("No addend allowed in @fptr() relocation"));
break;
default:
break;
/* This must be a TAG13 or TAG13b operand. There are no external
relocs defined for them, so we must give an error. */
as_bad_where (fix->fx_file, fix->fx_line,
- "%s must have a constant value",
+ _("%s must have a constant value"),
elf64_ia64_operands[fix->tc_fix_data.opnd].desc);
fix->fx_done = 1;
return;
if (!reloc->howto)
{
as_bad_where (fixp->fx_file, fixp->fx_line,
- "Cannot represent %s relocation in object file",
+ _("Cannot represent %s relocation in object file"),
bfd_get_reloc_code_name (fixp->fx_r_type));
+ free (reloc);
+ return NULL;
}
return reloc;
}
#define MAX_LITTLENUMS 5
char *
-md_atof (type, lit, size)
- int type;
- char *lit;
- int *size;
+md_atof (int type, char *lit, int *size)
{
LITTLENUM_TYPE words[MAX_LITTLENUMS];
char *t;
default:
*size = 0;
- return "Bad call to MD_ATOF()";
+ return _("Unrecognized or unsupported floating point constant");
}
t = atof_ieee (input_line_pointer, type, words);
if (t)
else
*size = prec * sizeof (LITTLENUM_TYPE);
- return 0;
+ return NULL;
}
/* Handle ia64 specific semantics of the align directive. */
{
char *file; /* The file where the directive is seen. */
unsigned int line; /* The line number the directive is at. */
- const char *name; /* The orignale name of the symbol. */
+ const char *name; /* The original name of the symbol. */
};
/* Called for .alias and .secalias directives. If SECTION is 1, it is