public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
@ 2011-09-11 17:47 gjl at gcc dot gnu.org
  2011-09-11 17:47 ` [Bug target/50358] " gjl at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-11 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50358
           Summary: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on
                    the enhanced core
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
                CC: eric.weddington@atmel.com
            Target: avr


avr-gcc 4.6.1 -Os -mmcu=atmega8 translates the following test function

int madd_x (int i, char a, char b)
{
    return i + a*b;
}

to

    muls r22,r20     ;  10    mulqihi3
    movw r20,r0
    clr r1
    add r20,r24     ;  11    *addhi3/1
    adc r21,r25
    movw r24,r20     ;  31    *movhi/1

where it could be

    muls r22,r20     ;  *maddqihi4/1
    add r24,r0
    adc r25,r1
    clr r1

instead i.e. the addition can be done in place and the product need not to be
moved out of R0, reducing code size and register pressure and increasing speed.


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
@ 2011-09-11 17:47 ` gjl at gcc dot gnu.org
  2011-09-11 17:55 ` gjl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-11 17:47 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
  2011-09-11 17:47 ` [Bug target/50358] " gjl at gcc dot gnu.org
@ 2011-09-11 17:55 ` gjl at gcc dot gnu.org
  2011-09-11 18:29 ` gjl at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-11 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011-09-11
         AssignedTo|unassigned at gcc dot       |gjl at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-11 17:46:14 UTC ---
Created attachment 25241
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25241
madd.c

Just some test cases.


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
  2011-09-11 17:47 ` [Bug target/50358] " gjl at gcc dot gnu.org
  2011-09-11 17:55 ` gjl at gcc dot gnu.org
@ 2011-09-11 18:29 ` gjl at gcc dot gnu.org
  2011-09-12 19:18 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-11 18:29 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-09-11 18:29 ` gjl at gcc dot gnu.org
@ 2011-09-12 19:18 ` gjl at gcc dot gnu.org
  2011-09-13  9:28 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-12 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #25241|0                           |1
        is obsolete|                            |

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-12 19:16:00 UTC ---
Created attachment 25251
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25251
madd.c


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-09-12 19:18 ` gjl at gcc dot gnu.org
@ 2011-09-13  9:28 ` gjl at gcc dot gnu.org
  2011-09-16 19:06 ` gjl at gcc dot gnu.org
  2011-09-16 19:13 ` gjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-13  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-13 09:23:40 UTC ---
Author: gjl
Date: Tue Sep 13 09:23:36 2011
New Revision: 178806

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178806
Log:

    PR target/50358
    * config/avr/predicates.md (const_1_to_6_operand): New predicate.
    * config/avr/avr.md: (extend_s): New code attribute.
    (mul_r_d): New code attribute.
    (*maddqihi4, *umaddqihi4): New insns.
    (*msubqihi4, *umsubqihi4): New insns.
    (*usmaddqihi4, *sumaddqihi4): New insns.
    (*usmsubqihi4, *susubdqihi4): New insns.
    (*umaddqihi4.uconst, *maddqihi4.sconst): New insn-and-splits.
    (*umsubqihi4.uconst, *msubqihi4.sconst): New insn-and-splits.
    (*umsubqihi4.uconst.ashift): New insn-and-split.
    (*msubqihi4.sconst.ashift): New insn-and-split.
    (*sumaddqihi4.uconst): New insn-and-split.
    (*sumsubqihi4.uconst): New insn-and-split.
    * config/avr/avr.c (avr_rtx_costs): Report costs of above in case
    PLUS:HI and MINUS:HI.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.md
    trunk/gcc/config/avr/predicates.md


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-09-13  9:28 ` gjl at gcc dot gnu.org
@ 2011-09-16 19:06 ` gjl at gcc dot gnu.org
  2011-09-16 19:13 ` gjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-16 19:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-16 18:27:16 UTC ---
Author: gjl
Date: Fri Sep 16 18:27:10 2011
New Revision: 178912

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=178912
Log:
    PR target/50358
    * config/avr/avr.md (*ashiftqihi2.signx.1): New insn.
    (*maddqi4, *maddqi4.const): New insns.
    (*msubqi4, *msubqi4.const): New insns.
    * config/avr/avr.c (avr_rtx_costs): Record costs of above in cases
    PLUS:QI and MINUS:QI.  Increase costs of multiply-add/-sub for
    HImode by 1 in the case of multiplying with a CONST_INT.
    Record cost of *ashiftqihi2.signx.1 in case ASHIFT:QI.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.md


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

* [Bug target/50358] AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core
  2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-09-16 19:06 ` gjl at gcc dot gnu.org
@ 2011-09-16 19:13 ` gjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2011-09-16 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-09-16 18:33:59 UTC ---
Resolved for 4.7.0 milestone.


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

end of thread, other threads:[~2011-09-16 18:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11 17:47 [Bug target/50358] New: AVR: Implement [u]maddqihi4 [u]msubqihi4 patterns on the enhanced core gjl at gcc dot gnu.org
2011-09-11 17:47 ` [Bug target/50358] " gjl at gcc dot gnu.org
2011-09-11 17:55 ` gjl at gcc dot gnu.org
2011-09-11 18:29 ` gjl at gcc dot gnu.org
2011-09-12 19:18 ` gjl at gcc dot gnu.org
2011-09-13  9:28 ` gjl at gcc dot gnu.org
2011-09-16 19:06 ` gjl at gcc dot gnu.org
2011-09-16 19:13 ` gjl at gcc dot gnu.org

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).