summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/Makefile.in2
-rw-r--r--gcc/config/avr/avr-devices.c45
-rw-r--r--gcc/config/avr/avr.h8
-rw-r--r--gcc/config/avr/gen-avr-mmcu-texi.c73
-rw-r--r--gcc/config/avr/t-avr20
-rw-r--r--gcc/doc/avr-mmcu.texi74
-rw-r--r--gcc/doc/invoke.texi83
8 files changed, 235 insertions, 83 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 733e8548cec..a140b83847b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+2012-05-08 Georg-Johann Lay <avr@gjlay.de>
+
+ * Makefile.in (TEXI_GCC_FILES): Add avr-mmcu.texi.
+
+ * doc/avr-mmcu.texi: New auto-generated file.
+ * doc/invoke.texi (AVR Options): Include avr-mmcu.texi in order
+ to document all valid -mmcu= arguments.
+
+ * config/avr/avr.h (arch_info_s): New struct definition.
+ * config/avr/avr-devices.c (avr_texinfo): New variable.
+ * config/avr/gen-avr-mmcu-texi.c: New file.
+ * config/avr/t-avr: New rules and dependencies to build avr-mmcu.texi.
+
2012-05-08 Dehao Chen <dehao@google.com>
* predict.c (find_qualified_ssa_name): New
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index ec27f88c4bd..792d002dcc4 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -4216,7 +4216,7 @@ TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
standards.texi invoke.texi extend.texi md.texi objc.texi \
gcov.texi trouble.texi bugreport.texi service.texi \
contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \
- fdl.texi contrib.texi cppenv.texi cppopts.texi \
+ fdl.texi contrib.texi cppenv.texi cppopts.texi avr-mmcu.texi \
implement-c.texi implement-cxx.texi arm-neon-intrinsics.texi
# we explicitly use $(srcdir)/doc/tm.texi here to avoid confusion with
diff --git a/gcc/config/avr/avr-devices.c b/gcc/config/avr/avr-devices.c
index 41688c82553..47cfefd8612 100644
--- a/gcc/config/avr/avr-devices.c
+++ b/gcc/config/avr/avr-devices.c
@@ -55,6 +55,51 @@ avr_arch_types[] =
{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 0x2000, 0, "107", "avrxmega7" }
};
+const struct arch_info_s
+avr_texinfo[] =
+{
+ { ARCH_AVR1,
+ "This ISA is implemented by the minimal AVR core and supported "
+ "for assembler only." },
+ { ARCH_AVR2,
+ "``Classic'' devices with up to 8@tie{}KiB of program memory." },
+ { ARCH_AVR25,
+ "``Classic'' devices with up to 8@tie{}KiB of program memory and with "
+ "the @code{MOVW} instruction." },
+ { ARCH_AVR3,
+ "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
+ " program memory." },
+ { ARCH_AVR31,
+ "``Classic'' devices with 128@tie{}KiB of program memory." },
+ { ARCH_AVR35,
+ "``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
+ "program memory and with the @code{MOVW} instruction." },
+ { ARCH_AVR4,
+ "``Enhanced'' devices with up to 8@tie{}KiB of program memory." },
+ { ARCH_AVR5,
+ "``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of "
+ "program memory." },
+ { ARCH_AVR51,
+ "``Enhanced'' devices with 128@tie{}KiB of program memory." },
+ { ARCH_AVR6,
+ "``Enhanced'' devices with 3-byte PC, i.e.@: with more than 128@tie{}KiB "
+ "of program memory." },
+ { ARCH_AVRXMEGA2,
+ "``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB "
+ "of program memory." },
+ { ARCH_AVRXMEGA4,
+ "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB "
+ "of program memory." },
+ { ARCH_AVRXMEGA5,
+ "``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB "
+ "of program memory and more than 64@tie{}KiB of RAM." },
+ { ARCH_AVRXMEGA6,
+ "``XMEGA'' devices with more than 128@tie{}KiB of program memory." },
+ { ARCH_AVRXMEGA7,
+ "``XMEGA'' devices with more than 128@tie{}KiB of program memory "
+ "and more than 64@tie{}KiB of RAM." }
+};
+
const struct mcu_type_s avr_mcu_types[] = {
#define AVR_MCU(NAME,ARCH,MACRO,SHORT_SP,ERRATA_SKIP,DATA_SEC,N_FLASH,LIB_NAME)\
{ NAME, ARCH, MACRO, SHORT_SP, ERRATA_SKIP, DATA_SEC, N_FLASH, LIB_NAME },
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 591e21dd5b9..ef98a911b9d 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -133,6 +133,14 @@ struct mcu_type_s {
const char *const library_name;
};
+struct arch_info_s {
+ /* Architecture ID. */
+ enum avr_arch arch;
+
+ /* textinfo source to describe the archtiecture. */
+ const char *texinfo;
+};
+
/* Preprocessor macros to define depending on MCU type. */
extern const char *avr_extra_arch_macro;
extern const struct base_arch_s *avr_current_arch;
diff --git a/gcc/config/avr/gen-avr-mmcu-texi.c b/gcc/config/avr/gen-avr-mmcu-texi.c
new file mode 100644
index 00000000000..0bbd3a30b71
--- /dev/null
+++ b/gcc/config/avr/gen-avr-mmcu-texi.c
@@ -0,0 +1,73 @@
+/* Copyright (C) 2012
+ Free Software Foundation, Inc.
+ Contributed by Georg-Johann Lay (avr@gjlay.de)
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ GCC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#include "avr-devices.c"
+
+int main (void)
+{
+ enum avr_arch arch = 0;
+ unsigned i, first = 1;
+ const struct mcu_type_s *mcu;
+
+ printf ("@c Copyright (C) 2012 Free Software Foundation, Inc.\n");
+ printf ("@c This is part of the GCC manual.\n");
+ printf ("@c For copying conditions, see the file "
+ "gcc/doc/include/fdl.texi.\n\n");
+
+ printf ("@c This file is generated automatically using\n");
+ printf ("@c gcc/config/avr/gen-avr-mmcu-texi.c from:\n");
+ printf ("@c gcc/config/avr/avr-devices.c\n");
+ printf ("@c gcc/config/avr/avr-mcus.def\n\n");
+
+ printf ("@c Please do not edit manually.\n\n");
+
+ printf ("@table @code\n\n");
+
+ for (mcu = avr_mcu_types; mcu->name; mcu++)
+ {
+ if (mcu->macro == NULL)
+ {
+ arch = mcu->arch;
+
+ for (i = 0; i < sizeof (avr_texinfo) / sizeof (*avr_texinfo); i++)
+ {
+ if (arch == avr_texinfo[i].arch)
+ {
+ if (mcu != avr_mcu_types)
+ printf (".\n\n");
+ printf ("@item %s\n%s\n", mcu->name, avr_texinfo[i].texinfo);
+ printf ("@*@var{mcu}@tie{}=");
+ first = 1;
+ break;
+ }
+ }
+ }
+ else if (arch == (enum avr_arch) mcu->arch)
+ {
+ printf ("%s @code{%s}", first ? "" : ",", mcu->name);
+ first = 0;
+ }
+ }
+
+ printf (".\n\n");
+ printf ("@end table\n");
+
+ return EXIT_SUCCESS;
+}
diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr
index 99638333204..24cdd92590a 100644
--- a/gcc/config/avr/t-avr
+++ b/gcc/config/avr/t-avr
@@ -43,6 +43,26 @@ AVR_MCUS = $(srcdir)/config/avr/avr-mcus.def
$(srcdir)/config/avr/avr-tables.opt: $(srcdir)/config/avr/genopt.sh $(AVR_MCUS)
$(SHELL) $< $(AVR_MCUS) > $@
+gen-avr-mmcu-texi$(build_exeext): $(srcdir)/config/avr/gen-avr-mmcu-texi.c \
+ $(TM_H) $(AVR_MCUS) $(srcdir)/config/avr/avr-devices.c
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@
+
+avr-devices.o: s-avr-mmcu-texi
+
+s-avr-mmcu-texi: gen-avr-mmcu-texi$(build_exeext)
+ $(RUN_GEN) $< | sed -e 's:\r::g' > avr-mmcu.texi
+ @if cmp -s $(srcdir)/doc/avr-mmcu.texi avr-mmcu.texi; then \
+ $(STAMP) $@; \
+ else \
+ echo >&2 ; \
+ echo "***" >&2 ; \
+ echo "*** Verify that you have permission to grant a" >&2 ; \
+ echo "*** GFDL license for all new text in" >&2 ; \
+ echo "*** avr-mmcu.texi, then copy it to $(srcdir)/doc/avr-mmcu.texi" >&2 ; \
+ echo "***" >&2 ; \
+ false; \
+ fi
+
# MULTILIB_OPTIONS
# MULTILIB_DIRNAMES
# MULTILIB_EXCEPTIONS
diff --git a/gcc/doc/avr-mmcu.texi b/gcc/doc/avr-mmcu.texi
new file mode 100644
index 00000000000..ee5f2fa34a2
--- /dev/null
+++ b/gcc/doc/avr-mmcu.texi
@@ -0,0 +1,74 @@
+@c Copyright (C) 2012 Free Software Foundation, Inc.
+@c This is part of the GCC manual.
+@c For copying conditions, see the file gcc/doc/include/fdl.texi.
+
+@c This file is generated automatically using
+@c gcc/config/avr/gen-avr-mmcu-texi.c from:
+@c gcc/config/avr/avr-devices.c
+@c gcc/config/avr/avr-mcus.def
+
+@c Please do not edit manually.
+
+@table @code
+
+@item avr2
+``Classic'' devices with up to 8@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{at90s2313}, @code{at90s2323}, @code{at90s2333}, @code{at90s2343}, @code{attiny22}, @code{attiny26}, @code{at90s4414}, @code{at90s4433}, @code{at90s4434}, @code{at90s8515}, @code{at90c8534}, @code{at90s8535}.
+
+@item avr25
+``Classic'' devices with up to 8@tie{}KiB of program memory and with the @code{MOVW} instruction.
+@*@var{mcu}@tie{}= @code{ata6289}, @code{attiny13}, @code{attiny13a}, @code{attiny2313}, @code{attiny2313a}, @code{attiny24}, @code{attiny24a}, @code{attiny4313}, @code{attiny44}, @code{attiny44a}, @code{attiny84}, @code{attiny84a}, @code{attiny25}, @code{attiny45}, @code{attiny85}, @code{attiny261}, @code{attiny261a}, @code{attiny461}, @code{attiny461a}, @code{attiny861}, @code{attiny861a}, @code{attiny43u}, @code{attiny87}, @code{attiny48}, @code{attiny88}, @code{at86rf401}.
+
+@item avr3
+``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{at43usb355}, @code{at76c711}.
+
+@item avr31
+``Classic'' devices with 128@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atmega103}, @code{at43usb320}.
+
+@item avr35
+``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory and with the @code{MOVW} instruction.
+@*@var{mcu}@tie{}= @code{at90usb82}, @code{at90usb162}, @code{atmega8u2}, @code{atmega16u2}, @code{atmega32u2}, @code{attiny167}.
+
+@item avr4
+``Enhanced'' devices with up to 8@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atmega8}, @code{atmega48}, @code{atmega48a}, @code{atmega48p}, @code{atmega88}, @code{atmega88a}, @code{atmega88p}, @code{atmega88pa}, @code{atmega8515}, @code{atmega8535}, @code{atmega8hva}, @code{at90pwm1}, @code{at90pwm2}, @code{at90pwm2b}, @code{at90pwm3}, @code{at90pwm3b}, @code{at90pwm81}.
+
+@item avr5
+``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atmega16}, @code{atmega16a}, @code{atmega161}, @code{atmega162}, @code{atmega163}, @code{atmega164a}, @code{atmega164p}, @code{atmega165}, @code{atmega165a}, @code{atmega165p}, @code{atmega168}, @code{atmega168a}, @code{atmega168p}, @code{atmega169}, @code{atmega169a}, @code{atmega169p}, @code{atmega169pa}, @code{atmega32}, @code{atmega323}, @code{atmega324a}, @code{atmega324p}, @code{atmega324pa}, @code{atmega325}, @code{atmega325a}, @code{atmega325p}, @code{atmega3250}, @code{atmega3250a}, @code{atmega3250p}, @code{atmega328}, @code{atmega328p}, @code{atmega329}, @code{atmega329a}, @code{atmega329p}, @code{atmega329pa}, @code{atmega3290}, @code{atmega3290a}, @code{atmega3290p}, @code{atmega406}, @code{atmega64}, @code{atmega640}, @code{atmega644}, @code{atmega644a}, @code{atmega644p}, @code{atmega644pa}, @code{atmega645}, @code{atmega645a}, @code{atmega645p}, @code{atmega6450}, @code{atmega6450a}, @code{atmega6450p}, @code{atmega649}, @code{atmega649a}, @code{atmega649p}, @code{atmega6490}, @code{atmega16hva}, @code{atmega16hva2}, @code{atmega16hvb}, @code{atmega32hvb}, @code{atmega64hve}, @code{at90can32}, @code{at90can64}, @code{at90pwm216}, @code{at90pwm316}, @code{atmega32c1}, @code{atmega64c1}, @code{atmega16m1}, @code{atmega32m1}, @code{atmega64m1}, @code{atmega16u4}, @code{atmega32u4}, @code{atmega32u6}, @code{at90scr100}, @code{at90usb646}, @code{at90usb647}, @code{at94k}, @code{m3000}.
+
+@item avr51
+``Enhanced'' devices with 128@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atmega128}, @code{atmega1280}, @code{atmega1281}, @code{atmega1284p}, @code{atmega128rfa1}, @code{at90can128}, @code{at90usb1286}, @code{at90usb1287}.
+
+@item avr6
+``Enhanced'' devices with 3-byte PC, i.e.@: with more than 128@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atmega2560}, @code{atmega2561}.
+
+@item avrxmega2
+``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atxmega16a4}, @code{atxmega16d4}, @code{atxmega16x1}, @code{atxmega32a4}, @code{atxmega32d4}, @code{atxmega32x1}.
+
+@item avrxmega4
+``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64d3}.
+
+@item avrxmega5
+``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB of program memory and more than 64@tie{}KiB of RAM.
+@*@var{mcu}@tie{}= @code{atxmega64a1}, @code{atxmega64a1u}.
+
+@item avrxmega6
+``XMEGA'' devices with more than 128@tie{}KiB of program memory.
+@*@var{mcu}@tie{}= @code{atxmega128a3}, @code{atxmega128d3}, @code{atxmega192a3}, @code{atxmega192d3}, @code{atxmega256a3}, @code{atxmega256a3b}, @code{atxmega256a3bu}, @code{atxmega256d3}.
+
+@item avrxmega7
+``XMEGA'' devices with more than 128@tie{}KiB of program memory and more than 64@tie{}KiB of RAM.
+@*@var{mcu}@tie{}= @code{atxmega128a1}, @code{atxmega128a1u}.
+
+@item avr1
+This ISA is implemented by the minimal AVR core and supported for assembler only.
+@*@var{mcu}@tie{}= @code{at90s1200}, @code{attiny11}, @code{attiny12}, @code{attiny15}, @code{attiny28}.
+
+@end table
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 86698fcaf99..0b9164ec559 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11039,88 +11039,7 @@ The default for this option is@tie{}@code{avr2}.
GCC supports the following AVR devices and ISAs:
-@table @code
-
-@item avr1
-This ISA is implemented by the minimal AVR core and supported
-for assembler only.
-@*@var{mcu}@tie{}= @code{at90s1200},
-@code{attiny10}, @code{attiny11}, @code{attiny12}, @code{attiny15},
-@code{attiny28}.
-
-@item avr2
-``Classic'' devices with up to 8@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{at90s2313}, @code{attiny26}, @code{at90c8534},
-@dots{}
-
-@item avr25
-``Classic'' devices with up to 8@tie{}KiB of program memory and with
-the @code{MOVW} instruction.
-@*@var{mcu}@tie{}= @code{attiny2313}, @code{attiny261}, @code{attiny24},
-@dots{}
-
-@item avr3
-``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{at43usb355}, @code{at76c711}.
-
-@item avr31
-``Classic'' devices with 128@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atmega103}, @code{at43usb320}.
-
-@item avr35
-``Classic'' devices with 16@tie{}KiB up to 64@tie{}KiB of program
-memory and with the @code{MOVW} instruction.
-@*@var{mcu}@tie{}= @code{at90usb162}, @code{atmega8u2},
-@code{attiny167}, @dots{}
-
-@item avr4
-``Enhanced'' devices with up to 8@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atmega8}, @code{atmega88}, @code{at90pwm81},
-@dots{}
-
-@item avr5
-``Enhanced'' devices with 16@tie{}KiB up to 64@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atmega16}, @code{atmega6490}, @code{at90can64},
-@dots{}
-
-@item avr51
-``Enhanced'' devices with 128@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atmega128}, @code{at90can128}, @code{at90usb1287},
-@dots{}
-
-@item avr6
-``Enhanced'' devices with 3-byte PC, i.e.@: with at least 256@tie{}KiB
-of program memory.
-@*@var{mcu}@tie{}= @code{atmega2560}, @code{atmega2561}.
-
-@item avrxmega2
-``XMEGA'' devices with more than 8@tie{}KiB and up to 64@tie{}KiB
-of program memory.
-@*@var{mcu}@tie{}= @code{atxmega16a4}, @code{atxmega16d4},
-@dots{}
-
-@item avrxmega4
-``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
-of program memory.
-@*@var{mcu}@tie{}= @code{atxmega64a3}, @code{atxmega64d3}.
-
-@item avrxmega5
-``XMEGA'' devices with more than 64@tie{}KiB and up to 128@tie{}KiB
-of program memory and more than 64@tie{}KiB of RAM.
-@*@var{mcu}@tie{}= @code{atxmega64a1}, @code{atxmega64a1u}.
-
-@item avrxmega6
-``XMEGA'' devices with more than 128@tie{}KiB of program memory.
-@*@var{mcu}@tie{}= @code{atxmega128a3}, @code{atxmega192d3},
-@dots{}
-
-@item avrxmega7
-``XMEGA'' devices with more than 128@tie{}KiB of program memory and
-more than 64@tie{}KiB of RAM.
-@*@var{mcu}@tie{}= @code{atxmega128a1}, @code{atxmega128a1u}.
-
-@end table
-
+@include avr-mmcu.texi
@item -maccumulate-args
@opindex maccumulate-args