This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Thumb-2 conditional execution improvements
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Mon, 20 Mar 2006 15:03:23 +0000
- Subject: Re: [patch] Thumb-2 conditional execution improvements
- References: <200603192209.03888.paul@codesourcery.com>
On Sun, 2006-03-19 at 22:09, Paul Brook wrote:
> The attached patch improves gas handling of the Thumb-2 IT (If Then)
> conditional execution instruction and related constraints. Specifically:
>
> - Conditional branches are encoded as unconditional branches when inside an IT
> block, and must be the last instruction in an IT block..
>
> - BKPT is always unconditional, even inside an IT block.
>
> - Some unconditional Arm instructions can be conditional in Thumb mode. I've
> changed the initial parsing routine to allow all thumb instructions to be
> conditional, then enforced truly unconditional instructions in individual
> routines.
>
> - Testcases for all the above.
>
> Tested with cross to arm-none-eabi.
> Ok?
>
> Paul
>
> 2006-03-20 Paul Brook <paul@codesourcery.com>
>
> gas/
> * config/tc-arm.c (BAD_BRANCH, BAD_NOT_IT): Define.
> (do_t_branch): Encode branches inside IT blocks as unconditional.
> (do_t_cps): New function.
> (do_t_blx, do_t_bkpt, do_t_branch23, do_t_bx, do_t_bxj, do_t_cpsi,
> do_t_czb, do_t_it, do_t_setend, do_t_tb): Add IT constaints.
> (opcode_lookup): Allow conditional suffixes on all instructions in
> Thumb mode.
> (md_assemble): Advance condexec state before checking for errors.
> (insns): Use do_t_cps.
> gas/testsuite/
> * gas/arm/thumb2_bcond.d: New test.
> * gas/arm/thumb2_bcond.s: New test.
> * gas/arm/thumb2_it_bad.d: New test.
> * gas/arm/thumb2_it_bad.l: New test.
> * gas/arm/thumb2_it_bad.s: New test.
OK
R.