public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52261] New: [avr] Add support for AVR Xmega cores
@ 2012-02-15 12:33 gjl at gcc dot gnu.org
  2012-02-15 12:36 ` [Bug target/52261] " gjl at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-15 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52261
           Summary: [avr] Add support for AVR Xmega cores
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: gjl@gcc.gnu.org
                CC: eric.weddington@atmel.com
            Target: avr


Xmega core are special with respect to I-flag instruction and writing SPL (low
byte of stack pointer SP):

In old cores, setting I-flag by means of SEI/RETI/OUT has a latency of 1
instruction

In Xmega cores, setting I-flag by means of SEI/RETI/OUT has a latency of 0
instructions.

This, writing to SP by a sequence like

IN  tmp_reg, SREG
CLI
OUT SP_H, %B1
OUT SREG, tmp_reg
OUT SP_L, %A1

is no move correct because write of SP with that sequence is no more atomic.

Xmega's OUT SP_L,* inhibits IRQs for 4 instructions so that the following
sequence can be used instead to write to SP:

OUT SP_L, %A1
OUT SP_H, %B1


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
@ 2012-02-15 12:36 ` gjl at gcc dot gnu.org
  2012-02-15 13:16 ` gjl at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-15 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-15
   Target Milestone|---                         |4.7.0
     Ever Confirmed|0                           |1

--- Comment #1 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-15 12:35:38 UTC ---
For Xmega cores and MCUs supported by binutils, see src/gas/config/tc-avr.c

http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c?content-type=text/x-cvsweb-markup&cvsroot=src


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
  2012-02-15 12:36 ` [Bug target/52261] " gjl at gcc dot gnu.org
@ 2012-02-15 13:16 ` gjl at gcc dot gnu.org
  2012-02-20  4:33 ` fbi.sr at gmx dot de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-15 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-15 13:16:01 UTC ---
Author: gjl
Date: Wed Feb 15 13:15:56 2012
New Revision: 184269

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184269
Log:
libgcc/
    PR target/52261
    * config/avr/lib1funcs.S (__prologue_saves__): Handle AVR_XMEGA
    (__epilogue_restores__): Ditto.

gcc/
    PR target/52261
    * config/avr/avr-devices.c (avr_arch_types): Add avrxmega2,
    avrxmega4, avrxmega5, avrxmega6, avrxmega7.
    Rewrite initializers for .macro.
    * config/avr/avr-mcus.def (AVR_MCU): Add known MCUs:
    avrxmega2: atxmega16a4, atxmega16d4, atxmega16x1, atxmega32a4
    atxmega32d4, atxmega32x1.
    avrxmega4: atxmega64a3, atxmega64d3.
    avrxmega5: atxmega64a1, atxmega64a1u.
    avrxmega6: atxmega128a3, atxmega128d3, atxmega192a3, atxmega192d3,
    atxmega256a3, atxmega256a3b, atxmega256a3bu, atxmega256d3.
    avrxmega7: atxmega128a1, atxmega128a1u.

    * config/avr/multilib.h: Regenerate.
    * config/avr/t-multilib: Regenerate.
    * config/avr/avr-tables.opt: Regenerate.

    * config/avr/avr.h (enum avr_arch): Add: ARCH_AVRXMEGA2,
    ARCH_AVRXMEGA4,    ARCH_AVRXMEGA5, ARCH_AVRXMEGA6, ARCH_AVRXMEGA7.
    (struct base_arch_s): Rename reserved to xmega_p.
    Rename reserved2 to have_rampd.
    (AVR_XMEGA): New define.
    (AVR_HAVE_RAMPD, AVR_HAVE_RAMPX, AVR_HAVE_RAMPY): New defines.
    (AVR_HAVE_RAMPZ): Change definition to fit xmega.

    * config/avr/predicates.md (io_address_operand): Take into
    account SFR offset.
    (low_io_address_operand): Ditto.
    (high_io_address_operand): Ditto.

    * config/avr/avr.md (isa): Add alternatives no_xmega, xmega.
    (enabled, movhi_sp_r): Use them.

    * config/avr/avr-c.c (avr_cpu_cpp_builtins): Use
    cpp_define_formatted to built-in define __AVR_ARCH__.
    (__AVR_XMEGA__): New built-in define.
    (__AVR_HAVE_RAMPD__): New built-in define.
    (__AVR_HAVE_RAMPX__): New built-in define.
    (__AVR_HAVE_RAMPY__): New built-in define.
    (__AVR_HAVE_RAMPZ__): Change condition when to built-in define it.

    * config/avr/avr.c (avr_addr_t): Add ccp, rampd, rampx, rampy.
    (avr_option_override): Initialize them.
    (sreg_rtx, rampd_rtx, rampx_rtx, rampy_rtx): New GTY rtx.
    (avr_init_expanders): Initialize them. No more block several calls.
    (emit_push_sfr): New static function.
    (avr_prologue_setup_frame): Use it to push SREG, RAMPD/X/Y/Z as needed.
    Handle AVR_XMEGA.
    (expand_epilogue): Handle AVR_XMEGA. Pop RAMPD/X/Y/Z as needed.
    (avr_print_operand): Print addreeses as symbols for
    RAMPX, RAMPY, RAMPD, CCP.
    (output_movhi): Handle AVR_XMEGA when writing to SP.
    (avr_out_movhi_mr_r_xmega): New static function.
    (out_movhi_mr_r): Forward to avr_out_movhi_mr_r_xmega for AVR_XMEGA.
    (avr_file_start): Print symbol defines for __RAMPX__,  __RAMPY__,
    __RAMPD__,  __CCP__ as needed.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-c.c
    trunk/gcc/config/avr/avr-devices.c
    trunk/gcc/config/avr/avr-mcus.def
    trunk/gcc/config/avr/avr-tables.opt
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.h
    trunk/gcc/config/avr/avr.md
    trunk/gcc/config/avr/multilib.h
    trunk/gcc/config/avr/predicates.md
    trunk/gcc/config/avr/t-multilib
    trunk/libgcc/ChangeLog
    trunk/libgcc/config/avr/lib1funcs.S


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
  2012-02-15 12:36 ` [Bug target/52261] " gjl at gcc dot gnu.org
  2012-02-15 13:16 ` gjl at gcc dot gnu.org
@ 2012-02-20  4:33 ` fbi.sr at gmx dot de
  2012-02-20 11:32 ` gjl at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fbi.sr at gmx dot de @ 2012-02-20  4:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Stefan Reichardt <fbi.sr at gmx dot de> 2012-02-20 02:01:30 UTC ---
Could you add support for the few new devices with USB Support aswell? example
Xmega32A4U.

For the moment, i am using your code with xmega128a1 and i see no problems.

Thanks alot!


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-02-20  4:33 ` fbi.sr at gmx dot de
@ 2012-02-20 11:32 ` gjl at gcc dot gnu.org
  2012-02-22  2:44 ` fbi.sr at gmx dot de
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-20 11:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-20 11:17:58 UTC ---
(In reply to comment #3)
> Could you add support for the few new devices with USB Support aswell? example
> Xmega32A4U.

I am not sure if that would help much because there is no support in binutils.

http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-avr.c?rev=1.79&content-type=text/x-cvsweb-markup&cvsroot=src

Con you compile with -mmcu=avrxmega2 -D__AVR_XMEGA32A4U__ and then assemble and
link appropriately?


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-02-20 11:32 ` gjl at gcc dot gnu.org
@ 2012-02-22  2:44 ` fbi.sr at gmx dot de
  2012-02-23 20:13 ` gjl at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fbi.sr at gmx dot de @ 2012-02-22  2:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Stefan Reichardt <fbi.sr at gmx dot de> 2012-02-22 01:38:52 UTC ---
Its no problem to compile and link it that way but i dont have that device so
cant test it.

I would make a patch myself and post it here and on binutils, if i knew that
this would only involve copying some lines from the devices without USB
support. Some devices like xmega128A1U are already there so i suppose all
functionality for the new USB devices is already in the code.

Maybe you or Eric could give a short statement about this?

Stefan


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-02-22  2:44 ` fbi.sr at gmx dot de
@ 2012-02-23 20:13 ` gjl at gcc dot gnu.org
  2012-02-24 16:29 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-23 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-23 19:26:06 UTC ---
Author: gjl
Date: Thu Feb 23 19:26:00 2012
New Revision: 184522

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184522
Log:
    PR target/52261
    * config/avr/lib1funcs.S (__AVR__XMEGA__): Fix tippo to __AVR_XMEGA__.


Modified:
    trunk/libgcc/ChangeLog
    trunk/libgcc/config/avr/lib1funcs.S


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-02-23 20:13 ` gjl at gcc dot gnu.org
@ 2012-02-24 16:29 ` gjl at gcc dot gnu.org
  2012-02-28  8:53 ` gjl at gcc dot gnu.org
  2012-02-28  9:14 ` gjl at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-24 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-24 16:26:46 UTC ---
Author: gjl
Date: Fri Feb 24 16:26:35 2012
New Revision: 184559

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184559
Log:
    PR target/52261
    * config/avr/avr.c (avr_out_movhi_mr_r_xmega): Use base
    to test for unusedness in st X addressing.


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


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-02-24 16:29 ` gjl at gcc dot gnu.org
@ 2012-02-28  8:53 ` gjl at gcc dot gnu.org
  2012-02-28  9:14 ` gjl at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-28  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-28 08:44:15 UTC ---
Author: gjl
Date: Tue Feb 28 08:44:08 2012
New Revision: 184614

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184614
Log:
    PR target/49868
    PR target/52261
    * doc/extend.texi (AVR Named Address Spaces): No more try to fix
    address spaces located outside of device flash.
    * config/avr/avr.h (base_arch_s): Remove field n_segments.
    (mcu_type_s): Add field n_flash.
    * config/avr/avr-devices.c (avr_arch_types): Remove .n_segments.
    Set .have_elpm and .have_elpmx to 1 for avrxmega4 and avrxmega5.
    (AVR_MCU): Add N_FLASH argument.
    * config/avr/avr-mcus.def (AVR_MCU): Add initializer for .n_flash.
    * config/avr/avr-c.c (avr_cpu_cpp_builtins): Only define built-in
    macro __FLASH<n> if that address space makes sense for the device.
    * config/avr/avr.c (avr_out_lpm): Don't try to fix address spaces
    outside of target flash.
    (avr_asm_named_section): Ditto.
    (avr_asm_select_section): Ditto.
    (avr_addr_space_convert): Ditto.
    (avr_emit_movmemhi): Ditto.
    (avr_nonconst_pointer_addrspace, avr_pgm_check_var_decl): Error if
    address space is outside of device flash.
    (avr_insert_attributes): Ditto.
    (avr_xload_libgcc_p): Use avr_current_device->n_flash instead of
    avr_current_arch->n_segments.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-c.c
    trunk/gcc/config/avr/avr-devices.c
    trunk/gcc/config/avr/avr-mcus.def
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.h
    trunk/gcc/doc/extend.texi


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

* [Bug target/52261] [avr] Add support for AVR Xmega cores
  2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-02-28  8:53 ` gjl at gcc dot gnu.org
@ 2012-02-28  9:14 ` gjl at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: gjl at gcc dot gnu.org @ 2012-02-28  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2012-02-28 09:11:29 UTC ---
Closed: Basic XMEGA support seems to be complete now.


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

end of thread, other threads:[~2012-02-28  9:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-15 12:33 [Bug target/52261] New: [avr] Add support for AVR Xmega cores gjl at gcc dot gnu.org
2012-02-15 12:36 ` [Bug target/52261] " gjl at gcc dot gnu.org
2012-02-15 13:16 ` gjl at gcc dot gnu.org
2012-02-20  4:33 ` fbi.sr at gmx dot de
2012-02-20 11:32 ` gjl at gcc dot gnu.org
2012-02-22  2:44 ` fbi.sr at gmx dot de
2012-02-23 20:13 ` gjl at gcc dot gnu.org
2012-02-24 16:29 ` gjl at gcc dot gnu.org
2012-02-28  8:53 ` gjl at gcc dot gnu.org
2012-02-28  9:14 ` 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).