aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJames Bowman <jamesb@excamera.com>2017-10-12 18:37:40 -0700
committerJames Bowman <jamesb@excamera.com>2017-10-12 18:41:29 -0700
commit3b4b0a629a972bf80fc0ac6202f89681fab1df37 (patch)
treec8cde198a64de3a48b1de08dbf65f68dbbc9a13d /gas
parentd268bbaff7da90caf5fbc94456ae58315ffa1802 (diff)
downloadfsf-binutils-gdb-3b4b0a629a972bf80fc0ac6202f89681fab1df37.zip
fsf-binutils-gdb-3b4b0a629a972bf80fc0ac6202f89681fab1df37.tar.gz
fsf-binutils-gdb-3b4b0a629a972bf80fc0ac6202f89681fab1df37.tar.bz2
FT32: support for FT32B processor - part 1
FT32B is a new FT32 family member. It has a code compression scheme, which requires the use of linker relaxations. The change is quite large, so submission is in several parts. Part 1 adds a 15-bit instruction field, and CPU-specific functions for the code compression that are used in binutils and GDB. bfd/ChangeLog: 2017-10-12 James Bowman <james.bowman@ftdichip.com> * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-ft32.c: Add HOWTO R_FT32_15. * reloc.c: Add BFD_RELOC_FT32_15. gas/ChangeLog: 2017-10-12 James Bowman <james.bowman@ftdichip.com> * config/tc-ft32.c (md_assemble): Replace FT32_FLD_K8 with K15. (md_apply_fix, tc_gen_reloc): Add BFD_RELOC_FT32_15. include/ChangeLog: 2017-10-12 James Bowman <james.bowman@ftdichip.com> * elf/ft32.h: Add R_FT32_15. * opcode/ft32.h: Replace FT32_FLD_K8 with K15. (ft32_shortcode, sc_compar, ft32_split_shortcode, ft32_merge_shortcode, ft32_merge_shortcode): New functions. opcodes/ChangeLog: 2017-10-12 James Bowman <james.bowman@ftdichip.com> * opcodes/ft32-dis.c (print_insn_ft32): Replace FT32_FLD_K8 with K15. * opcodes/ft32-opc.c (ft32_opc_info): Replace FT32_FLD_K8 with K15. Add jmpix pattern. sim/ChangeLog: 2017-10-12 James Bowman <james.bowman@ftdichip.com> * sim/ft32/interp.c (step_once): Replace FT32_FLD_K8 with K15.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-ft32.c17
2 files changed, 20 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 67b789d..b8a8ce1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2017-10-12 James Bowman <james.bowman@ftdichip.com>
+
+ * config/tc-ft32.c (md_assemble): Replace FT32_FLD_K8 with
+ K15.
+ (md_apply_fix, tc_gen_reloc): Add BFD_RELOC_FT32_15.
+
2017-10-11 Nick Clifton <nickc@redhat.com>
PR 21977
diff --git a/gas/config/tc-ft32.c b/gas/config/tc-ft32.c
index 6d5e2ce..2878e14 100644
--- a/gas/config/tc-ft32.c
+++ b/gas/config/tc-ft32.c
@@ -348,14 +348,16 @@ md_assemble (char *str)
0,
BFD_RELOC_16);
break;
- case FT32_FLD_K8:
+ case FT32_FLD_K15:
op_end = parse_exp_save_ilp (op_end, &arg);
+ if (arg.X_add_number & 0x80)
+ arg.X_add_number ^= 0x7f00;
fix_new_exp (frag_now,
(output - frag_now->fr_literal),
- 1,
+ 2,
&arg,
0,
- BFD_RELOC_8);
+ BFD_RELOC_FT32_15);
break;
case FT32_FLD_R_D_POST:
b |= parse_register_operand (&op_end) << FT32_FLD_R_D_BIT;
@@ -529,6 +531,14 @@ md_apply_fix (fixS *fixP ATTRIBUTE_UNUSED,
md_number_to_chars (buf, newval, 3);
break;
+ case BFD_RELOC_FT32_15:
+ if (!val)
+ break;
+ newval = md_chars_to_number (buf, 2);
+ newval |= val & ((1 << 15) - 1);
+ md_number_to_chars (buf, newval, 2);
+ break;
+
case BFD_RELOC_FT32_17:
if (!val)
break;
@@ -574,6 +584,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
case BFD_RELOC_8:
case BFD_RELOC_FT32_10:
case BFD_RELOC_FT32_20:
+ case BFD_RELOC_FT32_15:
case BFD_RELOC_FT32_17:
case BFD_RELOC_FT32_18:
code = fixP->fx_r_type;