public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/44999]  New: "and r0, r0, #255" can be replace with uxtb in thumb2
@ 2010-07-20  7:59 carrot at google dot com
  2010-07-20  8:37 ` [Bug target/44999] " steven at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: carrot at google dot com @ 2010-07-20  7:59 UTC (permalink / raw)
  To: gcc-bugs

Compile the following code with options -march=armv7-a -mthumb -Os

int tp(int x, int y)
{
  return (x & 0xff) - (y & 0xffff);
}

GCC generates:

        uxth    r1, r1
        and     r0, r0, #255   //A
        subs    r0, r0, r1
        bx      lr

Instruction A is 32 bit, it can be replace by uxtb, a 16 bit equivalent
instruction.

A possible implementation is to call gen_thumb2_zero_extendqisi2_v6 in pattern
(define_expand "andsi3").


-- 
           Summary: "and r0, r0, #255" can be replace with uxtb in thumb2
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carrot at google dot com
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: arm-eabi


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/44999] "and r0, r0, #255" can be replace with uxtb in thumb2
  2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
@ 2010-07-20  8:37 ` steven at gcc dot gnu dot org
  2010-07-20 22:48 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2010-07-20  8:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from steven at gcc dot gnu dot org  2010-07-20 08:37 -------
Note, it's often helpful for us non-ARM-assembly-gurus to explain the pattern
you would like to have, instead of the mnemonic :-)


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-20 08:37:31
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/44999] "and r0, r0, #255" can be replace with uxtb in thumb2
  2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
  2010-07-20  8:37 ` [Bug target/44999] " steven at gcc dot gnu dot org
@ 2010-07-20 22:48 ` pinskia at gcc dot gnu dot org
  2010-07-24 19:47 ` rearnsha at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-07-20 22:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
           Keywords|                            |missed-optimization


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/44999] "and r0, r0, #255" can be replace with uxtb in thumb2
  2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
  2010-07-20  8:37 ` [Bug target/44999] " steven at gcc dot gnu dot org
  2010-07-20 22:48 ` pinskia at gcc dot gnu dot org
@ 2010-07-24 19:47 ` rearnsha at gcc dot gnu dot org
  2010-08-21 17:29 ` mikpe at it dot uu dot se
  2010-08-22  4:34 ` carrot at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu dot org @ 2010-07-24 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rearnsha at gcc dot gnu dot org  2010-07-24 19:47 -------


*** This bug has been marked as a duplicate of 43461 ***


-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/44999] "and r0, r0, #255" can be replace with uxtb in thumb2
  2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
                   ` (2 preceding siblings ...)
  2010-07-24 19:47 ` rearnsha at gcc dot gnu dot org
@ 2010-08-21 17:29 ` mikpe at it dot uu dot se
  2010-08-22  4:34 ` carrot at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mikpe at it dot uu dot se @ 2010-08-21 17:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mikpe at it dot uu dot se  2010-08-21 17:28 -------
Didn't Carrot's r163184 fix this PR and its dupe PR43461?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/44999] "and r0, r0, #255" can be replace with uxtb in thumb2
  2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
                   ` (3 preceding siblings ...)
  2010-08-21 17:29 ` mikpe at it dot uu dot se
@ 2010-08-22  4:34 ` carrot at google dot com
  4 siblings, 0 replies; 6+ messages in thread
From: carrot at google dot com @ 2010-08-22  4:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from carrot at google dot com  2010-08-22 04:34 -------
Both have been fixed. But I don't have the permission to close PR43461.(In
reply to comment #3)
> Didn't Carrot's r163184 fix this PR and its dupe PR43461?
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44999


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-22  4:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-20  7:59 [Bug target/44999] New: "and r0, r0, #255" can be replace with uxtb in thumb2 carrot at google dot com
2010-07-20  8:37 ` [Bug target/44999] " steven at gcc dot gnu dot org
2010-07-20 22:48 ` pinskia at gcc dot gnu dot org
2010-07-24 19:47 ` rearnsha at gcc dot gnu dot org
2010-08-21 17:29 ` mikpe at it dot uu dot se
2010-08-22  4:34 ` carrot at google dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).