diff options
author | Cooper Qu <cooper.qu@linux.alibaba.com> | 2020-09-17 14:30:28 +0800 |
---|---|---|
committer | Lifang Xia <xlf194833_xia@alibaba-inc.com> | 2020-09-23 23:55:36 +0800 |
commit | afdcafe89118cee761f9bf67ea1b1efc29311300 (patch) | |
tree | 6bfaa44e694d29891509d89d7bdcb1601418c27f /gas/testsuite | |
parent | 20a5fcbd5b28cca88511ac5a9ad5e54251e8fa6d (diff) | |
download | binutils-gdb-afdcafe89118cee761f9bf67ea1b1efc29311300.tar.gz |
CSKY: Add objdump option -M abi-names.
Add option parser for disassembler, and refine the codes of
parse register operand and disassemble register operand.
While strengthen the operands legality check of some instructions.
Co-Authored-By: Lifang Xia <lifang_xia@c-sky.com>
gas/
* config/tc-csky.c (parse_type_ctrlreg): Use function
csky_get_control_regno to operand.
(csky_get_reg_val): Likewise.
(is_reg_sp_with_bracket): Use function csky_get_reg_val
to parse operand.
(is_reg_sp): Refine.
(is_oimm_within_range): Fix, report error when operand
is not constant.
(parse_type_cpreg): Refine.
(parse_type_cpcreg): Refine.
(get_operand_value): Add handle of OPRND_TYPE_IMM5b_LS.
(md_assemble): Fix no error reporting somtimes when
operands number are not fit.
(csky_addc64): Refine.
(csky_subc64): Refine.
(csky_or64): Refine.
(v1_work_fpu_fo): Refine.
(v1_work_fpu_read): Refine.
(v1_work_fpu_writed): Refine.
(v1_work_fpu_readd): Refine.
(v2_work_addc): New function, strengthen the operands legality
check of addc.
* gas/testsuite/gas/csky/all.d : Use register number format when
disassemble register name by default.
* gas/testsuite/gas/csky/cskyv2_all.d : Likewise.
* gas/testsuite/gas/csky/trust.d: Likewise.
* gas/testsuite/gas/csky/cskyv2_ck860.d : Fix.
* gas/testsuite/gas/csky/trust.s : Fix.
opcodes/
* csky-dis.c (using_abi): New.
(parse_csky_dis_options): New function.
(get_gr_name): New function.
(get_cr_name): New function.
(csky_output_operand): Use get_gr_name and get_cr_name to
disassemble and add handle of OPRND_TYPE_IMM5b_LS.
(print_insn_csky): Parse disassembler options.
* opcodes/csky-opc.h (OPRND_TYPE_IMM5b_LS): New enum.
(GENARAL_REG_BANK): Define.
(REG_SUPPORT_ALL): Define.
(REG_SUPPORT_ALL): New.
(ASH): Define.
(REG_SUPPORT_A): Define.
(REG_SUPPORT_B): Define.
(REG_SUPPORT_C): Define.
(REG_SUPPORT_D): Define.
(REG_SUPPORT_E): Define.
(csky_abiv1_general_regs): New.
(csky_abiv1_control_regs): New.
(csky_abiv2_general_regs): New.
(csky_abiv2_control_regs): New.
(get_register_name): New function.
(get_register_number): New function.
(csky_get_general_reg_name): New function.
(csky_get_general_regno): New function.
(csky_get_control_reg_name): New function.
(csky_get_control_regno): New function.
(csky_v2_opcodes): Prefer two oprerans format for bclri and
bseti, strengthen the operands legality check of addc, zext
and sext.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/csky/all.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/csky/cskyv2_all.d | 36 | ||||
-rw-r--r-- | gas/testsuite/gas/csky/cskyv2_all.s | 24 | ||||
-rw-r--r-- | gas/testsuite/gas/csky/trust.d | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/csky/trust.s | 1 |
5 files changed, 35 insertions, 37 deletions
diff --git a/gas/testsuite/gas/csky/all.d b/gas/testsuite/gas/csky/all.d index 606bcc0d3c6..af9acb50da8 100644 --- a/gas/testsuite/gas/csky/all.d +++ b/gas/testsuite/gas/csky/all.d @@ -20,7 +20,7 @@ Disassembly of section \.text: \s*[0-9a-f]*:\s*0032\s*mvcv\s*r2 \s*[0-9a-f]*:\s*0042\s*ldq\s*r4-r7, \(r2\) \s*[0-9a-f]*:\s*0052\s*stq\s*r4-r7, \(r2\) -\s*[0-9a-f]*:\s*0061\s*ldm\s*r1-r15, \(sp\) +\s*[0-9a-f]*:\s*0061\s*ldm\s*r1-r15, \(r0\) \s*[0-9a-f]*:\s*0082\s*dect\s*r2, r2, 1 \s*[0-9a-f]*:\s*0092\s*decf\s*r2, r2, 1 \s*[0-9a-f]*:\s*00a2\s*inct\s*r2, r2, 1 diff --git a/gas/testsuite/gas/csky/cskyv2_all.d b/gas/testsuite/gas/csky/cskyv2_all.d index bb688ec97d4..bb104a7bc09 100644 --- a/gas/testsuite/gas/csky/cskyv2_all.d +++ b/gas/testsuite/gas/csky/cskyv2_all.d @@ -14,10 +14,10 @@ Disassembly of section \.text: \s*[0-9a-f]*:\s*c6824848\s*lsri\s*r8,\s*r2,\s*20 \s*[0-9a-f]*:\s*5227\s*asri\s*r1,\s*r2,\s*7 \s*[0-9a-f]*:\s*6049\s*addc\s*r1,\s*r2 -\s*[0-9a-f]*:\s*c4310051\s*addc\s*r17,\s*r17,\s*r1 +\s*[0-9a-f]*:\s*c6210051\s*addc\s*r17,\s*r1,\s*r17 \s*[0-9a-f]*:\s*c4620041\s*addc\s*r1,\s*r2,\s*r3 \s*[0-9a-f]*:\s*6049\s*addc\s*r1,\s*r2 -\s*[0-9a-f]*:\s*c6210041\s*addc\s*r1,\s*r1,\s*r17 +\s*[0-9a-f]*:\s*c4310041\s*addc\s*r1,\s*r17,\s*r1 \s*[0-9a-f]*:\s*c7d20052\s*addc\s*r18,\s*r18,\s*r30 \s*[0-9a-f]*:\s*604b\s*subc\s*r1,\s*r2 \s*[0-9a-f]*:\s*c4310111\s*subc\s*r17,\s*r17,\s*r1 @@ -67,23 +67,23 @@ Disassembly of section \.text: \s*[0-9a-f]*:\s*c4419421\s*mulsw\s*r1,\s*r1,\s*r2 \s*[0-9a-f]*:\s*8344\s*ld.b\s*r2,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*8b42\s*ld.h\s*r2,\s*\(r3,\s*0x4\) -\s*[0-9a-f]*:\s*9841\s*ld.w\s*r2,\s*\(sp,\s*0x4\) +\s*[0-9a-f]*:\s*9841\s*ld.w\s*r2,\s*\(r14,\s*0x4\) \s*[0-9a-f]*:\s*a344\s*st.b\s*r2,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*ab42\s*st.h\s*r2,\s*\(r3,\s*0x4\) -\s*[0-9a-f]*:\s*b841\s*st.w\s*r2,\s*\(sp,\s*0x4\) +\s*[0-9a-f]*:\s*b841\s*st.w\s*r2,\s*\(r14,\s*0x4\) \s*[0-9a-f]*:\s*d9030004\s*ld.b\s*r8,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*d8481002\s*ld.h\s*r2,\s*\(r8,\s*0x4\) -\s*[0-9a-f]*:\s*9841\s*ld.w\s*r2,\s*\(sp,\s*0x4\) +\s*[0-9a-f]*:\s*9841\s*ld.w\s*r2,\s*\(r14,\s*0x4\) \s*[0-9a-f]*:\s*dc480004\s*st.b\s*r2,\s*\(r8,\s*0x4\) \s*[0-9a-f]*:\s*dc481002\s*st.h\s*r2,\s*\(r8,\s*0x4\) -\s*[0-9a-f]*:\s*dd0e2001\s*st.w\s*r8,\s*\(sp,\s*0x4\) +\s*[0-9a-f]*:\s*dd0e2001\s*st.w\s*r8,\s*\(r14,\s*0x4\) \s*[0-9a-f]*:\s*d8434003\s*ld.bs\s*r2,\s*\(r3,\s*0x3\) \s*[0-9a-f]*:\s*d8433001\s*ld.d\s*r2,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*dc433001\s*st.d\s*r2,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*dc437001\s*stex.w\s*r2,\s*\(r3,\s*0x4\) \s*[0-9a-f]*:\s*d8437001\s*ldex.w\s*r2,\s*\(r3,\s*0x4\) -\s*[0-9a-f]*:\s*140c\s*addi\s*sp,\s*sp,\s*48 -\s*[0-9a-f]*:\s*1b01\s*addi\s*r3,\s*sp,\s*4 +\s*[0-9a-f]*:\s*140c\s*addi\s*r14,\s*r14,\s*48 +\s*[0-9a-f]*:\s*1b01\s*addi\s*r3,\s*r14,\s*4 \s*[0-9a-f]*:\s*2113\s*addi\s*r1,\s*20 \s*[0-9a-f]*:\s*2113\s*addi\s*r1,\s*20 \s*[0-9a-f]*:\s*e6b50013\s*addi\s*r21,\s*r21,\s*20 @@ -92,16 +92,16 @@ Disassembly of section \.text: \s*[0-9a-f]*:\s*e5040000\s*addi\s*r8,\s*r4,\s*1 \s*[0-9a-f]*:\s*e4240008\s*addi\s*r1,\s*r4,\s*9 \s*[0-9a-f]*:\s*cc3c0008\s*addi\s*r1,\s*r28,\s*9 -\s*[0-9a-f]*:\s*e46e0000\s*addi\s*r3,\s*sp,\s*1 -\s*[0-9a-f]*:\s*e46e03ff\s*addi\s*r3,\s*sp,\s*1024 -\s*[0-9a-f]*:\s*e5ce0032\s*addi\s*sp,\s*sp,\s*51 -\s*[0-9a-f]*:\s*e5ce01ff\s*addi\s*sp,\s*sp,\s*512 +\s*[0-9a-f]*:\s*e46e0000\s*addi\s*r3,\s*r14,\s*1 +\s*[0-9a-f]*:\s*e46e03ff\s*addi\s*r3,\s*r14,\s*1024 +\s*[0-9a-f]*:\s*e5ce0032\s*addi\s*r14,\s*r14,\s*51 +\s*[0-9a-f]*:\s*e5ce01ff\s*addi\s*r14,\s*r14,\s*512 \s*[0-9a-f]*:\s*2113\s*addi\s*r1,\s*20 \s*[0-9a-f]*:\s*5c42\s*addi\s*r2,\s*r4,\s*1 \s*[0-9a-f]*:\s*e4440000\s*addi\s*r2,\s*r4,\s*1 -\s*[0-9a-f]*:\s*e46e03ff\s*addi\s*r3,\s*sp,\s*1024 -\s*[0-9a-f]*:\s*e5ce0032\s*addi\s*sp,\s*sp,\s*51 -\s*[0-9a-f]*:\s*142c\s*subi\s*sp,\s*sp,\s*48 +\s*[0-9a-f]*:\s*e46e03ff\s*addi\s*r3,\s*r14,\s*1024 +\s*[0-9a-f]*:\s*e5ce0032\s*addi\s*r14,\s*r14,\s*51 +\s*[0-9a-f]*:\s*142c\s*subi\s*r14,\s*r14,\s*48 \s*[0-9a-f]*:\s*2913\s*subi\s*r1,\s*20 \s*[0-9a-f]*:\s*2913\s*subi\s*r1,\s*20 \s*[0-9a-f]*:\s*e6b51013\s*subi\s*r21,\s*r21,\s*20 @@ -110,12 +110,12 @@ Disassembly of section \.text: \s*[0-9a-f]*:\s*e5041000\s*subi\s*r8,\s*r4,\s*1 \s*[0-9a-f]*:\s*e4241008\s*subi\s*r1,\s*r4,\s*9 \s*[0-9a-f]*:\s*e43c1008\s*subi\s*r1,\s*r28,\s*9 -\s*[0-9a-f]*:\s*e5ce1032\s*subi\s*sp,\s*sp,\s*51 -\s*[0-9a-f]*:\s*e5ce11ff\s*subi\s*sp,\s*sp,\s*512 +\s*[0-9a-f]*:\s*e5ce1032\s*subi\s*r14,\s*r14,\s*51 +\s*[0-9a-f]*:\s*e5ce11ff\s*subi\s*r14,\s*r14,\s*512 \s*[0-9a-f]*:\s*2913\s*subi\s*r1,\s*20 \s*[0-9a-f]*:\s*5c43\s*subi\s*r2,\s*r4,\s*1 \s*[0-9a-f]*:\s*e4441000\s*subi\s*r2,\s*r4,\s*1 -\s*[0-9a-f]*:\s*e5ce1032\s*subi\s*sp,\s*sp,\s*51 +\s*[0-9a-f]*:\s*e5ce1032\s*subi\s*r14,\s*r14,\s*51 \s*[0-9a-f]*:\s*60c2\s*subu\s*r3,\s*r0 \s*[0-9a-f]*:\s*6202\s*subu\s*r8,\s*r0 \s*[0-9a-f]*:\s*c4030089\s*subu\s*r9,\s*r3,\s*r0 diff --git a/gas/testsuite/gas/csky/cskyv2_all.s b/gas/testsuite/gas/csky/cskyv2_all.s index 6e6902e077b..6db5b202bfb 100644 --- a/gas/testsuite/gas/csky/cskyv2_all.s +++ b/gas/testsuite/gas/csky/cskyv2_all.s @@ -76,8 +76,8 @@ all: st.d r2, (r3, 4) stex.w r2, (r3, 4) ldex.w r2, (r3, 4) - addi sp, sp, 0x30 - addi r3, sp, 0x4 + addi r14, r14, 0x30 + addi r3, r14, 0x4 addi r1, 20 addi r1, r1, 20 addi r21, 20 @@ -86,16 +86,16 @@ all: addi r8, r4, 1 addi r1, r4, 9 addi r1, r28, 9 - addi r3, sp, 0x1 - addi r3, sp, 0x400 - addi sp, sp, 0x33 - addi sp, sp, 0x200 + addi r3, r14, 0x1 + addi r3, r14, 0x400 + addi r14, r14, 0x33 + addi r14, r14, 0x200 addi16 r1, 20 addi16 r2, r4, 1 addi32 r2, r4, 1 - addi32 r3, sp, 0x400 - addi32 sp, sp, 0x33 - subi sp, sp, 0x30 + addi32 r3, r14, 0x400 + addi32 r14, r14, 0x33 + subi r14, r14, 0x30 subi r1, 20 subi r1, r1, 20 subi r21, 20 @@ -104,12 +104,12 @@ all: subi r8, r4, 1 subi r1, r4, 9 subi r1, r28, 9 - subi sp, sp, 0x33 - subi sp, sp, 0x200 + subi r14, r14, 0x33 + subi r14, r14, 0x200 subi16 r1, 20 subi16 r2, r4, 1 subi32 r2, r4, 1 - subi32 sp, sp, 0x33 + subi32 r14, r14, 0x33 sub r3, r0 sub r8, r0 sub r9, r3, r0 diff --git a/gas/testsuite/gas/csky/trust.d b/gas/testsuite/gas/csky/trust.d index 1a87b4d472b..adaa21cd77c 100644 --- a/gas/testsuite/gas/csky/trust.d +++ b/gas/testsuite/gas/csky/trust.d @@ -7,11 +7,10 @@ Disassembly of section \.text: #... \s*[0-9a-f]*:\s*c0003c20\s*wsc -\s*[0-9a-f]*:\s*c0006024\s*mfcr\s*r4,\s*cr<0,\s*0> -\s*[0-9a-f]*:\s*c0156024\s*mfcr\s*r4,\s*cr<21,\s*0> -\s*[0-9a-f]*:\s*c004642b\s*mtcr\s*r4,\s*cr<11,\s*0> -\s*[0-9a-f]*:\s*c0046428\s*mtcr\s*r4,\s*cr<8,\s*0> -\s*[0-9a-f]*:\s*c0096024\s*mfcr\s*r4,\s*cr<9,\s*0> +\s*[0-9a-f]*:\s*c0006024\s*mfcr\s*r4,\s*cr<0,\s+0> +\s*[0-9a-f]*:\s*c004642b\s*mtcr\s*r4,\s*cr<11,\s+0> +\s*[0-9a-f]*:\s*c0646428\s*mtcr\s*r4,\s*cr<8,\s+3> +\s*[0-9a-f]*:\s*c0696024\s*mfcr\s*r4,\s*cr<9,\s+3> \s*[0-9a-f]*:\s*c2007420\s*psrset\s*sie \s*[0-9a-f]*:\s*c2007020\s*psrclr\s*sie #... diff --git a/gas/testsuite/gas/csky/trust.s b/gas/testsuite/gas/csky/trust.s index 781dc8cbb84..862fa5bc94a 100644 --- a/gas/testsuite/gas/csky/trust.s +++ b/gas/testsuite/gas/csky/trust.s @@ -1,7 +1,6 @@ TRUST: wsc mfcr r4, psr - mfcr r4, rid mtcr r4, gcr mtcr r4, sedcr mfcr r4, sepcr |