From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23165 invoked by alias); 13 Feb 2013 10:05:47 -0000 Received: (qmail 23150 invoked by uid 22791); 13 Feb 2013 10:05:46 -0000 X-SWARE-Spam-Status: No, hits=-0.0 required=5.0 tests=AWL,BAYES_99,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from mo-p05-ob.rzone.de (HELO mo-p05-ob.rzone.de) (81.169.146.180) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Feb 2013 10:05:34 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo05 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by smtp.strato.de (jorabe mo18) (RZmta 31.16 AUTH) with ESMTPA id 50367dp1D9jpEs ; Wed, 13 Feb 2013 11:05:28 +0100 (CET) Message-ID: <511B6568.2090509@gcc.gnu.org> Date: Wed, 13 Feb 2013 10:05:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Denis Chertykov , Eric Weddington Subject: Re: [Patch,avr]: Add more devices take #2: 1/2 References: <511A60AA.7080400@gjlay.de> In-Reply-To: <511A60AA.7080400@gjlay.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00576.txt.bz2 Let me drop this, I was thinking too complicated. src/gas/config/tc-avr.c reads: static struct mcu_type_s mcu_types[] = { {"avr1", AVR_ISA_AVR1, bfd_mach_avr1}, /* TODO: insruction set for avr2 architecture should be AVR_ISA_AVR2, but set to AVR_ISA_AVR25 for some following version of GCC (from 4.3) for backward compatibility. */ {"avr2", AVR_ISA_AVR25, bfd_mach_avr2}, {"avr25", AVR_ISA_AVR25, bfd_mach_avr25}, /* TODO: insruction set for avr3 architecture should be AVR_ISA_AVR3, but set to AVR_ISA_AVR3_ALL for some following version of GCC (from 4.3) for backward compatibility. */ {"avr3", AVR_ISA_AVR3_ALL, bfd_mach_avr3}, {"avr31", AVR_ISA_AVR31, bfd_mach_avr31}, {"avr35", AVR_ISA_AVR35, bfd_mach_avr35}, {"avr4", AVR_ISA_AVR4, bfd_mach_avr4}, /* TODO: insruction set for avr5 architecture should be AVR_ISA_AVR5, but set to AVR_ISA_AVR51 for some following version of GCC (from 4.3) for backward compatibility. */ {"avr5", AVR_ISA_AVR51, bfd_mach_avr5}, {"avr51", AVR_ISA_AVR51, bfd_mach_avr51}, {"avr6", AVR_ISA_AVR6, bfd_mach_avr6}, This means that cores liek avr31, avr35 etc. are supported by binutils and there is no more the need for avr-gcc to do mappings like avr31 -> avr3. It appears that avr-gcc implemented these mappings to overcome missing binutils support for specific cores, and in turn binutils arranged for that kludge... This means that avr_arch_t need not to be extended to hold the arch mapping for gas calls and the gas call can use the core name from avr_arch_t. I broke the patch into two parts: 1/2: New devices 2/2: Map device to core to disentangle gcc/binutils interdependencies. Okay for trunk and 4.7 backport? Johann * avr/avr-mcus.def (ata5272, ata5505, attiny1634, ata6285) (ata6286, atmega8a, atmega48pa, ata5790, ata5790n, ata5795) (atmega164pa, atmega165pa, atmega168pa, atmega16hva, atmega16hvb) (atmega16hvbrevb, atmega16m1, atmega16u4, atmega26hvg, atmega32a) (atmega32a, atmega3250pa, atmega3290pa, atmega32c1, atmega32m1) (atmega32u4, atmega32u6, atmega64a, atmega6490a, atmega6490p) (atmega64c1, atmega64m1, atmega64rfa2, atmega64rfr2, atmega32hvb) (atmega32hvbrevb, atmega16hva2, atmega48hvf, at90pwm161) (atmega128a, atmega1284, atmxt112sl, atmxt224, atmxt224e) (atmxt336s, atxmega16a4u, atxmega16c4, atxmega32a4u, atxmega32c4) (atxmega32e5, atxmega64a3u, atxmega64a4u, atxmega64b1, atxmega64b3) (atxmega64c3, atxmega64d4, atxmega128a3u, atxmega128b1) (atxmega128b3, atxmega128c3, atxmega128d4, atmxt540s, atmxt540sreva) (atxmega192a3u, atxmega192c3, atxmega256a3u, atxmega256c3) (atxmega384c3, atxmega384d3, atxmega128a4u): New AVR_MCU. (avrxmega6): Increase max flash segments from 5 to 6. * config/avr/t-multilib: Regenerate. * config/avr/avr-tables.opt: Regenerate. * doc/avr-mmcu.texi: Regenerate. Georg-Johann Lay wrote: > This patch adds more devices to avr-mcus.def and regenerates depending files. > > There is a new spec function that is the worker for ASM_SPEC and that > transforms -mmcu=device to -mmcu=arch for avr-as. > > This transformation was already performed for avr25, avr31, avr35 and avr51 and > is now performed for all devices so that avr-as only need to support -mmcu=arch. > > Rationale is to reduce tool dependencies: as need not to know what device it > compiles for, the core is enough. The only cases where the core arch is no > enough is > > - Tell whether the device suffers from skip silicon bug > - Tell whether the device supporte DES, XCH, LAS, LAC, LAT instruction. > > The first case is handled by device_to_as that issues -mno-skip-bug as needed. > > The second case is not handled. Binutils is agnostic w.r.t. availability of > these instructions if the exact device is supplied. If binutils will wver be > extended to know about these instructions, the preferred way is as described in > > http://sourceware.org/PR15043 > > i.e. add new ISA options to binutils. That way, tools dependencies can be > disentangled and binutils need not to be changed for every new device. > > Ok for trunk? > > Even though this is new feature, I'd propose to backport the additions to > avr-mcus.def to 4.7. The changes to avr-mcus.def are obvious enough, IMO. > > Okay to backport avr-mcus.def and docs part to 4.7 then? > > Johann > > * config/avr/avr-arch.h (avr_arch_t) : New component. > * config/avr/avr-devices.c: Initialize it. > * config/avr/avr.h (device_to_arch): Rename to device_to_ld. > (avr_device_to_arch): Rename to avr_device_to_ld. > (avr_device_to_as): New prototype. > (EXTRA_SPEC_FUNCTIONS): Add device_to_as. > (ASM_SPEC): Use device_to_as to get -mmcu= and -mno-skip-bug=. > * config/avr/driver-avr.c (avr_device_to_as): New. > (avr_device_to_arch): Rename to avr_device_to_ld. > * avr/avr-mcus.def (ata5272, ata5505, attiny1634, ata6285) > (ata6286, atmega8a, atmega48pa, ata5790, ata5790n, ata5795) > (atmega164pa, atmega165pa, atmega168pa, atmega16hva, atmega16hvb) > (atmega16hvbrevb, atmega16m1, atmega16u4, atmega26hvg, atmega32a) > (atmega32a, atmega3250pa, atmega3290pa, atmega32c1, atmega32m1) > (atmega32u4, atmega32u6, atmega64a, atmega6490a, atmega6490p) > (atmega64c1, atmega64m1, atmega64rfa2, atmega64rfr2, atmega32hvb) > (atmega32hvbrevb, atmega16hva2, atmega48hvf, at90pwm161) > (atmega128a, atmega1284, atmxt112sl, atmxt224, atmxt224e) > (atmxt336s, atxmega16a4u, atxmega16c4, atxmega32a4u, atxmega32c4) > (atxmega32e5, atxmega64a3u, atxmega64a4u, atxmega64b1, atxmega64b3) > (atxmega64c3, atxmega64d4, atxmega128a3u, atxmega128b1) > (atxmega128b3, atxmega128c3, atxmega128d4, atmxt540s, atmxt540sreva) > (atxmega192a3u, atxmega192c3, atxmega256a3u, atxmega256c3) > (atxmega384c3, atxmega384d3, atxmega128a4u): New AVR_MCU. > (avrxmega6): Increase max flash segments from 5 to 6. > * config/avr/t-multilib: Regenerate. > * config/avr/avr-tables.opt: Regenerate. > * doc/avr-mmcu.texi: Regenerate.