All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] Query on CONFIG_SYS_THUMB_BUILD
Date: Wed, 19 Nov 2014 18:48:57 +0100	[thread overview]
Message-ID: <20141119184857.112c802d@lilith> (raw)
In-Reply-To: <87sihfm9ti.fsf@nbsps.com>

Hello Bill,

On Wed, 19 Nov 2014 11:31:05 -0500, Bill Pringlemeir
<bpringlemeir@nbsps.com> wrote:
> On 19 Nov 2014, wd at denx.de wrote:
> 
> > Dear Albert,
> >
> > In message <20141119074214.3d414ce6@lilith> you wrote:
> >>
> >> For -mauto-it, it is not documented in the gas documentation online
> >> or in my current as' --target-help. I'll dig this deeper today, but
> >> barring any scream from me, the change above is fine globally in
> >> U-Boot.
> 
> > Apparently this [1] is where it is coming from; no further
> > documentation there, though.
> 
> > [1] https://sourceware.org/ml/binutils/2009-05/msg00132.html
> 
> I would think that if this worked they would make it automatic and not
> an option.  Probably this is only in certain binutils/as.
> 
> With 4.6.3 and 4.9.1 I do not have this option,

Which option do you mean? -mimplicit-it or -mauto-it?

> [foo.S]
> .syntax unified
> .thumb
> foo:
>    cmp r0, #5
>    movne r1,#6
>    moveq r1,#2
>    bx lr
> bar:
>    cmp r0, #10
>    movhi r1,#3
>    movls r1,#7
>    moveq r1,#11
>    bx lr
> 
> $ arm-none-linux-gnueabi.gcc4.6.3/bin/arm-none-linux-gnueabi-as
> -mcpu=cortex-a5 -mimplicit-it=always foo.S -o foo.o
> $ arm-none-linux-gnueabi-vybrid-4.9.1/bin/arm-none-linux-gnueabi-as
> -mcpu=cortex-a5 -mimplicit-it=always foo.S -o foo.o
> 
> Both give 'objdump -S foo.o',
> foo.o:     file format elf32-littlearm
> 
> Disassembly of section .text:
> 
> 00000000 <foo>:
>    0:   2805            cmp     r0, #5
>    2:   bf14            ite     ne
>    4:   2106            movne   r1, #6
>    6:   2102            moveq   r1, #2
>    8:   4770            bx      lr
> 
> 0000000a <bar>:
>    a:   280a            cmp     r0, #10
>    c:   bf8c            ite     hi
>    e:   2103            movhi   r1, #3
>   10:   2107            movls   r1, #7
>   12:   bf08            it      eq
>   14:   210b            moveq   r1, #11
>   16:   4770            bx      lr
> 
> I think before the patch there would be 'it' values before each and
> every condition.  In fact, if you change 'bar' to,
> 
> bar:
>    cmp r0, #10
>    movhi r1,#3
>    movlo r1,#7
>    moveq r1,#11
>    bx lr
> 
> You get three 'IT' conditions as 'HI' and 'LO' are not opposite.  The
> patch seem to detect things that are the exact opposite.  The 'bar'
> above ends up with '11' in r1 if the value is zero, but it temporarily
> '7'.  The 2nd bar will only place 11 in r1.
> 
> Fwiw,
> Bill Pringlemeir.
> 
> Ref: https://wiki.ubuntu.com/ARM/Thumb2PortingHowto#Conditional_Execution

All this is about -mimplicit-it, which *is* documented, *is*
consistently present in common toolchains AFAICT and is and (as)
logcical (as it can be when dealing with backward compatibility of
command lines etc).

However, my problem is not with -mimplicit-it; it is with -mauto-it.

My gut feeling is that -mauto-it is a predecessor of -mimplicit-it.

Amicalement,
-- 
Albert.

  reply	other threads:[~2014-11-19 17:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 16:29 [U-Boot] Query on CONFIG_SYS_THUMB_BUILD Victor Ascroft
2014-11-13 20:53 ` Wolfgang Denk
2014-11-14  4:30   ` Victor Ascroft
2014-11-14  5:43     ` Wolfgang Denk
2014-11-14  6:10       ` Victor Ascroft
2014-11-14 14:01 ` Simon Glass
2014-11-14 15:26   ` Albert ARIBAUD
2014-11-15  1:56     ` Simon Glass
2014-11-15  5:26       ` Victor Ascroft
2014-11-15  5:38         ` Victor Ascroft
2014-11-15 12:30       ` Albert ARIBAUD
2014-11-15 22:10         ` Simon Glass
2014-11-16  7:50           ` Albert ARIBAUD
2014-11-17  6:28             ` Simon Glass
2014-11-18  3:32               ` Victor Ascroft
2014-11-18  4:59                 ` Simon Glass
2014-11-18 12:10   ` Stefan Agner
2014-11-18 16:07   ` Stefan Agner
2014-11-18 18:37     ` Stefan Agner
2014-11-19  6:42       ` Albert ARIBAUD
2014-11-19  6:58         ` Wolfgang Denk
2014-11-19 16:31           ` Bill Pringlemeir
2014-11-19 17:48             ` Albert ARIBAUD [this message]
2014-11-19 18:34               ` Bill Pringlemeir
2014-11-20 12:04                 ` Albert ARIBAUD
2014-11-20 16:34                   ` Bill Pringlemeir
2014-11-21 12:22                     ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141119184857.112c802d@lilith \
    --to=albert.u.boot@aribaud.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.