/* Points to the end of an expression just parsed by get_expression
and friends. FIXME. This shouldn't be handled with a file-global
variable. */
-static char *expr_end;
+static char *expr_parse_end;
/* Nonzero if a .callinfo appeared within the current procedure. */
static int callinfo_found;
hppa_field_selector, size * 8, 0, 0);
}
-/* Mark (via expr_end) the end of an expression (I think). FIXME. */
+/* Mark (via expr_parse_end) the end of an expression (I think). FIXME. */
static void
get_expression (char *str)
|| SEG_NORMAL (seg)))
{
as_warn (_("Bad segment in expression."));
- expr_end = input_line_pointer;
+ expr_parse_end = input_line_pointer;
input_line_pointer = save_in;
return;
}
- expr_end = input_line_pointer;
+ expr_parse_end = input_line_pointer;
input_line_pointer = save_in;
}
return hppa_field_adjust (0, value, field_selector);
}
-/* Mark (via expr_end) the end of an absolute expression. FIXME. */
+/* Mark (via expr_parse_end) the end of an absolute expression. FIXME. */
static int
pa_get_absolute_expression (struct pa_it *insn, char **strp)
save_in = input_line_pointer;
input_line_pointer = *strp;
expression (&insn->exp);
- expr_end = input_line_pointer;
+ expr_parse_end = input_line_pointer;
input_line_pointer = save_in;
if (insn->exp.X_op != O_constant)
{
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 32, 1, 0);
SAVE_IMMEDIATE(num);
INSERT_FIELD_AND_CONTINUE (opcode, 32 - num, 0);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
/* When in strict mode, we want to just reject this
match instead of giving an out of range error. */
CHECK_FIELD (num, 15, -16, strict);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
/* When in strict mode, we want to just reject this
match instead of giving an out of range error. */
CHECK_FIELD (num, 15, -16, strict);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 31, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 31, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 16);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 1023, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 16);
are 0..6 inclusive. */
case 'h':
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
get_expression (s);
if (the_insn.exp.X_op == O_constant)
{
- s = expr_end;
+ s = expr_parse_end;
num = evaluate_absolute (&the_insn);
CHECK_FIELD (num, 6, 0, 0);
num = (num + 1) ^ 1;
case 'i':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'J':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
int mb;
case 'K':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
int mb;
case '<':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
int mb;
case '>':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
int mb;
break;
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'd':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'j':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'k':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'l':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'y':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case '&':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
if (the_insn.exp.X_op == O_constant)
{
num = evaluate_absolute (&the_insn);
case 'w':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
the_insn.pcrel = 1;
if (!the_insn.exp.X_add_symbol
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
the_insn.format = 12;
the_insn.arg_reloc = last_call_desc.arg_reloc;
memset (&last_call_desc, 0, sizeof (struct call_desc));
- s = expr_end;
+ s = expr_parse_end;
continue;
}
case 'W':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
the_insn.pcrel = 1;
if (!the_insn.exp.X_add_symbol
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
case 'X':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
the_insn.pcrel = 1;
if (!the_insn.exp.X_add_symbol
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
case 'z':
the_insn.field_selector = pa_chk_field_selector (&s);
get_expression (s);
- s = expr_end;
+ s = expr_parse_end;
the_insn.pcrel = 0;
if (!the_insn.exp.X_add_symbol
|| !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol),
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 3, 1, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 6);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 15, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 6);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 31, 0, strict);
SAVE_IMMEDIATE(num);
INSERT_FIELD_AND_CONTINUE (opcode, 31 - num, 5);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 63, 0, strict);
SAVE_IMMEDIATE(num);
num = 63 - num;
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 64, 1, strict);
SAVE_IMMEDIATE(num);
num--;
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 64, 1, strict);
SAVE_IMMEDIATE(num);
num--;
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 31, 0, strict);
SAVE_IMMEDIATE(num);
INSERT_FIELD_AND_CONTINUE (opcode, num, 5);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 63, 0, strict);
SAVE_IMMEDIATE(num);
opcode |= (num & 0x20) << 6;
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 63, 0, strict);
if (num & 0x20)
opcode &= ~(1 << 13);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 31, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 21);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 511, 1, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 3);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 8191, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 13);
num = pa_get_absolute_expression (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 67108863, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 7, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 6);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 1048575, 0, strict);
num = (num & 0x1f) | ((num & 0x000fffe0) << 6);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 32767, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 11);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 1023, 0, strict);
num = (num & 0x1f) | ((num & 0x000003e0) << 6);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 32767, 0, strict);
num = (num & 0x1f) | ((num & 0x00007fe0) << 6);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 7, 0, strict);
INSERT_FIELD_AND_CONTINUE (opcode, num, 6);
num = pa_get_number (&the_insn, &s);
if (strict && the_insn.exp.X_op != O_constant)
break;
- s = expr_end;
+ s = expr_parse_end;
CHECK_FIELD (num, 4194303, 0, strict);
num = (num & 0x1f) | ((num & 0x003fffe0) << 4);
INSERT_FIELD_AND_CONTINUE (opcode, num, 0);
/* Indicate CSR or priv instructions are explicitly used. */
static bool explicit_priv_attr = false;
-static char *expr_end;
+static char *expr_parse_end;
/* Macros for encoding relaxation state for RVC branches and far jumps. */
#define RELAX_BRANCH_ENCODE(uncond, rvc, length) \
*s = e;
*e = save_c;
- expr_end = e;
+ expr_parse_end = e;
return o;
}
save_in = input_line_pointer;
input_line_pointer = str;
expression (ep);
- expr_end = input_line_pointer;
+ expr_parse_end = input_line_pointer;
input_line_pointer = save_in;
}
expression in *EP and the relocation, if any, in RELOC.
Return the number of relocation operators used (0 or 1).
- On exit, EXPR_END points to the first character after the expression. */
+ On exit, EXPR_PARSE_END points to the first character after the
+ expression. */
static size_t
my_getSmallExpression (expressionS *ep, bfd_reloc_code_real_type *reloc,
{
ep->X_op = O_register;
ep->X_add_number = regno;
- expr_end = str;
+ expr_parse_end = str;
return 0;
}
&& parse_relocation (&str, reloc, percent_op));
my_getExpression (ep, crux);
- str = expr_end;
+ str = expr_parse_end;
/* Match every open bracket. */
while (crux_depth > 0 && (*str == ')' || *str == ' ' || *str == '\t'))
if (crux_depth > 0)
as_bad ("unclosed '('");
- expr_end = str;
+ expr_parse_end = str;
return reloc_index;
}
}
/* Parse string STR as a vsetvli operand. Store the expression in *EP.
- On exit, EXPR_END points to the first character after the expression. */
+ On exit, EXPR_PARSE_END points to the first character after the
+ expression. */
static void
my_getVsetvliExpression (expressionS *ep, char *str)
| (vsew_value << OP_SH_VSEW)
| (vta_value << OP_SH_VTA)
| (vma_value << OP_SH_VMA);
- expr_end = str;
+ expr_parse_end = str;
}
else
{
my_getExpression (ep, str);
- str = expr_end;
+ str = expr_parse_end;
}
}
break;
ip->insn_opcode |= ENCODE_CITYPE_IMM (imm_expr->X_add_number);
rvc_imm_done:
- asarg = expr_end;
+ asarg = expr_parse_end;
imm_expr->X_op = O_absent;
continue;
case '5':
}
INSERT_OPERAND (CFUNCT6, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '4':
}
INSERT_OPERAND (CFUNCT4, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '3':
}
INSERT_OPERAND (CFUNCT3, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '2':
}
INSERT_OPERAND (CFUNCT2, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
default:
ip->insn_opcode
|= ENCODE_RVV_VB_IMM (imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'c': /* vtypei for vsetvli */
ip->insn_opcode
|= ENCODE_RVV_VC_IMM (imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'i': /* vector arith signed immediate */
"value must be -16...15"));
INSERT_OPERAND (VIMM, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'j': /* vector arith unsigned immediate */
"value must be 0...31"));
INSERT_OPERAND (VIMM, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'k': /* vector arith signed immediate, minus 1 */
"value must be -15...16"));
INSERT_OPERAND (VIMM, *ip, imm_expr->X_add_number - 1);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'm': /* optional vector mask */
imm_expr->X_add_number);
INSERT_OPERAND (SHAMTW, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '>': /* Shift amount, 0 - (XLEN-1). */
imm_expr->X_add_number);
INSERT_OPERAND (SHAMT, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'Z': /* CSRRxI immediate. */
imm_expr->X_add_number);
INSERT_OPERAND (RS1, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'E': /* Control register. */
imm_expr->X_add_number);
INSERT_OPERAND (CSR, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
}
continue;
&& imm_expr->X_op != O_constant)
break;
normalize_constant_expr (imm_expr);
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'A':
if (imm_expr->X_op != O_symbol)
break;
*imm_reloc = BFD_RELOC_32;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'B':
break;
if (imm_expr->X_op == O_symbol)
*imm_reloc = BFD_RELOC_32;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'j': /* Sign-extended immediate. */
|| imm_expr->X_add_number < -(signed)RISCV_IMM_REACH/2)
break;
}
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'p': /* PC-relative offset. */
branch:
*imm_reloc = BFD_RELOC_12_PCREL;
my_getExpression (imm_expr, asarg);
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'u': /* Upper 20 bits. */
*imm_reloc = BFD_RELOC_RISCV_HI20;
imm_expr->X_add_number <<= RISCV_IMM_BITS;
}
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'a': /* 20-bit PC-relative offset. */
}
jump:
my_getExpression (imm_expr, asarg);
- asarg = expr_end;
+ asarg = expr_parse_end;
*imm_reloc = BFD_RELOC_RISCV_JMP;
continue;
case 'c':
my_getExpression (imm_expr, asarg);
- asarg = expr_end;
+ asarg = expr_parse_end;
if (strcmp (asarg, "@plt") == 0)
asarg += 4;
*imm_reloc = BFD_RELOC_RISCV_CALL_PLT;
}
INSERT_OPERAND (OP, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '2':
}
INSERT_OPERAND (OP2, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
default:
}
INSERT_OPERAND (FUNCT7, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '3':
}
INSERT_OPERAND (FUNCT3, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case '2':
}
INSERT_OPERAND (FUNCT2, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
default:
(unsigned long)imm_expr->X_add_number);
INSERT_OPERAND(BS, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'Y': /* rnum immediate */
(unsigned long)imm_expr->X_add_number);
INSERT_OPERAND(RNUM, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'z':
|| imm_expr->X_op != O_constant
|| imm_expr->X_add_number != 0)
break;
- asarg = expr_end;
+ asarg = expr_parse_end;
imm_expr->X_op = O_absent;
continue;
ENCODE_STYPE_IMM ((unsigned) (imm_expr->X_add_number) &
~ 0x1fU);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
case 'X': /* Integer immediate. */
}
INSERT_IMM (n, s, *ip, imm_expr->X_add_number);
imm_expr->X_op = O_absent;
- asarg = expr_end;
+ asarg = expr_parse_end;
continue;
default:
goto unknown_riscv_ip_operand;