This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] New option for automatically generating IT blocks


Richard,
  the assembly of your test case generates:

  0:   2800            cmp     r0, #0
  2:   bf0c            ite     eq
  4:   3102            addeq   r1, #2
  6:   3103            addne   r1, #3

So only one IT insn is generated.

The assembler also accepts a version of the testcase with the IT insn added manually:

       .syntax unified
       .text
       cmp     r0, #0
       ite eq
       addeq   r1, #2
       .data
       .word   33
       .text
       addne   r1, #3

And, addressing your other question:
       .syntax unified
       .text
       cmp     r0, #0
       ite eq
       addeq   r1, #2
       .data
       .word   33
       .text
       addeq   r1, #3

the assembler does complain due to the last addeq (which should be a NE), so it does verify.

Please let me know if I addressed your concerns.

Daniel.


Richard Earnshaw wrote:
On Fri, 2009-05-08 at 16:29 -0300, Daniel Gutson wrote:
Hi,
  apologies again, this is the current version of the patch.

As I mentioned in the original post, with this patch the assembler allows use of conditional Thumb-2 instructions without requiring explicit IT instructions.

The patch adds the -mauto-it command-line option to enable this automatic generation of IT instructions. When not specified, the original behavior takes place.

I tested this by running the gas testsuite, plus the test cases I added.

Please commit it for me if accepted, since I don't have write access.


Looks generally ok, but I've a couple of questions about dark corners that I can't spot immediate answers to when reading the code.

What happens if the user writes

	.text
	cmp	r0, #0
	addeq	r1, #2
	.data
	.word	33
	.text
	addne	r1, #3

Do we get one or two IT instructions?  If the user puts an explicit ITE
instruction in the sequence does this get verified against both parts.

What happens if we replace the .data section with a different code
section?  What if that also includes an IT block?

R.






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]