This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Thumb-2 Instructio relaxation
- From: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 06 Sep 2005 16:58:50 +0100
- Subject: Re: [patch] Thumb-2 Instructio relaxation
- References: <200508291734.21080.paul@codesourcery.com>
On Mon, 2005-08-29 at 17:34, Paul Brook wrote:
> The attached patch implements assembler relaxation for Thumb-2 instructions.
>
> There are two different classes of relaxation performed:
> - PC-relative branch, adr and ldr instructions.
> - Other (absolute) immediate operands. The current implementation This
> currently only knows how to handle literal constants, but I plan on teaching
> it how to handle symbolic constants.
>
> I've removed the disassembled insn address matching from thumb32.d because
> it's a pain to keep consistent, and doesn't seem to provide any benefit. The
> size if the insn is implicitly checked by checking the hex opcode bytes.
>
> Tested with cross to arm-none-eabi.
> Ok?
>
> Paul
>
> 2005-08-28 Paul Brook <paul@codesourcery.com>
>
> gas/
> * config/tc-arm.c (arm_it): Add relax field.
> (T16_32_TAB): Add addi, addis, add_pc, add_sp, dec_sp, inc_sp,
> b, bcond, ldr_pc, ldr_pc2, ldr_sp, str_sp, subi, subis.
> (do_t_add_sub, do_t_addr, do_t_branch, do_t_ldst,
> do_t_mov_cmp): Allow relaxation.
> (output_relax_insn): New function.
> (put_thumb32_insn): New function.
> (output_inst): Use new functions.
> (md_assemble): Don't throw error on relaxable instructions.
> (insns): Change "b" entry from TCE(...) to tCE(...).
> (md_estimate_size_before_relax): Return 2.
> (md_convert_frag, relax_immediate, relax_adr, relax_addsub,
> relax_branch, arm_relax_frag): New functions.
> (arm_force_relocation): Return 0 for Thumb-2 immediate operand
> relocations.
> * config/tc-arm.h (md_convert_frag): Remove definition.
> (md_relax_frag): Define.
> (arm_relax_frag): Add prototype.
> gas/testsuite/
> * gas/arm/thumb2_relax.d: New test.
> * gas/arm/thumb2_relax.s: New test.
> * gas/arm/thumb32.d: Adjust expected results to include relaxation.
> * gas/arm/thumb32.s: Tweak for better coverage of relaxable
> instructions. Remove load/store tests.
OK.
R.