CSKY: Add FPUV3 instructions, which supported by ck860f.
authorCooper Qu <cooper.qu@linux.alibaba.com>
Mon, 7 Sep 2020 09:24:11 +0000 (17:24 +0800)
committerLifang Xia <lifang_xia@c-sky.com>
Wed, 9 Sep 2020 11:25:40 +0000 (19:25 +0800)
commit1feede9b384ef80a268ffe0b18e75bd60574f7c7
tree2981852750a2405cc1cdf1cfade31ca5d7574ba0
parentdfbee68088e822453fdc82f6b8a3a5bc468944b1
CSKY: Add FPUV3 instructions, which supported by ck860f.

Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com>
gas/
* config/tc-csky.c (float_work_fpuv3_fmovi): New function,
helper function to encode fpuv3 fmovi instructions.
(float_work_fpuv3_fstore): New function.
(struct literal): Add new member 'offset'.
(csky_cpus): New cpu CK860f.
(enter_literal): Return literal pool pointer instead of offset.
(parse_rt): Adjust the change of enter_literal.
(parse_rtf): Likewise.
(v1_work_lrw): Likewise.
(v1_work_jbsr): Likewise.
(v2_work_lrw): Likewise.
(v2_work_jbsr): Likewise.
(v2_work_jsri): Likewise.
(vdsp_work_vlrw): Likewise.
(is_freglist_legal): Add handler for FPUV3.
(parse_type_freg): Likewise.
(is_imm_within_range): Set e.X_add_number if it is a signed and
negtive number.
(get_operand_value): Add handler for OPRND_TYPE_IMM9b,
OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI
and OPRND_TYPE_DFLOAT_FMOVI.
(float_to_half): Convert float number to harf float.

opcodes/
* csky-dis.c (csky_output_operand): Add handlers for
OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI and
OPRND_TYPE_DFLOAT_FMOVI. Refine OPRND_TYPE_FREGLIST_DASH
to support FPUV3 instructions.
* csky-opc.h (enum operand_type): New enum OPRND_TYPE_IMM9b,
OPRND_TYPE_HFLOAT_FMOVI, OPRND_TYPE_SFLOAT_FMOVI and
OPRND_TYPE_DFLOAT_FMOVI.
(OPRND_MASK_4_5, OPRND_MASK_6, OPRND_MASK_6_7, OPRND_MASK_6_8,
 OPRND_MASK_7, OPRND_MASK_7_8, OPRND_MASK_17_24,
 OPRND_MASK_20, OPRND_MASK_20_21, OPRND_MASK_20_22,
 OPRND_MASK_20_23, OPRND_MASK_20_24, OPRND_MASK_20_25,
 OPRND_MASK_0_3or5_8, OPRND_MASK_0_3or6_7, OPRND_MASK_0_3or25,
 OPRND_MASK_0_4or21_24, OPRND_MASK_5or20_21,
 OPRND_MASK_5or20_22, OPRND_MASK_5or20_23, OPRND_MASK_5or20_24,
 OPRND_MASK_5or20_25, OPRND_MASK_8_9or21_25,
 OPRND_MASK_8_9or16_25, OPRND_MASK_4_6or20, OPRND_MASK_5_7or20,
 OPRND_MASK_4_5or20or25, OPRND_MASK_4_6or20or25,
 OPRND_MASK_4_7or20or25, OPRND_MASK_6_9or17_24,
 OPRND_MASK_6_7or20, OPRND_MASK_6or20, OPRND_MASK_7or20,
 OPRND_MASK_5or8_9or16_25, OPRND_MASK_5or8_9or20_25): Define.
(csky_v2_opcodes): Add FPUV3 instructions.

include/
* opcode/csky.h (CSKY_ISA_FLOAT_7E60): Define.
gas/ChangeLog
gas/config/tc-csky.c
include/ChangeLog
include/opcode/csky.h
opcodes/ChangeLog
opcodes/csky-dis.c
opcodes/csky-opc.h