CSKY: Refine operand format error reporting.
authorCooper Qu <cooper.qu@linux.alibaba.com>
Mon, 31 Aug 2020 03:27:54 +0000 (11:27 +0800)
committerLifang Xia <lifang_xia@c-sky.com>
Mon, 31 Aug 2020 03:32:18 +0000 (11:32 +0800)
commite2e82b115cc0eed19dd88f87970e6c0417141baa
tree7741b2e70f9f4caceeaedb5d9466077fa7430955
parentdd221981c470f4fcb3164ce6d47bcd7726b559a4
CSKY: Refine operand format error reporting.

Rename SET_ERROR_NUMBER to SET_ERROR_STRING, and add SET_ERROR_INTEGER
to report error message which pass an integer argument.

gas/
* config/tc-csky.c (csky_error_state): New member 'arg_int'.
(SET_ERROR_NUMBER): Rename to SET_ERROR_STRING.
(SET_ERROR_INTEGER): New.
(err_formats): Add error format for ERROR_FREG_OVER_RANGE and
ERROR_VREG_OVER_RANGE.
(csky_show_error): Pass an integer argument for some error
numbers.
(parse_exp): Call SET_ERROR_STRING instead of SET_ERROR_NUMBER.
(parse_rt): Likewise.
(parse_type_ctrlreg): Likewise.
(csky_get_reg_val): Likewise.
(is_reglist_legal): Likewise.
(is_freglist_legal): Likewise.
(is_reglist_dash_comma_legal): Likewise.
(is_reg_lshift_illegal): Likewise.
(is_psr_bit): Likewise.
(parse_type_cpreg): Likewise.
(parse_type_cpcreg): Likewise.
(parse_type_areg): Likewise.
(parse_type_freg): Likewise.
(parse_ldst_imm): Likewise and call SET_ERROR_INTEGER.
(get_operand_value): Likewise.
(parse_operands_op): Likewise and call is_imm_within_range,
is_imm_within_range_ext and is_oimm_within_range.
(md_assemble): Likewise.
(is_imm_within_range): New.
(is_imm_within_range_ext): Rename from is_imm_over_range.
(is_oimm_within_range): Rename from is_oimm_over_range.
(v2_work_add_sub): Call SET_ERROR_INTEGER.
(csky_rolc): call is_imm_within_range instead of
is_imm_over_range.

opcodes/
* csky-dis.c (csky_output_operand): Assign dis_info.value for
OPRND_TYPE_VREG.
gas/ChangeLog
gas/config/tc-csky.c
opcodes/ChangeLog
opcodes/csky-dis.c