summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-10-30 09:35:42 +0000
committer <>2015-01-09 11:51:27 +0000
commitc27a97d04853380f1e80525391b3f0d156ed4c84 (patch)
tree68ffaade7c605bc80cffa18360799c98a810976f /include
parent6af3fdec2262dd94954acc5e426ef71cbd4521d3 (diff)
downloadgcc-tarball-c27a97d04853380f1e80525391b3f0d156ed4c84.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-4.9.2.tar.bz2.gcc-4.9.2
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog190
-rw-r--r--include/ansidecl.h159
-rw-r--r--include/demangle.h19
-rw-r--r--include/dwarf2.def688
-rw-r--r--include/dwarf2.h739
-rw-r--r--include/filenames.h6
-rw-r--r--include/floatformat.h3
-rw-r--r--include/gdb/gdb-index.h99
-rw-r--r--include/leb128.h136
-rw-r--r--include/libiberty.h40
-rw-r--r--include/longlong.h1724
-rw-r--r--include/objalloc.h4
-rw-r--r--include/plugin-api.h84
-rw-r--r--include/splay-tree.h19
-rw-r--r--include/vtv-change-permission.h55
15 files changed, 3129 insertions, 836 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 10d381836b..9ff64a0ed8 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,10 +1,79 @@
-2013-04-11 Release Manager
+2014-10-30 Release Manager
- * GCC 4.7.3 released.
+ * GCC 4.9.2 released.
-2013-01-30 Kai Tietz <ktietz@redhat.com>
+2014-07-16 Release Manager
+
+ * GCC 4.9.1 released.
+
+2014-04-22 Release Manager
+
+ * GCC 4.9.0 released.
+
+2014-01-21 Tom Tromey <tromey@redhat.com>
+
+ * ansidecl.h (ANSI_PROTOTYPES, PTRCONST, LONG_DOUBLE, PARAMS)
+ (VPARAMS, VA_START, VA_OPEN, VA_CLOSE, VA_FIXEDARG, CONST)
+ (VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, AND, DOTS)
+ (NOARGS): Don't define.
+ * libiberty.h (expandargv, writeargv): Don't use PARAMS.
+
+2013-12-23 Bill Maddox <maddox@google.com>
+
+ * demangle.h (enum gnu_v3_ctor_kinds):
+ Added literal gnu_v3_unified_ctor.
+ (enum gnu_v3_ctor_kinds):
+ Added literal gnu_v3_unified_dtor.
+
+2013-12-04 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * longlong.h: New file.
+
+2013-10-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/58689
+ * ansidecl.h (ATTRIBUTE_RETURNS_NONNULL): New macro.
+ * libiberty.h (basename, lbasename, dos_lbasename, unix_lbasename,
+ concat_copy): Mark with attributes nonnull(1) and returns_nonnull.
+ (concat, reconcat, concat_copy2, choose_temp_base, xstrerror,
+ xmalloc, xrealloc, xcalloc, xstrdup, xstrndup, xmemdup, pex_init):
+ Mark with attribute returns_nonnull.
+
+2013-10-22 Sterling Augustine <saugustine@google.com>
+
+ * gdb/gdb-index.h: Merge from gdb tree.
+
+2013-08-20 Alan Modra <amodra@gmail.com>
+
+ * floatformat.h (floatformat_ibm_long_double): Delete.
+ (floatformat_ibm_long_double_big): Declare.
+ (floatformat_ibm_long_double_little): Declare.
- Merged from trunk.
+2013-08-19 Dehao Chen <dehao@google.com>
+
+ * dwarf2.def (DW_AT_GNU_discriminator): New attribute.
+
+2013-08-02 Caroline Tice <cmtice@google.com>
+
+ * vtv-change-permission.h: New file.
+
+2013-04-03 Jason Merrill <jason@redhat.com>
+
+ Demangle C++11 ref-qualifier.
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_REFERENCE_THIS,
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS.
+
+2013-03-01 Cary Coutant <ccoutant@google.com>
+
+ * dwarf2.h (enum dwarf_sect): New enum type.
+
+2013-02-11 Sriraman Tallam <tmsriram@google.com>
+
+ * plugin-api.h (enum ld_plugin_level): Assign integers
+ explicitly for all values.
+
+2013-01-30 Kai Tietz <ktietz@redhat.com>
PR other/54620
PR target/39064
@@ -12,17 +81,116 @@
stdint.h and sys/types.h headers are present.
* sha1.h (sha1_uintptr, sha1_uint32): Likewise.
-2012-09-20 Release Manager
+2012-12-18 Aldy Hernandez <aldyh@redhat.com>
+
+ PR other/54324
+ * ansidecl.h (ATTRIBUTE_UNUSED): Do not set __attribute__ for GCC
+ < 3.4.
+
+2012-11-09 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_TAGGED_NAME.
+
+2012-10-29 Sterling Augustine <saugustine@google.com>
+ Cary Coutant <ccoutant@google.com>
+
+ * dwarf2.h (dwarf_location_list_entry_type): New enum with fields
+ DW_LLE_GNU_end_of_list_entry, DW_LLE_GNU_base_address_selection_entry,
+ DW_LLE_GNU_start_end_entry and DW_LLE_GNU_start_length_entry.
+
+
+2012-10-08 Jason Merrill <jason@redhat.com>
+
+ * demangle.h (enum demangle_component_type): Add
+ DEMANGLE_COMPONENT_TLS_INIT and DEMANGLE_COMPONENT_TLS_WRAPPER.
+
+2012-09-18 Florian Weimer <fweimer@redhat.com>
+
+ PR other/54411
+ * objalloc.h (objalloc_alloc): Do not use fast path on wraparound.
+
+2012-09-06 Cary Coutant <ccoutant@google.com>
+
+ * dwarf2.def: Edit comment.
+
+2012-08-24 Sriraman Tallam <tmsriram@google.com>
+
+ * plugin-api.h (ld_plugin_allow_unique_segment_for_sections):
+ New interface.
+ (ld_plugin_unique_segment_for_sections): New interface.
+ (LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS): New enum val.
+ (LDPT_UNIQUE_SEGMENT_FOR_SECTIONS): New enum val.
+ (tv_allow_unique_segment_for_sections): New member.
+ (tv_unique_segment_for_sections): New member.
+
+2012-07-13 Doug Evans <dje@google.com>
+
+ * filenames.h: #include "hashtab.h".
+ (filename_hash, filename_eq): Declare.
+
+2012-06-18 Doug Evans <dje@google.com>
+
+ * dwarf2.def (DW_OP): Add DW_OP_GNU_const_index.
+
+2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com>
+
+ * plugin-api.h (ld_plugin_output_file_type): Add LDPO_PIE.
+
+2012-06-08 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2.def (DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt): New
+ forms.
+ * dwarf2.h (enum dwarf_macro_record_type): Add
+ DW_MACRO_GNU_define_indirect_alt, DW_MACRO_GNU_undef_indirect_alt
+ and DW_MACRO_GNU_transparent_include_alt.
+
+2012-05-23 Doug Evans <dje@google.com>
+
+ * leb128.h: #include stdint.h, inttypes.h.
+ (read_uleb128_to_uint64): Renamed from read_uleb128_to_ull.
+ Change to take a uint64_t * argument instead of unsigned long long.
+ (read_sleb128_to_uint64): Renamed from read_sleb128_to_ll.
+ Change to take an int64_t * argument instead of long long.
+
+2012-05-22 Doug Evans <dje@google.com>
+
+ * leb128.h: New file.
+
+2012-05-19 Gary Funck <gary@intrepid.com>
+
+ * dwarf2.def: Update comment re: UPC extensions to reference
+ DWARF4 specification.
+
+2012-05-02 Cary Coutant <ccoutant@google.com>
+
+ * dwarf2.def: Remove DW_FORM_GNU_ref_index,
+ replace DW_AT_GNU_ref_base with DW_AT_GNU_ranges_base.
+
+2012-04-28 Doug Evans <dje@google.com>
+
+ * dwarf2.def (DW_OP): Add DW_OP_GNU_addr_index.
+
+2012-04-27 Tom Tromey <tromey@redhat.com>
- * GCC 4.7.2 released.
+ * dwarf2.h: Wrap function declarations in extern "C".
-2012-06-14 Release Manager
+2012-04-27 Tom Tromey <tromey@redhat.com>
- * GCC 4.7.1 released.
+ * dwarf2.h (enum dwarf_tag, enum dwarf_form, enum dwarf_attribute)
+ (enum dwarf_location_atom, enum dwarf_type, enum
+ dwarf_call_frame_info): Remove.
+ (DW_TAG, DW_TAG_DUP, DW_FORM, DW_AT, DW_AT_DUP, DW_OP)
+ (DW_OP_DUP, DW_ATE, DW_ATE_DUP, DW_CFA): New macros.
+ Include dwarf2.def.
+ (get_DW_TAG_name, get_DW_AT_name, get_DW_FORM_name)
+ (get_DW_OP_name, get_DW_ATE_name): Declare.
+ * dwarf2.def: New file, from dwarf2.h.
-2012-03-22 Release Manager
+2012-04-10 Tristan Gingold <gingold@adacore.com>
- * GCC 4.7.0 released.
+ * splay-tree.h: Conditionnaly includes stdint.h and inttypes.h
+ (libi_uhostptr_t, libi_shostptr_t): Remove, replaced by uintptr_t.
2012-01-26 Cary Coutant <ccoutant@google.com>
@@ -192,7 +360,7 @@
Sync LD plugin patch series (part 1/6) with src/include/.
* plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member.
-2010-10-06 Andi Kleen <ak@linux.intel.com>
+2010-10-06 Andi Kleen <ak@linux.intel.com>
* libiberty.h (setproctitle): Add prototype.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 23d85bf0e1..0fb23bba79 100644
--- a/include/ansidecl.h
+++ b/include/ansidecl.h
@@ -1,6 +1,6 @@
/* ANSI and traditional C compatability macros
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
+ 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2013
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -24,93 +24,16 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
Macro ANSI C definition Traditional C definition
----- ---- - ---------- ----------- - ----------
- ANSI_PROTOTYPES 1 not defined
PTR `void *' `char *'
- PTRCONST `void *const' `char *'
- LONG_DOUBLE `long double' `double'
const not defined `'
volatile not defined `'
signed not defined `'
- VA_START(ap, var) va_start(ap, var) va_start(ap)
-
- Note that it is safe to write "void foo();" indicating a function
- with no return value, in all K+R compilers we have been able to test.
-
- For declaring functions with prototypes, we also provide these:
-
- PARAMS ((prototype))
- -- for functions which take a fixed number of arguments. Use this
- when declaring the function. When defining the function, write a
- K+R style argument list. For example:
-
- char *strcpy PARAMS ((char *dest, char *source));
- ...
- char *
- strcpy (dest, source)
- char *dest;
- char *source;
- { ... }
-
-
- VPARAMS ((prototype, ...))
- -- for functions which take a variable number of arguments. Use
- PARAMS to declare the function, VPARAMS to define it. For example:
-
- int printf PARAMS ((const char *format, ...));
- ...
- int
- printf VPARAMS ((const char *format, ...))
- {
- ...
- }
-
- For writing functions which take variable numbers of arguments, we
- also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
- hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
- thoroughly than the simple VA_START() macro mentioned above.
-
- VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
- Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
- corresponding to the list of fixed arguments. Then use va_arg
- normally to get the variable arguments, or pass your va_list object
- around. You do not declare the va_list yourself; VA_OPEN does it
- for you.
-
- Here is a complete example:
-
- int
- printf VPARAMS ((const char *format, ...))
- {
- int result;
-
- VA_OPEN (ap, format);
- VA_FIXEDARG (ap, const char *, format);
-
- result = vfprintf (stdout, format, ap);
- VA_CLOSE (ap);
-
- return result;
- }
-
-
- You can declare variables either before or after the VA_OPEN,
- VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
- and end of a block. They must appear at the same nesting level,
- and any variables declared after VA_OPEN go out of scope at
- VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
- argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
- pairs in a single function in case you need to traverse the
- argument list more than once.
For ease of writing code which uses GCC extensions but needs to be
portable to other compilers, we provide the GCC_VERSION macro that
simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
wrappers around __attribute__. Also, __extension__ will be #defined
- to nothing if it doesn't work. See below.
-
- This header also defines a lot of obsolete macros:
- CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
- AND, DOTS, NOARGS. Don't use them. */
+ to nothing if it doesn't work. See below. */
#ifndef _ANSIDECL_H
#define _ANSIDECL_H 1
@@ -149,28 +72,8 @@ So instead we use the macro below and test it against specific values. */
C++ compilers, does not define __STDC__, though it acts as if this
was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
-#define ANSI_PROTOTYPES 1
#define PTR void *
-#define PTRCONST void *const
-#define LONG_DOUBLE long double
-/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in
- a #ifndef. */
-#ifndef PARAMS
-#define PARAMS(ARGS) ARGS
-#endif
-
-#define VPARAMS(ARGS) ARGS
-#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
-
-/* variadic function helper macros */
-/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
- use without inhibiting further decls and without declaring an
- actual variable. */
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, T, N) struct Qdmy
-
#undef const
#undef volatile
#undef signed
@@ -188,35 +91,9 @@ So instead we use the macro below and test it against specific values. */
# endif
#endif
-/* These are obsolete. Do not use. */
-#ifndef IN_GCC
-#define CONST const
-#define VOLATILE volatile
-#define SIGNED signed
-
-#define PROTO(type, name, arglist) type name arglist
-#define EXFUN(name, proto) name proto
-#define DEFUN(name, arglist, args) name(args)
-#define DEFUN_VOID(name) name(void)
-#define AND ,
-#define DOTS , ...
-#define NOARGS void
-#endif /* ! IN_GCC */
-
#else /* Not ANSI C. */
-#undef ANSI_PROTOTYPES
#define PTR char *
-#define PTRCONST PTR
-#define LONG_DOUBLE double
-
-#define PARAMS(args) ()
-#define VPARAMS(args) (va_alist) va_dcl
-#define VA_START(va_list, var) va_start(va_list)
-
-#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
-#define VA_CLOSE(AP) } va_end(AP); }
-#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
/* some systems define these in header files for non-ansi mode */
#undef const
@@ -228,20 +105,6 @@ So instead we use the macro below and test it against specific values. */
#define signed
#define inline
-#ifndef IN_GCC
-#define CONST
-#define VOLATILE
-#define SIGNED
-
-#define PROTO(type, name, arglist) type name ()
-#define EXFUN(name, proto) name()
-#define DEFUN(name, arglist, args) name arglist args;
-#define DEFUN_VOID(name) name()
-#define AND ;
-#define DOTS
-#define NOARGS
-#endif /* ! IN_GCC */
-
#endif /* ANSI C. */
/* Define macros for some gcc attributes. This permits us to use the
@@ -279,8 +142,15 @@ So instead we use the macro below and test it against specific values. */
# endif
#endif
+/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend
+ couldn't parse attributes placed after the identifier name, and now
+ the entire compiler is built with C++. */
#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#if GCC_VERSION >= 3004
+# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#else
+#define ATTRIBUTE_UNUSED
+#endif
#endif /* ATTRIBUTE_UNUSED */
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
@@ -304,6 +174,15 @@ So instead we use the macro below and test it against specific values. */
# endif /* GNUC >= 3.3 */
#endif /* ATTRIBUTE_NONNULL */
+/* Attribute `returns_nonnull' was valid as of gcc 4.9. */
+#ifndef ATTRIBUTE_RETURNS_NONNULL
+# if (GCC_VERSION >= 4009)
+# define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+# else
+# define ATTRIBUTE_RETURNS_NONNULL
+# endif /* GNUC >= 4.9 */
+#endif /* ATTRIBUTE_RETURNS_NONNULL */
+
/* Attribute `pure' was valid as of gcc 3.0. */
#ifndef ATTRIBUTE_PURE
# if (GCC_VERSION >= 3000)
diff --git a/include/demangle.h b/include/demangle.h
index 34b3ed3cde..bbad71bd8c 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -173,6 +173,10 @@ enum gnu_v3_ctor_kinds {
gnu_v3_complete_object_ctor = 1,
gnu_v3_base_object_ctor,
gnu_v3_complete_object_allocating_ctor,
+ /* These are not part of the V3 ABI. Unified constructors are generated
+ as a speed-for-space optimization when the -fdeclone-ctor-dtor option
+ is used, and are always internal symbols. */
+ gnu_v3_unified_ctor,
gnu_v3_object_ctor_group
};
@@ -188,6 +192,10 @@ enum gnu_v3_dtor_kinds {
gnu_v3_deleting_dtor = 1,
gnu_v3_complete_object_dtor,
gnu_v3_base_object_dtor,
+ /* These are not part of the V3 ABI. Unified destructors are generated
+ as a speed-for-space optimization when the -fdeclone-ctor-dtor option
+ is used, and are always internal symbols. */
+ gnu_v3_unified_dtor,
gnu_v3_object_dtor_group
};
@@ -272,6 +280,9 @@ enum demangle_component_type
/* A guard variable. This has one subtree, the name for which this
is a guard variable. */
DEMANGLE_COMPONENT_GUARD,
+ /* The init and wrapper functions for C++11 thread_local variables. */
+ DEMANGLE_COMPONENT_TLS_INIT,
+ DEMANGLE_COMPONENT_TLS_WRAPPER,
/* A reference temporary. This has one subtree, the name for which
this is a temporary. */
DEMANGLE_COMPONENT_REFTEMP,
@@ -299,6 +310,12 @@ enum demangle_component_type
/* The const qualifier modifying a member function. The one subtree
is the type which is being qualified. */
DEMANGLE_COMPONENT_CONST_THIS,
+ /* C++11 A reference modifying a member function. The one subtree is the
+ type which is being referenced. */
+ DEMANGLE_COMPONENT_REFERENCE_THIS,
+ /* C++11: An rvalue reference modifying a member function. The one
+ subtree is the type which is being referenced. */
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS,
/* A vendor qualifier. The left subtree is the type which is being
qualified, and the right subtree is the name of the
qualifier. */
@@ -417,6 +434,8 @@ enum demangle_component_type
DEMANGLE_COMPONENT_NONTRANSACTION_CLONE,
/* A pack expansion. */
DEMANGLE_COMPONENT_PACK_EXPANSION,
+ /* A name with an ABI tag. */
+ DEMANGLE_COMPONENT_TAGGED_NAME,
/* A cloned function. */
DEMANGLE_COMPONENT_CLONE
};
diff --git a/include/dwarf2.def b/include/dwarf2.def
new file mode 100644
index 0000000000..71a37b30c9
--- /dev/null
+++ b/include/dwarf2.def
@@ -0,0 +1,688 @@
+/* -*- c -*-
+ Declarations and definitions of codes relating to the DWARF2 and
+ DWARF3 symbolic debugging information formats.
+ Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ Free Software Foundation, Inc.
+
+ Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
+ Office (AJPO), Florida State University and Silicon Graphics Inc.
+ provided support for this effort -- June 21, 1995.
+
+ Derived from the DWARF 1 implementation written by Ron Guilmette
+ (rfg@netcom.com), November 1990.
+
+ 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.
+
+ Under Section 7 of GPL version 3, you are granted additional
+ permissions described in the GCC Runtime Library Exception, version
+ 3.1, as published by the Free Software Foundation.
+
+ You should have received a copy of the GNU General Public License and
+ a copy of the GCC Runtime Library Exception along with this program;
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* This file is derived from the DWARF specification (a public document)
+ Revision 2.0.0 (July 27, 1993) developed by the UNIX International
+ Programming Languages Special Interest Group (UI/PLSIG) and distributed
+ by UNIX International. Copies of this specification are available from
+ UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
+
+ This file also now contains definitions from the DWARF 3 specification
+ published Dec 20, 2005, available from: http://dwarf.freestandards.org.
+
+ This file also now contains definitions from the DWARF 4
+ specification, available from: http://dwarfstd.org/ */
+
+/* This file declares various DWARF-related constants using a set of
+ macros which can be redefined by the including file.
+
+ The macros are in sections. Each section corresponds to a single
+ set of DWARF constants and has a corresponding key. The key is
+ used in all the macro names.
+
+ The sections are TAG (for DW_TAG_ constants), FORM (DW_FORM_), AT
+ (DW_AT_), OP (DW_OP_), ATE (DW_ATE_), and CFA (DW_CFA_).
+
+ Using TAG as an example, the following macros may be used for each
+ key:
+
+ DW_FIRST_TAG(name, value) - Introduce the first DW_TAG constant.
+
+ DW_TAG(name, value) - Define a subsequent constant.
+
+ DW_TAG_DUP(name, value) - Define a subsequent constant whose value
+ is a duplicate of some other constant. Not all keys use the _DUP
+ macro form. If more than one name shares a value, then the base
+ (DW_TAG) form will be the preferred name and DW_TAG_DUP will hold
+ any alternate names.
+
+ DW_END_TAG - Invoked at the end of the DW_TAG constants. */
+
+DW_FIRST_TAG (DW_TAG_padding, 0x00)
+DW_TAG (DW_TAG_array_type, 0x01)
+DW_TAG (DW_TAG_class_type, 0x02)
+DW_TAG (DW_TAG_entry_point, 0x03)
+DW_TAG (DW_TAG_enumeration_type, 0x04)
+DW_TAG (DW_TAG_formal_parameter, 0x05)
+DW_TAG (DW_TAG_imported_declaration, 0x08)
+DW_TAG (DW_TAG_label, 0x0a)
+DW_TAG (DW_TAG_lexical_block, 0x0b)
+DW_TAG (DW_TAG_member, 0x0d)
+DW_TAG (DW_TAG_pointer_type, 0x0f)
+DW_TAG (DW_TAG_reference_type, 0x10)
+DW_TAG (DW_TAG_compile_unit, 0x11)
+DW_TAG (DW_TAG_string_type, 0x12)
+DW_TAG (DW_TAG_structure_type, 0x13)
+DW_TAG (DW_TAG_subroutine_type, 0x15)
+DW_TAG (DW_TAG_typedef, 0x16)
+DW_TAG (DW_TAG_union_type, 0x17)
+DW_TAG (DW_TAG_unspecified_parameters, 0x18)
+DW_TAG (DW_TAG_variant, 0x19)
+DW_TAG (DW_TAG_common_block, 0x1a)
+DW_TAG (DW_TAG_common_inclusion, 0x1b)
+DW_TAG (DW_TAG_inheritance, 0x1c)
+DW_TAG (DW_TAG_inlined_subroutine, 0x1d)
+DW_TAG (DW_TAG_module, 0x1e)
+DW_TAG (DW_TAG_ptr_to_member_type, 0x1f)
+DW_TAG (DW_TAG_set_type, 0x20)
+DW_TAG (DW_TAG_subrange_type, 0x21)
+DW_TAG (DW_TAG_with_stmt, 0x22)
+DW_TAG (DW_TAG_access_declaration, 0x23)
+DW_TAG (DW_TAG_base_type, 0x24)
+DW_TAG (DW_TAG_catch_block, 0x25)
+DW_TAG (DW_TAG_const_type, 0x26)
+DW_TAG (DW_TAG_constant, 0x27)
+DW_TAG (DW_TAG_enumerator, 0x28)
+DW_TAG (DW_TAG_file_type, 0x29)
+DW_TAG (DW_TAG_friend, 0x2a)
+DW_TAG (DW_TAG_namelist, 0x2b)
+DW_TAG (DW_TAG_namelist_item, 0x2c)
+DW_TAG (DW_TAG_packed_type, 0x2d)
+DW_TAG (DW_TAG_subprogram, 0x2e)
+DW_TAG (DW_TAG_template_type_param, 0x2f)
+DW_TAG (DW_TAG_template_value_param, 0x30)
+DW_TAG (DW_TAG_thrown_type, 0x31)
+DW_TAG (DW_TAG_try_block, 0x32)
+DW_TAG (DW_TAG_variant_part, 0x33)
+DW_TAG (DW_TAG_variable, 0x34)
+DW_TAG (DW_TAG_volatile_type, 0x35)
+/* DWARF 3. */
+DW_TAG (DW_TAG_dwarf_procedure, 0x36)
+DW_TAG (DW_TAG_restrict_type, 0x37)
+DW_TAG (DW_TAG_interface_type, 0x38)
+DW_TAG (DW_TAG_namespace, 0x39)
+DW_TAG (DW_TAG_imported_module, 0x3a)
+DW_TAG (DW_TAG_unspecified_type, 0x3b)
+DW_TAG (DW_TAG_partial_unit, 0x3c)
+DW_TAG (DW_TAG_imported_unit, 0x3d)
+DW_TAG (DW_TAG_condition, 0x3f)
+DW_TAG (DW_TAG_shared_type, 0x40)
+/* DWARF 4. */
+DW_TAG (DW_TAG_type_unit, 0x41)
+DW_TAG (DW_TAG_rvalue_reference_type, 0x42)
+DW_TAG (DW_TAG_template_alias, 0x43)
+
+DW_TAG_DUP (DW_TAG_lo_user, 0x4080)
+DW_TAG_DUP (DW_TAG_hi_user, 0xffff)
+
+/* SGI/MIPS Extensions. */
+DW_TAG (DW_TAG_MIPS_loop, 0x4081)
+
+/* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */
+DW_TAG (DW_TAG_HP_array_descriptor, 0x4090)
+DW_TAG (DW_TAG_HP_Bliss_field, 0x4091)
+DW_TAG (DW_TAG_HP_Bliss_field_set, 0x4092)
+
+/* GNU extensions. */
+DW_TAG (DW_TAG_format_label, 0x4101) /* For FORTRAN 77 and Fortran 90. */
+DW_TAG (DW_TAG_function_template, 0x4102) /* For C++. */
+DW_TAG (DW_TAG_class_template, 0x4103) /* For C++. */
+DW_TAG (DW_TAG_GNU_BINCL, 0x4104)
+DW_TAG (DW_TAG_GNU_EINCL, 0x4105)
+/* Template template parameter.
+ See http://gcc.gnu.org/wiki/TemplateParmsDwarf . */
+DW_TAG (DW_TAG_GNU_template_template_param, 0x4106)
+
+/* Template parameter pack extension, specified at
+ http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Variadic_templates
+ The values of these two TAGS are in the DW_TAG_GNU_* space until the tags
+ are properly part of DWARF 5. */
+DW_TAG (DW_TAG_GNU_template_parameter_pack, 0x4107)
+DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108)
+/* The GNU call site extension, specified at
+ http://www.dwarfstd.org/ShowIssue.php?issue=100909.2&type=open .
+ The values of these two TAGS are in the DW_TAG_GNU_* space until the tags
+ are properly part of DWARF 5. */
+DW_TAG (DW_TAG_GNU_call_site, 0x4109)
+DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a)
+/* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */
+DW_TAG (DW_TAG_upc_shared_type, 0x8765)
+DW_TAG (DW_TAG_upc_strict_type, 0x8766)
+DW_TAG (DW_TAG_upc_relaxed_type, 0x8767)
+/* PGI (STMicroelectronics) extensions. No documentation available. */
+DW_TAG (DW_TAG_PGI_kanji_type, 0xA000)
+DW_TAG (DW_TAG_PGI_interface_block, 0xA020)
+DW_END_TAG
+
+DW_FIRST_FORM (DW_FORM_addr, 0x01)
+DW_FORM (DW_FORM_block2, 0x03)
+DW_FORM (DW_FORM_block4, 0x04)
+DW_FORM (DW_FORM_data2, 0x05)
+DW_FORM (DW_FORM_data4, 0x06)
+DW_FORM (DW_FORM_data8, 0x07)
+DW_FORM (DW_FORM_string, 0x08)
+DW_FORM (DW_FORM_block, 0x09)
+DW_FORM (DW_FORM_block1, 0x0a)
+DW_FORM (DW_FORM_data1, 0x0b)
+DW_FORM (DW_FORM_flag, 0x0c)
+DW_FORM (DW_FORM_sdata, 0x0d)
+DW_FORM (DW_FORM_strp, 0x0e)
+DW_FORM (DW_FORM_udata, 0x0f)
+DW_FORM (DW_FORM_ref_addr, 0x10)
+DW_FORM (DW_FORM_ref1, 0x11)
+DW_FORM (DW_FORM_ref2, 0x12)
+DW_FORM (DW_FORM_ref4, 0x13)
+DW_FORM (DW_FORM_ref8, 0x14)
+DW_FORM (DW_FORM_ref_udata, 0x15)
+DW_FORM (DW_FORM_indirect, 0x16)
+/* DWARF 4. */
+DW_FORM (DW_FORM_sec_offset, 0x17)
+DW_FORM (DW_FORM_exprloc, 0x18)
+DW_FORM (DW_FORM_flag_present, 0x19)
+DW_FORM (DW_FORM_ref_sig8, 0x20)
+/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
+DW_FORM (DW_FORM_GNU_addr_index, 0x1f01)
+DW_FORM (DW_FORM_GNU_str_index, 0x1f02)
+/* Extensions for DWZ multifile.
+ See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */
+DW_FORM (DW_FORM_GNU_ref_alt, 0x1f20)
+DW_FORM (DW_FORM_GNU_strp_alt, 0x1f21)
+DW_END_FORM
+
+DW_FIRST_AT (DW_AT_sibling, 0x01)
+DW_AT (DW_AT_location, 0x02)
+DW_AT (DW_AT_name, 0x03)
+DW_AT (DW_AT_ordering, 0x09)
+DW_AT (DW_AT_subscr_data, 0x0a)
+DW_AT (DW_AT_byte_size, 0x0b)
+DW_AT (DW_AT_bit_offset, 0x0c)
+DW_AT (DW_AT_bit_size, 0x0d)
+DW_AT (DW_AT_element_list, 0x0f)
+DW_AT (DW_AT_stmt_list, 0x10)
+DW_AT (DW_AT_low_pc, 0x11)
+DW_AT (DW_AT_high_pc, 0x12)
+DW_AT (DW_AT_language, 0x13)
+DW_AT (DW_AT_member, 0x14)
+DW_AT (DW_AT_discr, 0x15)
+DW_AT (DW_AT_discr_value, 0x16)
+DW_AT (DW_AT_visibility, 0x17)
+DW_AT (DW_AT_import, 0x18)
+DW_AT (DW_AT_string_length, 0x19)
+DW_AT (DW_AT_common_reference, 0x1a)
+DW_AT (DW_AT_comp_dir, 0x1b)
+DW_AT (DW_AT_const_value, 0x1c)
+DW_AT (DW_AT_containing_type, 0x1d)
+DW_AT (DW_AT_default_value, 0x1e)
+DW_AT (DW_AT_inline, 0x20)
+DW_AT (DW_AT_is_optional, 0x21)
+DW_AT (DW_AT_lower_bound, 0x22)
+DW_AT (DW_AT_producer, 0x25)
+DW_AT (DW_AT_prototyped, 0x27)
+DW_AT (DW_AT_return_addr, 0x2a)
+DW_AT (DW_AT_start_scope, 0x2c)
+DW_AT (DW_AT_bit_stride, 0x2e)
+DW_AT (DW_AT_upper_bound, 0x2f)
+DW_AT (DW_AT_abstract_origin, 0x31)
+DW_AT (DW_AT_accessibility, 0x32)
+DW_AT (DW_AT_address_class, 0x33)
+DW_AT (DW_AT_artificial, 0x34)
+DW_AT (DW_AT_base_types, 0x35)
+DW_AT (DW_AT_calling_convention, 0x36)
+DW_AT (DW_AT_count, 0x37)
+DW_AT (DW_AT_data_member_location, 0x38)
+DW_AT (DW_AT_decl_column, 0x39)
+DW_AT (DW_AT_decl_file, 0x3a)
+DW_AT (DW_AT_decl_line, 0x3b)
+DW_AT (DW_AT_declaration, 0x3c)
+DW_AT (DW_AT_discr_list, 0x3d)
+DW_AT (DW_AT_encoding, 0x3e)
+DW_AT (DW_AT_external, 0x3f)
+DW_AT (DW_AT_frame_base, 0x40)
+DW_AT (DW_AT_friend, 0x41)
+DW_AT (DW_AT_identifier_case, 0x42)
+DW_AT (DW_AT_macro_info, 0x43)
+DW_AT (DW_AT_namelist_items, 0x44)
+DW_AT (DW_AT_priority, 0x45)
+DW_AT (DW_AT_segment, 0x46)
+DW_AT (DW_AT_specification, 0x47)
+DW_AT (DW_AT_static_link, 0x48)
+DW_AT (DW_AT_type, 0x49)
+DW_AT (DW_AT_use_location, 0x4a)
+DW_AT (DW_AT_variable_parameter, 0x4b)
+DW_AT (DW_AT_virtuality, 0x4c)
+DW_AT (DW_AT_vtable_elem_location, 0x4d)
+/* DWARF 3 values. */
+DW_AT (DW_AT_allocated, 0x4e)
+DW_AT (DW_AT_associated, 0x4f)
+DW_AT (DW_AT_data_location, 0x50)
+DW_AT (DW_AT_byte_stride, 0x51)
+DW_AT (DW_AT_entry_pc, 0x52)
+DW_AT (DW_AT_use_UTF8, 0x53)
+DW_AT (DW_AT_extension, 0x54)
+DW_AT (DW_AT_ranges, 0x55)
+DW_AT (DW_AT_trampoline, 0x56)
+DW_AT (DW_AT_call_column, 0x57)
+DW_AT (DW_AT_call_file, 0x58)
+DW_AT (DW_AT_call_line, 0x59)
+DW_AT (DW_AT_description, 0x5a)
+DW_AT (DW_AT_binary_scale, 0x5b)
+DW_AT (DW_AT_decimal_scale, 0x5c)
+DW_AT (DW_AT_small, 0x5d)
+DW_AT (DW_AT_decimal_sign, 0x5e)
+DW_AT (DW_AT_digit_count, 0x5f)
+DW_AT (DW_AT_picture_string, 0x60)
+DW_AT (DW_AT_mutable, 0x61)
+DW_AT (DW_AT_threads_scaled, 0x62)
+DW_AT (DW_AT_explicit, 0x63)
+DW_AT (DW_AT_object_pointer, 0x64)
+DW_AT (DW_AT_endianity, 0x65)
+DW_AT (DW_AT_elemental, 0x66)
+DW_AT (DW_AT_pure, 0x67)
+DW_AT (DW_AT_recursive, 0x68)
+/* DWARF 4. */
+DW_AT (DW_AT_signature, 0x69)
+DW_AT (DW_AT_main_subprogram, 0x6a)
+DW_AT (DW_AT_data_bit_offset, 0x6b)
+DW_AT (DW_AT_const_expr, 0x6c)
+DW_AT (DW_AT_enum_class, 0x6d)
+DW_AT (DW_AT_linkage_name, 0x6e)
+
+DW_AT_DUP (DW_AT_lo_user, 0x2000) /* Implementation-defined range start. */
+DW_AT_DUP (DW_AT_hi_user, 0x3fff) /* Implementation-defined range end. */
+
+/* SGI/MIPS extensions. */
+DW_AT (DW_AT_MIPS_fde, 0x2001)
+DW_AT (DW_AT_MIPS_loop_begin, 0x2002)
+DW_AT (DW_AT_MIPS_tail_loop_begin, 0x2003)
+DW_AT (DW_AT_MIPS_epilog_begin, 0x2004)
+DW_AT (DW_AT_MIPS_loop_unroll_factor, 0x2005)
+DW_AT (DW_AT_MIPS_software_pipeline_depth, 0x2006)
+DW_AT (DW_AT_MIPS_linkage_name, 0x2007)
+DW_AT (DW_AT_MIPS_stride, 0x2008)
+DW_AT (DW_AT_MIPS_abstract_name, 0x2009)
+DW_AT (DW_AT_MIPS_clone_origin, 0x200a)
+DW_AT (DW_AT_MIPS_has_inlines, 0x200b)
+/* HP extensions. */
+DW_AT (DW_AT_HP_block_index, 0x2000)
+DW_AT_DUP (DW_AT_HP_unmodifiable, 0x2001) /* Same as DW_AT_MIPS_fde. */
+DW_AT_DUP (DW_AT_HP_prologue, 0x2005) /* Same as DW_AT_MIPS_loop_unroll. */
+DW_AT_DUP (DW_AT_HP_epilogue, 0x2008) /* Same as DW_AT_MIPS_stride. */
+DW_AT (DW_AT_HP_actuals_stmt_list, 0x2010)
+DW_AT (DW_AT_HP_proc_per_section, 0x2011)
+DW_AT (DW_AT_HP_raw_data_ptr, 0x2012)
+DW_AT (DW_AT_HP_pass_by_reference, 0x2013)
+DW_AT (DW_AT_HP_opt_level, 0x2014)
+DW_AT (DW_AT_HP_prof_version_id, 0x2015)
+DW_AT (DW_AT_HP_opt_flags, 0x2016)
+DW_AT (DW_AT_HP_cold_region_low_pc, 0x2017)
+DW_AT (DW_AT_HP_cold_region_high_pc, 0x2018)
+DW_AT (DW_AT_HP_all_variables_modifiable, 0x2019)
+DW_AT (DW_AT_HP_linkage_name, 0x201a)
+DW_AT (DW_AT_HP_prof_flags, 0x201b) /* In comp unit of procs_info for -g. */
+DW_AT (DW_AT_HP_unit_name, 0x201f)
+DW_AT (DW_AT_HP_unit_size, 0x2020)
+DW_AT (DW_AT_HP_widened_byte_size, 0x2021)
+DW_AT (DW_AT_HP_definition_points, 0x2022)
+DW_AT (DW_AT_HP_default_location, 0x2023)
+DW_AT (DW_AT_HP_is_result_param, 0x2029)
+
+/* GNU extensions. */
+DW_AT (DW_AT_sf_names, 0x2101)
+DW_AT (DW_AT_src_info, 0x2102)
+DW_AT (DW_AT_mac_info, 0x2103)
+DW_AT (DW_AT_src_coords, 0x2104)
+DW_AT (DW_AT_body_begin, 0x2105)
+DW_AT (DW_AT_body_end, 0x2106)
+DW_AT (DW_AT_GNU_vector, 0x2107)
+/* Thread-safety annotations.
+ See http://gcc.gnu.org/wiki/ThreadSafetyAnnotation . */
+DW_AT (DW_AT_GNU_guarded_by, 0x2108)
+DW_AT (DW_AT_GNU_pt_guarded_by, 0x2109)
+DW_AT (DW_AT_GNU_guarded, 0x210a)
+DW_AT (DW_AT_GNU_pt_guarded, 0x210b)
+DW_AT (DW_AT_GNU_locks_excluded, 0x210c)
+DW_AT (DW_AT_GNU_exclusive_locks_required, 0x210d)
+DW_AT (DW_AT_GNU_shared_locks_required, 0x210e)
+/* One-definition rule violation detection.
+ See http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo . */
+DW_AT (DW_AT_GNU_odr_signature, 0x210f)
+/* Template template argument name.
+ See http://gcc.gnu.org/wiki/TemplateParmsDwarf . */
+DW_AT (DW_AT_GNU_template_name, 0x2110)
+/* The GNU call site extension.
+ See http://www.dwarfstd.org/ShowIssue.php?issue=100909.2&type=open . */
+DW_AT (DW_AT_GNU_call_site_value, 0x2111)
+DW_AT (DW_AT_GNU_call_site_data_value, 0x2112)
+DW_AT (DW_AT_GNU_call_site_target, 0x2113)
+DW_AT (DW_AT_GNU_call_site_target_clobbered, 0x2114)
+DW_AT (DW_AT_GNU_tail_call, 0x2115)
+DW_AT (DW_AT_GNU_all_tail_call_sites, 0x2116)
+DW_AT (DW_AT_GNU_all_call_sites, 0x2117)
+DW_AT (DW_AT_GNU_all_source_call_sites, 0x2118)
+/* Section offset into .debug_macro section. */
+DW_AT (DW_AT_GNU_macros, 0x2119)
+/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
+DW_AT (DW_AT_GNU_dwo_name, 0x2130)
+DW_AT (DW_AT_GNU_dwo_id, 0x2131)
+DW_AT (DW_AT_GNU_ranges_base, 0x2132)
+DW_AT (DW_AT_GNU_addr_base, 0x2133)
+DW_AT (DW_AT_GNU_pubnames, 0x2134)
+DW_AT (DW_AT_GNU_pubtypes, 0x2135)
+/* Attribute for discriminator.
+ See http://gcc.gnu.org/wiki/Discriminator */
+DW_AT (DW_AT_GNU_discriminator, 0x2136)
+/* VMS extensions. */
+DW_AT (DW_AT_VMS_rtnbeg_pd_address, 0x2201)
+/* GNAT extensions. */
+/* GNAT descriptive type.
+ See http://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type . */
+DW_AT (DW_AT_use_GNAT_descriptive_type, 0x2301)
+DW_AT (DW_AT_GNAT_descriptive_type, 0x2302)
+/* UPC extension. */
+DW_AT (DW_AT_upc_threads_scaled, 0x3210)
+/* PGI (STMicroelectronics) extensions. */
+DW_AT (DW_AT_PGI_lbase, 0x3a00)
+DW_AT (DW_AT_PGI_soffset, 0x3a01)
+DW_AT (DW_AT_PGI_lstride, 0x3a02)
+DW_END_AT
+
+DW_FIRST_OP (DW_OP_addr, 0x03)
+DW_OP (DW_OP_deref, 0x06)
+DW_OP (DW_OP_const1u, 0x08)
+DW_OP (DW_OP_const1s, 0x09)
+DW_OP (DW_OP_const2u, 0x0a)
+DW_OP (DW_OP_const2s, 0x0b)
+DW_OP (DW_OP_const4u, 0x0c)
+DW_OP (DW_OP_const4s, 0x0d)
+DW_OP (DW_OP_const8u, 0x0e)
+DW_OP (DW_OP_const8s, 0x0f)
+DW_OP (DW_OP_constu, 0x10)
+DW_OP (DW_OP_consts, 0x11)
+DW_OP (DW_OP_dup, 0x12)
+DW_OP (DW_OP_drop, 0x13)
+DW_OP (DW_OP_over, 0x14)
+DW_OP (DW_OP_pick, 0x15)
+DW_OP (DW_OP_swap, 0x16)
+DW_OP (DW_OP_rot, 0x17)
+DW_OP (DW_OP_xderef, 0x18)
+DW_OP (DW_OP_abs, 0x19)
+DW_OP (DW_OP_and, 0x1a)
+DW_OP (DW_OP_div, 0x1b)
+DW_OP (DW_OP_minus, 0x1c)
+DW_OP (DW_OP_mod, 0x1d)
+DW_OP (DW_OP_mul, 0x1e)
+DW_OP (DW_OP_neg, 0x1f)
+DW_OP (DW_OP_not, 0x20)
+DW_OP (DW_OP_or, 0x21)
+DW_OP (DW_OP_plus, 0x22)
+DW_OP (DW_OP_plus_uconst, 0x23)
+DW_OP (DW_OP_shl, 0x24)
+DW_OP (DW_OP_shr, 0x25)
+DW_OP (DW_OP_shra, 0x26)
+DW_OP (DW_OP_xor, 0x27)
+DW_OP (DW_OP_bra, 0x28)
+DW_OP (DW_OP_eq, 0x29)
+DW_OP (DW_OP_ge, 0x2a)
+DW_OP (DW_OP_gt, 0x2b)
+DW_OP (DW_OP_le, 0x2c)
+DW_OP (DW_OP_lt, 0x2d)
+DW_OP (DW_OP_ne, 0x2e)
+DW_OP (DW_OP_skip, 0x2f)
+DW_OP (DW_OP_lit0, 0x30)
+DW_OP (DW_OP_lit1, 0x31)
+DW_OP (DW_OP_lit2, 0x32)
+DW_OP (DW_OP_lit3, 0x33)
+DW_OP (DW_OP_lit4, 0x34)
+DW_OP (DW_OP_lit5, 0x35)
+DW_OP (DW_OP_lit6, 0x36)
+DW_OP (DW_OP_lit7, 0x37)
+DW_OP (DW_OP_lit8, 0x38)
+DW_OP (DW_OP_lit9, 0x39)
+DW_OP (DW_OP_lit10, 0x3a)
+DW_OP (DW_OP_lit11, 0x3b)
+DW_OP (DW_OP_lit12, 0x3c)
+DW_OP (DW_OP_lit13, 0x3d)
+DW_OP (DW_OP_lit14, 0x3e)
+DW_OP (DW_OP_lit15, 0x3f)
+DW_OP (DW_OP_lit16, 0x40)
+DW_OP (DW_OP_lit17, 0x41)
+DW_OP (DW_OP_lit18, 0x42)
+DW_OP (DW_OP_lit19, 0x43)
+DW_OP (DW_OP_lit20, 0x44)
+DW_OP (DW_OP_lit21, 0x45)
+DW_OP (DW_OP_lit22, 0x46)
+DW_OP (DW_OP_lit23, 0x47)
+DW_OP (DW_OP_lit24, 0x48)
+DW_OP (DW_OP_lit25, 0x49)
+DW_OP (DW_OP_lit26, 0x4a)
+DW_OP (DW_OP_lit27, 0x4b)
+DW_OP (DW_OP_lit28, 0x4c)
+DW_OP (DW_OP_lit29, 0x4d)
+DW_OP (DW_OP_lit30, 0x4e)
+DW_OP (DW_OP_lit31, 0x4f)
+DW_OP (DW_OP_reg0, 0x50)
+DW_OP (DW_OP_reg1, 0x51)
+DW_OP (DW_OP_reg2, 0x52)
+DW_OP (DW_OP_reg3, 0x53)
+DW_OP (DW_OP_reg4, 0x54)
+DW_OP (DW_OP_reg5, 0x55)
+DW_OP (DW_OP_reg6, 0x56)
+DW_OP (DW_OP_reg7, 0x57)
+DW_OP (DW_OP_reg8, 0x58)
+DW_OP (DW_OP_reg9, 0x59)
+DW_OP (DW_OP_reg10, 0x5a)
+DW_OP (DW_OP_reg11, 0x5b)
+DW_OP (DW_OP_reg12, 0x5c)
+DW_OP (DW_OP_reg13, 0x5d)
+DW_OP (DW_OP_reg14, 0x5e)
+DW_OP (DW_OP_reg15, 0x5f)
+DW_OP (DW_OP_reg16, 0x60)
+DW_OP (DW_OP_reg17, 0x61)
+DW_OP (DW_OP_reg18, 0x62)
+DW_OP (DW_OP_reg19, 0x63)
+DW_OP (DW_OP_reg20, 0x64)
+DW_OP (DW_OP_reg21, 0x65)
+DW_OP (DW_OP_reg22, 0x66)
+DW_OP (DW_OP_reg23, 0x67)
+DW_OP (DW_OP_reg24, 0x68)
+DW_OP (DW_OP_reg25, 0x69)
+DW_OP (DW_OP_reg26, 0x6a)
+DW_OP (DW_OP_reg27, 0x6b)
+DW_OP (DW_OP_reg28, 0x6c)
+DW_OP (DW_OP_reg29, 0x6d)
+DW_OP (DW_OP_reg30, 0x6e)
+DW_OP (DW_OP_reg31, 0x6f)
+DW_OP (DW_OP_breg0, 0x70)
+DW_OP (DW_OP_breg1, 0x71)
+DW_OP (DW_OP_breg2, 0x72)
+DW_OP (DW_OP_breg3, 0x73)
+DW_OP (DW_OP_breg4, 0x74)
+DW_OP (DW_OP_breg5, 0x75)
+DW_OP (DW_OP_breg6, 0x76)
+DW_OP (DW_OP_breg7, 0x77)
+DW_OP (DW_OP_breg8, 0x78)
+DW_OP (DW_OP_breg9, 0x79)
+DW_OP (DW_OP_breg10, 0x7a)
+DW_OP (DW_OP_breg11, 0x7b)
+DW_OP (DW_OP_breg12, 0x7c)
+DW_OP (DW_OP_breg13, 0x7d)
+DW_OP (DW_OP_breg14, 0x7e)
+DW_OP (DW_OP_breg15, 0x7f)
+DW_OP (DW_OP_breg16, 0x80)
+DW_OP (DW_OP_breg17, 0x81)
+DW_OP (DW_OP_breg18, 0x82)
+DW_OP (DW_OP_breg19, 0x83)
+DW_OP (DW_OP_breg20, 0x84)
+DW_OP (DW_OP_breg21, 0x85)
+DW_OP (DW_OP_breg22, 0x86)
+DW_OP (DW_OP_breg23, 0x87)
+DW_OP (DW_OP_breg24, 0x88)
+DW_OP (DW_OP_breg25, 0x89)
+DW_OP (DW_OP_breg26, 0x8a)
+DW_OP (DW_OP_breg27, 0x8b)
+DW_OP (DW_OP_breg28, 0x8c)
+DW_OP (DW_OP_breg29, 0x8d)
+DW_OP (DW_OP_breg30, 0x8e)
+DW_OP (DW_OP_breg31, 0x8f)
+DW_OP (DW_OP_regx, 0x90)
+DW_OP (DW_OP_fbreg, 0x91)
+DW_OP (DW_OP_bregx, 0x92)
+DW_OP (DW_OP_piece, 0x93)
+DW_OP (DW_OP_deref_size, 0x94)
+DW_OP (DW_OP_xderef_size, 0x95)
+DW_OP (DW_OP_nop, 0x96)
+/* DWARF 3 extensions. */
+DW_OP (DW_OP_push_object_address, 0x97)
+DW_OP (DW_OP_call2, 0x98)
+DW_OP (DW_OP_call4, 0x99)
+DW_OP (DW_OP_call_ref, 0x9a)
+DW_OP (DW_OP_form_tls_address, 0x9b)
+DW_OP (DW_OP_call_frame_cfa, 0x9c)
+DW_OP (DW_OP_bit_piece, 0x9d)
+
+/* DWARF 4 extensions. */
+DW_OP (DW_OP_implicit_value, 0x9e)
+DW_OP (DW_OP_stack_value, 0x9f)
+
+DW_OP_DUP (DW_OP_lo_user, 0xe0) /* Implementation-defined range start. */
+DW_OP_DUP (DW_OP_hi_user, 0xff) /* Implementation-defined range end. */
+
+/* GNU extensions. */
+DW_OP (DW_OP_GNU_push_tls_address, 0xe0)
+/* The following is for marking variables that are uninitialized. */
+DW_OP (DW_OP_GNU_uninit, 0xf0)
+DW_OP (DW_OP_GNU_encoded_addr, 0xf1)
+/* The GNU implicit pointer extension.
+ See http://www.dwarfstd.org/ShowIssue.php?issue=100831.1&type=open . */
+DW_OP (DW_OP_GNU_implicit_pointer, 0xf2)
+/* The GNU entry value extension.
+ See http://www.dwarfstd.org/ShowIssue.php?issue=100909.1&type=open . */
+DW_OP (DW_OP_GNU_entry_value, 0xf3)
+/* The GNU typed stack extension.
+ See http://www.dwarfstd.org/doc/040408.1.html . */
+DW_OP (DW_OP_GNU_const_type, 0xf4)
+DW_OP (DW_OP_GNU_regval_type, 0xf5)
+DW_OP (DW_OP_GNU_deref_type, 0xf6)
+DW_OP (DW_OP_GNU_convert, 0xf7)
+DW_OP (DW_OP_GNU_reinterpret, 0xf9)
+/* The GNU parameter ref extension. */
+DW_OP (DW_OP_GNU_parameter_ref, 0xfa)
+/* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
+DW_OP (DW_OP_GNU_addr_index, 0xfb)
+DW_OP (DW_OP_GNU_const_index, 0xfc)
+/* HP extensions. */
+DW_OP_DUP (DW_OP_HP_unknown, 0xe0) /* Ouch, the same as GNU_push_tls_address. */
+DW_OP (DW_OP_HP_is_value, 0xe1)
+DW_OP (DW_OP_HP_fltconst4, 0xe2)
+DW_OP (DW_OP_HP_fltconst8, 0xe3)
+DW_OP (DW_OP_HP_mod_range, 0xe4)
+DW_OP (DW_OP_HP_unmod_range, 0xe5)
+DW_OP (DW_OP_HP_tls, 0xe6)
+/* PGI (STMicroelectronics) extensions. */
+DW_OP (DW_OP_PGI_omp_thread_num, 0xf8)
+DW_END_OP
+
+DW_FIRST_ATE (DW_ATE_void, 0x0)
+DW_ATE (DW_ATE_address, 0x1)
+DW_ATE (DW_ATE_boolean, 0x2)
+DW_ATE (DW_ATE_complex_float, 0x3)
+DW_ATE (DW_ATE_float, 0x4)
+DW_ATE (DW_ATE_signed, 0x5)
+DW_ATE (DW_ATE_signed_char, 0x6)
+DW_ATE (DW_ATE_unsigned, 0x7)
+DW_ATE (DW_ATE_unsigned_char, 0x8)
+/* DWARF 3. */
+DW_ATE (DW_ATE_imaginary_float, 0x9)
+DW_ATE (DW_ATE_packed_decimal, 0xa)
+DW_ATE (DW_ATE_numeric_string, 0xb)
+DW_ATE (DW_ATE_edited, 0xc)
+DW_ATE (DW_ATE_signed_fixed, 0xd)
+DW_ATE (DW_ATE_unsigned_fixed, 0xe)
+DW_ATE (DW_ATE_decimal_float, 0xf)
+/* DWARF 4. */
+DW_ATE (DW_ATE_UTF, 0x10)
+
+DW_ATE_DUP (DW_ATE_lo_user, 0x80)
+DW_ATE_DUP (DW_ATE_hi_user, 0xff)
+
+/* HP extensions. */
+DW_ATE (DW_ATE_HP_float80, 0x80) /* Floating-point (80 bit). */
+DW_ATE (DW_ATE_HP_complex_float80, 0x81) /* Complex floating-point (80 bit). */
+DW_ATE (DW_ATE_HP_float128, 0x82) /* Floating-point (128 bit). */
+DW_ATE (DW_ATE_HP_complex_float128, 0x83) /* Complex fp (128 bit). */
+DW_ATE (DW_ATE_HP_floathpintel, 0x84) /* Floating-point (82 bit IA64). */
+DW_ATE (DW_ATE_HP_imaginary_float80, 0x85)
+DW_ATE (DW_ATE_HP_imaginary_float128, 0x86)
+DW_ATE (DW_ATE_HP_VAX_float, 0x88) /* F or G floating. */
+DW_ATE (DW_ATE_HP_VAX_float_d, 0x89) /* D floating. */
+DW_ATE (DW_ATE_HP_packed_decimal, 0x8a) /* Cobol. */
+DW_ATE (DW_ATE_HP_zoned_decimal, 0x8b) /* Cobol. */
+DW_ATE (DW_ATE_HP_edited, 0x8c) /* Cobol. */
+DW_ATE (DW_ATE_HP_signed_fixed, 0x8d) /* Cobol. */
+DW_ATE (DW_ATE_HP_unsigned_fixed, 0x8e) /* Cobol. */
+DW_ATE (DW_ATE_HP_VAX_complex_float, 0x8f) /* F or G floating complex. */
+DW_ATE (DW_ATE_HP_VAX_complex_float_d, 0x90) /* D floating complex. */
+
+DW_END_ATE
+
+DW_FIRST_CFA (DW_CFA_advance_loc, 0x40)
+DW_CFA (DW_CFA_offset, 0x80)
+DW_CFA (DW_CFA_restore, 0xc0)
+DW_CFA (DW_CFA_nop, 0x00)
+DW_CFA (DW_CFA_set_loc, 0x01)
+DW_CFA (DW_CFA_advance_loc1, 0x02)
+DW_CFA (DW_CFA_advance_loc2, 0x03)
+DW_CFA (DW_CFA_advance_loc4, 0x04)
+DW_CFA (DW_CFA_offset_extended, 0x05)
+DW_CFA (DW_CFA_restore_extended, 0x06)
+DW_CFA (DW_CFA_undefined, 0x07)
+DW_CFA (DW_CFA_same_value, 0x08)
+DW_CFA (DW_CFA_register, 0x09)
+DW_CFA (DW_CFA_remember_state, 0x0a)
+DW_CFA (DW_CFA_restore_state, 0x0b)
+DW_CFA (DW_CFA_def_cfa, 0x0c)
+DW_CFA (DW_CFA_def_cfa_register, 0x0d)
+DW_CFA (DW_CFA_def_cfa_offset, 0x0e)
+/* DWARF 3. */
+DW_CFA (DW_CFA_def_cfa_expression, 0x0f)
+DW_CFA (DW_CFA_expression, 0x10)
+DW_CFA (DW_CFA_offset_extended_sf, 0x11)
+DW_CFA (DW_CFA_def_cfa_sf, 0x12)
+DW_CFA (DW_CFA_def_cfa_offset_sf, 0x13)
+DW_CFA (DW_CFA_val_offset, 0x14)
+DW_CFA (DW_CFA_val_offset_sf, 0x15)
+DW_CFA (DW_CFA_val_expression, 0x16)
+
+DW_CFA (DW_CFA_lo_user, 0x1c)
+DW_CFA (DW_CFA_hi_user, 0x3f)
+
+/* SGI/MIPS specific. */
+DW_CFA (DW_CFA_MIPS_advance_loc8, 0x1d)
+/* GNU extensions. */
+DW_CFA (DW_CFA_GNU_window_save, 0x2d)
+DW_CFA (DW_CFA_GNU_args_size, 0x2e)
+DW_CFA (DW_CFA_GNU_negative_offset_extended, 0x2f)
+
+DW_END_CFA
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 8c0c9ed6da..120e2c16b4 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -1,7 +1,7 @@
/* Declarations and definitions of codes relating to the DWARF2 and
DWARF3 symbolic debugging information formats.
Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
- 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Gary Funck (gary@intrepid.com) The Ada Joint Program
@@ -41,599 +41,71 @@
This file also now contains definitions from the DWARF 3 specification
published Dec 20, 2005, available from: http://dwarf.freestandards.org. */
-/* This file is shared between GCC and GDB, and should not contain
- prototypes. */
-
#ifndef _DWARF2_H
#define _DWARF2_H
-/* Tag names and codes. */
-enum dwarf_tag
- {
- DW_TAG_padding = 0x00,
- DW_TAG_array_type = 0x01,
- DW_TAG_class_type = 0x02,
- DW_TAG_entry_point = 0x03,
- DW_TAG_enumeration_type = 0x04,
- DW_TAG_formal_parameter = 0x05,
- DW_TAG_imported_declaration = 0x08,
- DW_TAG_label = 0x0a,
- DW_TAG_lexical_block = 0x0b,
- DW_TAG_member = 0x0d,
- DW_TAG_pointer_type = 0x0f,
- DW_TAG_reference_type = 0x10,
- DW_TAG_compile_unit = 0x11,
- DW_TAG_string_type = 0x12,
- DW_TAG_structure_type = 0x13,
- DW_TAG_subroutine_type = 0x15,
- DW_TAG_typedef = 0x16,
- DW_TAG_union_type = 0x17,
- DW_TAG_unspecified_parameters = 0x18,
- DW_TAG_variant = 0x19,
- DW_TAG_common_block = 0x1a,
- DW_TAG_common_inclusion = 0x1b,
- DW_TAG_inheritance = 0x1c,
- DW_TAG_inlined_subroutine = 0x1d,
- DW_TAG_module = 0x1e,
- DW_TAG_ptr_to_member_type = 0x1f,
- DW_TAG_set_type = 0x20,
- DW_TAG_subrange_type = 0x21,
- DW_TAG_with_stmt = 0x22,
- DW_TAG_access_declaration = 0x23,
- DW_TAG_base_type = 0x24,
- DW_TAG_catch_block = 0x25,
- DW_TAG_const_type = 0x26,
- DW_TAG_constant = 0x27,
- DW_TAG_enumerator = 0x28,
- DW_TAG_file_type = 0x29,
- DW_TAG_friend = 0x2a,
- DW_TAG_namelist = 0x2b,
- DW_TAG_namelist_item = 0x2c,
- DW_TAG_packed_type = 0x2d,
- DW_TAG_subprogram = 0x2e,
- DW_TAG_template_type_param = 0x2f,
- DW_TAG_template_value_param = 0x30,
- DW_TAG_thrown_type = 0x31,
- DW_TAG_try_block = 0x32,
- DW_TAG_variant_part = 0x33,
- DW_TAG_variable = 0x34,
- DW_TAG_volatile_type = 0x35,
- /* DWARF 3. */
- DW_TAG_dwarf_procedure = 0x36,
- DW_TAG_restrict_type = 0x37,
- DW_TAG_interface_type = 0x38,
- DW_TAG_namespace = 0x39,
- DW_TAG_imported_module = 0x3a,
- DW_TAG_unspecified_type = 0x3b,
- DW_TAG_partial_unit = 0x3c,
- DW_TAG_imported_unit = 0x3d,
- DW_TAG_condition = 0x3f,
- DW_TAG_shared_type = 0x40,
- /* DWARF 4. */
- DW_TAG_type_unit = 0x41,
- DW_TAG_rvalue_reference_type = 0x42,
- DW_TAG_template_alias = 0x43,
-
- DW_TAG_lo_user = 0x4080,
- DW_TAG_hi_user = 0xffff,
-
- /* SGI/MIPS Extensions. */
- DW_TAG_MIPS_loop = 0x4081,
-
- /* HP extensions. See: ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz . */
- DW_TAG_HP_array_descriptor = 0x4090,
- DW_TAG_HP_Bliss_field = 0x4091,
- DW_TAG_HP_Bliss_field_set = 0x4092,
-
- /* GNU extensions. */
- DW_TAG_format_label = 0x4101, /* For FORTRAN 77 and Fortran 90. */
- DW_TAG_function_template = 0x4102, /* For C++. */
- DW_TAG_class_template = 0x4103, /* For C++. */
- DW_TAG_GNU_BINCL = 0x4104,
- DW_TAG_GNU_EINCL = 0x4105,
- /* Template template parameter.
- See http://gcc.gnu.org/wiki/TemplateParmsDwarf . */
- DW_TAG_GNU_template_template_param = 0x4106,
-
- /* Template parameter pack extension, specified at
- http://wiki.dwarfstd.org/index.php?title=C%2B%2B0x:_Variadic_templates
- The values of these two TAGS are in the DW_TAG_GNU_* space until the tags
- are properly part of DWARF 5. */
- DW_TAG_GNU_template_parameter_pack = 0x4107,
- DW_TAG_GNU_formal_parameter_pack = 0x4108,
- /* The GNU call site extension, specified at
- http://www.dwarfstd.org/ShowIssue.php?issue=100909.2&type=open .
- The values of these two TAGS are in the DW_TAG_GNU_* space until the tags
- are properly part of DWARF 5. */
- DW_TAG_GNU_call_site = 0x4109,
- DW_TAG_GNU_call_site_parameter = 0x410a,
- /* Extensions for UPC. See: http://upc.gwu.edu/~upc. */
- DW_TAG_upc_shared_type = 0x8765,
- DW_TAG_upc_strict_type = 0x8766,
- DW_TAG_upc_relaxed_type = 0x8767,
- /* PGI (STMicroelectronics) extensions. No documentation available. */
- DW_TAG_PGI_kanji_type = 0xA000,
- DW_TAG_PGI_interface_block = 0xA020
- };
+#define DW_TAG(name, value) , name = value
+#define DW_TAG_DUP(name, value) , name = value
+#define DW_FORM(name, value) , name = value
+#define DW_AT(name, value) , name = value
+#define DW_AT_DUP(name, value) , name = value
+#define DW_OP(name, value) , name = value
+#define DW_OP_DUP(name, value) , name = value
+#define DW_ATE(name, value) , name = value
+#define DW_ATE_DUP(name, value) , name = value
+#define DW_CFA(name, value) , name = value
+
+#define DW_FIRST_TAG(name, value) enum dwarf_tag { \
+ name = value
+#define DW_END_TAG };
+#define DW_FIRST_FORM(name, value) enum dwarf_form { \
+ name = value
+#define DW_END_FORM };
+#define DW_FIRST_AT(name, value) enum dwarf_attribute { \
+ name = value
+#define DW_END_AT };
+#define DW_FIRST_OP(name, value) enum dwarf_location_atom { \
+ name = value
+#define DW_END_OP };
+#define DW_FIRST_ATE(name, value) enum dwarf_type { \
+ name = value
+#define DW_END_ATE };
+#define DW_FIRST_CFA(name, value) enum dwarf_call_frame_info { \
+ name = value
+#define DW_END_CFA };
+
+#include "dwarf2.def"
+
+#undef DW_FIRST_TAG
+#undef DW_END_TAG
+#undef DW_FIRST_FORM
+#undef DW_END_FORM
+#undef DW_FIRST_AT
+#undef DW_END_AT
+#undef DW_FIRST_OP
+#undef DW_END_OP
+#undef DW_FIRST_ATE
+#undef DW_END_ATE
+#undef DW_FIRST_CFA
+#undef DW_END_CFA
+
+#undef DW_TAG
+#undef DW_TAG_DUP
+#undef DW_FORM
+#undef DW_AT
+#undef DW_AT_DUP
+#undef DW_OP
+#undef DW_OP_DUP
+#undef DW_ATE
+#undef DW_ATE_DUP
+#undef DW_CFA
/* Flag that tells whether entry has a child or not. */
#define DW_children_no 0
#define DW_children_yes 1
-/* Form names and codes. */
-enum dwarf_form
- {
- DW_FORM_addr = 0x01,
- DW_FORM_block2 = 0x03,
- DW_FORM_block4 = 0x04,
- DW_FORM_data2 = 0x05,
- DW_FORM_data4 = 0x06,
- DW_FORM_data8 = 0x07,
- DW_FORM_string = 0x08,
- DW_FORM_block = 0x09,
- DW_FORM_block1 = 0x0a,
- DW_FORM_data1 = 0x0b,
- DW_FORM_flag = 0x0c,
- DW_FORM_sdata = 0x0d,
- DW_FORM_strp = 0x0e,
- DW_FORM_udata = 0x0f,
- DW_FORM_ref_addr = 0x10,
- DW_FORM_ref1 = 0x11,
- DW_FORM_ref2 = 0x12,
- DW_FORM_ref4 = 0x13,
- DW_FORM_ref8 = 0x14,
- DW_FORM_ref_udata = 0x15,
- DW_FORM_indirect = 0x16,
- /* DWARF 4. */
- DW_FORM_sec_offset = 0x17,
- DW_FORM_exprloc = 0x18,
- DW_FORM_flag_present = 0x19,
- DW_FORM_ref_sig8 = 0x20,
- /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
- DW_FORM_GNU_ref_index = 0x1f00,
- DW_FORM_GNU_addr_index = 0x1f01,
- DW_FORM_GNU_str_index = 0x1f02
- };
-
-/* Attribute names and codes. */
-enum dwarf_attribute
- {
- DW_AT_sibling = 0x01,
- DW_AT_location = 0x02,
- DW_AT_name = 0x03,
- DW_AT_ordering = 0x09,
- DW_AT_subscr_data = 0x0a,
- DW_AT_byte_size = 0x0b,
- DW_AT_bit_offset = 0x0c,
- DW_AT_bit_size = 0x0d,
- DW_AT_element_list = 0x0f,
- DW_AT_stmt_list = 0x10,
- DW_AT_low_pc = 0x11,
- DW_AT_high_pc = 0x12,
- DW_AT_language = 0x13,
- DW_AT_member = 0x14,
- DW_AT_discr = 0x15,
- DW_AT_discr_value = 0x16,
- DW_AT_visibility = 0x17,
- DW_AT_import = 0x18,
- DW_AT_string_length = 0x19,
- DW_AT_common_reference = 0x1a,
- DW_AT_comp_dir = 0x1b,
- DW_AT_const_value = 0x1c,
- DW_AT_containing_type = 0x1d,
- DW_AT_default_value = 0x1e,
- DW_AT_inline = 0x20,
- DW_AT_is_optional = 0x21,
- DW_AT_lower_bound = 0x22,
- DW_AT_producer = 0x25,
- DW_AT_prototyped = 0x27,
- DW_AT_return_addr = 0x2a,
- DW_AT_start_scope = 0x2c,
- DW_AT_bit_stride = 0x2e,
#define DW_AT_stride_size DW_AT_bit_stride /* Note: The use of DW_AT_stride_size is deprecated. */
- DW_AT_upper_bound = 0x2f,
- DW_AT_abstract_origin = 0x31,
- DW_AT_accessibility = 0x32,
- DW_AT_address_class = 0x33,
- DW_AT_artificial = 0x34,
- DW_AT_base_types = 0x35,
- DW_AT_calling_convention = 0x36,
- DW_AT_count = 0x37,
- DW_AT_data_member_location = 0x38,
- DW_AT_decl_column = 0x39,
- DW_AT_decl_file = 0x3a,
- DW_AT_decl_line = 0x3b,
- DW_AT_declaration = 0x3c,
- DW_AT_discr_list = 0x3d,
- DW_AT_encoding = 0x3e,
- DW_AT_external = 0x3f,
- DW_AT_frame_base = 0x40,
- DW_AT_friend = 0x41,
- DW_AT_identifier_case = 0x42,
- DW_AT_macro_info = 0x43,
- DW_AT_namelist_items = 0x44,
- DW_AT_priority = 0x45,
- DW_AT_segment = 0x46,
- DW_AT_specification = 0x47,
- DW_AT_static_link = 0x48,
- DW_AT_type = 0x49,
- DW_AT_use_location = 0x4a,
- DW_AT_variable_parameter = 0x4b,
- DW_AT_virtuality = 0x4c,
- DW_AT_vtable_elem_location = 0x4d,
- /* DWARF 3 values. */
- DW_AT_allocated = 0x4e,
- DW_AT_associated = 0x4f,
- DW_AT_data_location = 0x50,
- DW_AT_byte_stride = 0x51,
#define DW_AT_stride DW_AT_byte_stride /* Note: The use of DW_AT_stride is deprecated. */
- DW_AT_entry_pc = 0x52,
- DW_AT_use_UTF8 = 0x53,
- DW_AT_extension = 0x54,
- DW_AT_ranges = 0x55,
- DW_AT_trampoline = 0x56,
- DW_AT_call_column = 0x57,
- DW_AT_call_file = 0x58,
- DW_AT_call_line = 0x59,
- DW_AT_description = 0x5a,
- DW_AT_binary_scale = 0x5b,
- DW_AT_decimal_scale = 0x5c,
- DW_AT_small = 0x5d,
- DW_AT_decimal_sign = 0x5e,
- DW_AT_digit_count = 0x5f,
- DW_AT_picture_string = 0x60,
- DW_AT_mutable = 0x61,
- DW_AT_threads_scaled = 0x62,
- DW_AT_explicit = 0x63,
- DW_AT_object_pointer = 0x64,
- DW_AT_endianity = 0x65,
- DW_AT_elemental = 0x66,
- DW_AT_pure = 0x67,
- DW_AT_recursive = 0x68,
- /* DWARF 4. */
- DW_AT_signature = 0x69,
- DW_AT_main_subprogram = 0x6a,
- DW_AT_data_bit_offset = 0x6b,
- DW_AT_const_expr = 0x6c,
- DW_AT_enum_class = 0x6d,
- DW_AT_linkage_name = 0x6e,
-
- DW_AT_lo_user = 0x2000, /* Implementation-defined range start. */
- DW_AT_hi_user = 0x3fff, /* Implementation-defined range end. */
-
- /* SGI/MIPS extensions. */
- DW_AT_MIPS_fde = 0x2001,
- DW_AT_MIPS_loop_begin = 0x2002,
- DW_AT_MIPS_tail_loop_begin = 0x2003,
- DW_AT_MIPS_epilog_begin = 0x2004,
- DW_AT_MIPS_loop_unroll_factor = 0x2005,
- DW_AT_MIPS_software_pipeline_depth = 0x2006,
- DW_AT_MIPS_linkage_name = 0x2007,
- DW_AT_MIPS_stride = 0x2008,
- DW_AT_MIPS_abstract_name = 0x2009,
- DW_AT_MIPS_clone_origin = 0x200a,
- DW_AT_MIPS_has_inlines = 0x200b,
- /* HP extensions. */
- DW_AT_HP_block_index = 0x2000,
- DW_AT_HP_unmodifiable = 0x2001, /* Same as DW_AT_MIPS_fde. */
- DW_AT_HP_prologue = 0x2005, /* Same as DW_AT_MIPS_loop_unroll. */
- DW_AT_HP_epilogue = 0x2008, /* Same as DW_AT_MIPS_stride. */
- DW_AT_HP_actuals_stmt_list = 0x2010,
- DW_AT_HP_proc_per_section = 0x2011,
- DW_AT_HP_raw_data_ptr = 0x2012,
- DW_AT_HP_pass_by_reference = 0x2013,
- DW_AT_HP_opt_level = 0x2014,
- DW_AT_HP_prof_version_id = 0x2015,
- DW_AT_HP_opt_flags = 0x2016,
- DW_AT_HP_cold_region_low_pc = 0x2017,
- DW_AT_HP_cold_region_high_pc = 0x2018,
- DW_AT_HP_all_variables_modifiable = 0x2019,
- DW_AT_HP_linkage_name = 0x201a,
- DW_AT_HP_prof_flags = 0x201b, /* In comp unit of procs_info for -g. */
- DW_AT_HP_unit_name = 0x201f,
- DW_AT_HP_unit_size = 0x2020,
- DW_AT_HP_widened_byte_size = 0x2021,
- DW_AT_HP_definition_points = 0x2022,
- DW_AT_HP_default_location = 0x2023,
- DW_AT_HP_is_result_param = 0x2029,
-
- /* GNU extensions. */
- DW_AT_sf_names = 0x2101,
- DW_AT_src_info = 0x2102,
- DW_AT_mac_info = 0x2103,
- DW_AT_src_coords = 0x2104,
- DW_AT_body_begin = 0x2105,
- DW_AT_body_end = 0x2106,
- DW_AT_GNU_vector = 0x2107,
- /* Thread-safety annotations.
- See http://gcc.gnu.org/wiki/ThreadSafetyAnnotation . */
- DW_AT_GNU_guarded_by = 0x2108,
- DW_AT_GNU_pt_guarded_by = 0x2109,
- DW_AT_GNU_guarded = 0x210a,
- DW_AT_GNU_pt_guarded = 0x210b,
- DW_AT_GNU_locks_excluded = 0x210c,
- DW_AT_GNU_exclusive_locks_required = 0x210d,
- DW_AT_GNU_shared_locks_required = 0x210e,
- /* One-definition rule violation detection.
- See http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo . */
- DW_AT_GNU_odr_signature = 0x210f,
- /* Template template argument name.
- See http://gcc.gnu.org/wiki/TemplateParmsDwarf . */
- DW_AT_GNU_template_name = 0x2110,
- /* The GNU call site extension.
- See http://www.dwarfstd.org/ShowIssue.php?issue=100909.2&type=open . */
- DW_AT_GNU_call_site_value = 0x2111,
- DW_AT_GNU_call_site_data_value = 0x2112,
- DW_AT_GNU_call_site_target = 0x2113,
- DW_AT_GNU_call_site_target_clobbered = 0x2114,
- DW_AT_GNU_tail_call = 0x2115,
- DW_AT_GNU_all_tail_call_sites = 0x2116,
- DW_AT_GNU_all_call_sites = 0x2117,
- DW_AT_GNU_all_source_call_sites = 0x2118,
- /* Section offset into .debug_macro section. */
- DW_AT_GNU_macros = 0x2119,
- /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
- DW_AT_GNU_dwo_name = 0x2130,
- DW_AT_GNU_dwo_id = 0x2131,
- DW_AT_GNU_ref_base = 0x2132,
- DW_AT_GNU_addr_base = 0x2133,
- DW_AT_GNU_pubnames = 0x2134,
- DW_AT_GNU_pubtypes = 0x2135,
- /* VMS extensions. */
- DW_AT_VMS_rtnbeg_pd_address = 0x2201,
- /* GNAT extensions. */
- /* GNAT descriptive type.
- See http://gcc.gnu.org/wiki/DW_AT_GNAT_descriptive_type . */
- DW_AT_use_GNAT_descriptive_type = 0x2301,
- DW_AT_GNAT_descriptive_type = 0x2302,
- /* UPC extension. */
- DW_AT_upc_threads_scaled = 0x3210,
- /* PGI (STMicroelectronics) extensions. */
- DW_AT_PGI_lbase = 0x3a00,
- DW_AT_PGI_soffset = 0x3a01,
- DW_AT_PGI_lstride = 0x3a02
- };
-
-/* Location atom names and codes. */
-enum dwarf_location_atom
- {
- DW_OP_addr = 0x03,
- DW_OP_deref = 0x06,
- DW_OP_const1u = 0x08,
- DW_OP_const1s = 0x09,
- DW_OP_const2u = 0x0a,
- DW_OP_const2s = 0x0b,
- DW_OP_const4u = 0x0c,
- DW_OP_const4s = 0x0d,
- DW_OP_const8u = 0x0e,
- DW_OP_const8s = 0x0f,
- DW_OP_constu = 0x10,
- DW_OP_consts = 0x11,
- DW_OP_dup = 0x12,
- DW_OP_drop = 0x13,
- DW_OP_over = 0x14,
- DW_OP_pick = 0x15,
- DW_OP_swap = 0x16,
- DW_OP_rot = 0x17,
- DW_OP_xderef = 0x18,
- DW_OP_abs = 0x19,
- DW_OP_and = 0x1a,
- DW_OP_div = 0x1b,
- DW_OP_minus = 0x1c,
- DW_OP_mod = 0x1d,
- DW_OP_mul = 0x1e,
- DW_OP_neg = 0x1f,
- DW_OP_not = 0x20,
- DW_OP_or = 0x21,
- DW_OP_plus = 0x22,
- DW_OP_plus_uconst = 0x23,
- DW_OP_shl = 0x24,
- DW_OP_shr = 0x25,
- DW_OP_shra = 0x26,
- DW_OP_xor = 0x27,
- DW_OP_bra = 0x28,
- DW_OP_eq = 0x29,
- DW_OP_ge = 0x2a,
- DW_OP_gt = 0x2b,
- DW_OP_le = 0x2c,
- DW_OP_lt = 0x2d,
- DW_OP_ne = 0x2e,
- DW_OP_skip = 0x2f,
- DW_OP_lit0 = 0x30,
- DW_OP_lit1 = 0x31,
- DW_OP_lit2 = 0x32,
- DW_OP_lit3 = 0x33,
- DW_OP_lit4 = 0x34,
- DW_OP_lit5 = 0x35,
- DW_OP_lit6 = 0x36,
- DW_OP_lit7 = 0x37,
- DW_OP_lit8 = 0x38,
- DW_OP_lit9 = 0x39,
- DW_OP_lit10 = 0x3a,
- DW_OP_lit11 = 0x3b,
- DW_OP_lit12 = 0x3c,
- DW_OP_lit13 = 0x3d,
- DW_OP_lit14 = 0x3e,
- DW_OP_lit15 = 0x3f,
- DW_OP_lit16 = 0x40,
- DW_OP_lit17 = 0x41,
- DW_OP_lit18 = 0x42,
- DW_OP_lit19 = 0x43,
- DW_OP_lit20 = 0x44,
- DW_OP_lit21 = 0x45,
- DW_OP_lit22 = 0x46,
- DW_OP_lit23 = 0x47,
- DW_OP_lit24 = 0x48,
- DW_OP_lit25 = 0x49,
- DW_OP_lit26 = 0x4a,
- DW_OP_lit27 = 0x4b,
- DW_OP_lit28 = 0x4c,
- DW_OP_lit29 = 0x4d,
- DW_OP_lit30 = 0x4e,
- DW_OP_lit31 = 0x4f,
- DW_OP_reg0 = 0x50,
- DW_OP_reg1 = 0x51,
- DW_OP_reg2 = 0x52,
- DW_OP_reg3 = 0x53,
- DW_OP_reg4 = 0x54,
- DW_OP_reg5 = 0x55,
- DW_OP_reg6 = 0x56,
- DW_OP_reg7 = 0x57,
- DW_OP_reg8 = 0x58,
- DW_OP_reg9 = 0x59,
- DW_OP_reg10 = 0x5a,
- DW_OP_reg11 = 0x5b,
- DW_OP_reg12 = 0x5c,
- DW_OP_reg13 = 0x5d,
- DW_OP_reg14 = 0x5e,
- DW_OP_reg15 = 0x5f,
- DW_OP_reg16 = 0x60,
- DW_OP_reg17 = 0x61,
- DW_OP_reg18 = 0x62,
- DW_OP_reg19 = 0x63,
- DW_OP_reg20 = 0x64,
- DW_OP_reg21 = 0x65,
- DW_OP_reg22 = 0x66,
- DW_OP_reg23 = 0x67,
- DW_OP_reg24 = 0x68,
- DW_OP_reg25 = 0x69,
- DW_OP_reg26 = 0x6a,
- DW_OP_reg27 = 0x6b,
- DW_OP_reg28 = 0x6c,
- DW_OP_reg29 = 0x6d,
- DW_OP_reg30 = 0x6e,
- DW_OP_reg31 = 0x6f,
- DW_OP_breg0 = 0x70,
- DW_OP_breg1 = 0x71,
- DW_OP_breg2 = 0x72,
- DW_OP_breg3 = 0x73,
- DW_OP_breg4 = 0x74,
- DW_OP_breg5 = 0x75,
- DW_OP_breg6 = 0x76,
- DW_OP_breg7 = 0x77,
- DW_OP_breg8 = 0x78,
- DW_OP_breg9 = 0x79,
- DW_OP_breg10 = 0x7a,
- DW_OP_breg11 = 0x7b,
- DW_OP_breg12 = 0x7c,
- DW_OP_breg13 = 0x7d,
- DW_OP_breg14 = 0x7e,
- DW_OP_breg15 = 0x7f,
- DW_OP_breg16 = 0x80,
- DW_OP_breg17 = 0x81,
- DW_OP_breg18 = 0x82,
- DW_OP_breg19 = 0x83,
- DW_OP_breg20 = 0x84,
- DW_OP_breg21 = 0x85,
- DW_OP_breg22 = 0x86,
- DW_OP_breg23 = 0x87,
- DW_OP_breg24 = 0x88,
- DW_OP_breg25 = 0x89,
- DW_OP_breg26 = 0x8a,
- DW_OP_breg27 = 0x8b,
- DW_OP_breg28 = 0x8c,
- DW_OP_breg29 = 0x8d,
- DW_OP_breg30 = 0x8e,
- DW_OP_breg31 = 0x8f,
- DW_OP_regx = 0x90,
- DW_OP_fbreg = 0x91,
- DW_OP_bregx = 0x92,
- DW_OP_piece = 0x93,
- DW_OP_deref_size = 0x94,
- DW_OP_xderef_size = 0x95,
- DW_OP_nop = 0x96,
- /* DWARF 3 extensions. */
- DW_OP_push_object_address = 0x97,
- DW_OP_call2 = 0x98,
- DW_OP_call4 = 0x99,
- DW_OP_call_ref = 0x9a,
- DW_OP_form_tls_address = 0x9b,
- DW_OP_call_frame_cfa = 0x9c,
- DW_OP_bit_piece = 0x9d,
-
- /* DWARF 4 extensions. */
- DW_OP_implicit_value = 0x9e,
- DW_OP_stack_value = 0x9f,
-
- DW_OP_lo_user = 0xe0, /* Implementation-defined range start. */
- DW_OP_hi_user = 0xff, /* Implementation-defined range end. */
-
- /* GNU extensions. */
- DW_OP_GNU_push_tls_address = 0xe0,
- /* The following is for marking variables that are uninitialized. */
- DW_OP_GNU_uninit = 0xf0,
- DW_OP_GNU_encoded_addr = 0xf1,
- /* The GNU implicit pointer extension.
- See http://www.dwarfstd.org/ShowIssue.php?issue=100831.1&type=open . */
- DW_OP_GNU_implicit_pointer = 0xf2,
- /* The GNU entry value extension.
- See http://www.dwarfstd.org/ShowIssue.php?issue=100909.1&type=open . */
- DW_OP_GNU_entry_value = 0xf3,
- /* The GNU typed stack extension.
- See http://www.dwarfstd.org/doc/040408.1.html . */
- DW_OP_GNU_const_type = 0xf4,
- DW_OP_GNU_regval_type = 0xf5,
- DW_OP_GNU_deref_type = 0xf6,
- DW_OP_GNU_convert = 0xf7,
- DW_OP_GNU_reinterpret = 0xf9,
- /* The GNU parameter ref extension. */
- DW_OP_GNU_parameter_ref = 0xfa,
- /* HP extensions. */
- DW_OP_HP_unknown = 0xe0, /* Ouch, the same as GNU_push_tls_address. */
- DW_OP_HP_is_value = 0xe1,
- DW_OP_HP_fltconst4 = 0xe2,
- DW_OP_HP_fltconst8 = 0xe3,
- DW_OP_HP_mod_range = 0xe4,
- DW_OP_HP_unmod_range = 0xe5,
- DW_OP_HP_tls = 0xe6,
- /* PGI (STMicroelectronics) extensions. */
- DW_OP_PGI_omp_thread_num = 0xf8
- };
-
-/* Type encodings. */
-enum dwarf_type
- {
- DW_ATE_void = 0x0,
- DW_ATE_address = 0x1,
- DW_ATE_boolean = 0x2,
- DW_ATE_complex_float = 0x3,
- DW_ATE_float = 0x4,
- DW_ATE_signed = 0x5,
- DW_ATE_signed_char = 0x6,
- DW_ATE_unsigned = 0x7,
- DW_ATE_unsigned_char = 0x8,
- /* DWARF 3. */
- DW_ATE_imaginary_float = 0x9,
- DW_ATE_packed_decimal = 0xa,
- DW_ATE_numeric_string = 0xb,
- DW_ATE_edited = 0xc,
- DW_ATE_signed_fixed = 0xd,
- DW_ATE_unsigned_fixed = 0xe,
- DW_ATE_decimal_float = 0xf,
- /* DWARF 4. */
- DW_ATE_UTF = 0x10,
-
- DW_ATE_lo_user = 0x80,
- DW_ATE_hi_user = 0xff,
-
- /* HP extensions. */
- DW_ATE_HP_float80 = 0x80, /* Floating-point (80 bit). */
- DW_ATE_HP_complex_float80 = 0x81, /* Complex floating-point (80 bit). */
- DW_ATE_HP_float128 = 0x82, /* Floating-point (128 bit). */
- DW_ATE_HP_complex_float128 = 0x83, /* Complex fp (128 bit). */
- DW_ATE_HP_floathpintel = 0x84, /* Floating-point (82 bit IA64). */
- DW_ATE_HP_imaginary_float80 = 0x85,
- DW_ATE_HP_imaginary_float128 = 0x86,
- DW_ATE_HP_VAX_float = 0x88, /* F or G floating. */
- DW_ATE_HP_VAX_float_d = 0x89, /* D floating. */
- DW_ATE_HP_packed_decimal = 0x8a, /* Cobol. */
- DW_ATE_HP_zoned_decimal = 0x8b, /* Cobol. */
- DW_ATE_HP_edited = 0x8c, /* Cobol. */
- DW_ATE_HP_signed_fixed = 0x8d, /* Cobol. */
- DW_ATE_HP_unsigned_fixed = 0x8e, /* Cobol. */
- DW_ATE_HP_VAX_complex_float = 0x8f, /* F or G floating complex. */
- DW_ATE_HP_VAX_complex_float_d = 0x90 /* D floating complex. */
- };
/* Decimal sign encodings. */
enum dwarf_decimal_sign_encoding
@@ -787,46 +259,15 @@ enum dwarf_line_number_hp_sfc_ops
DW_LNE_HP_SFC_associate = 3
};
-/* Call frame information. */
-enum dwarf_call_frame_info
+/* Type codes for location list entries.
+ Extension for Fission. See http://gcc.gnu.org/wiki/DebugFission. */
+
+enum dwarf_location_list_entry_type
{
- DW_CFA_advance_loc = 0x40,
- DW_CFA_offset = 0x80,
- DW_CFA_restore = 0xc0,
- DW_CFA_nop = 0x00,
- DW_CFA_set_loc = 0x01,
- DW_CFA_advance_loc1 = 0x02,
- DW_CFA_advance_loc2 = 0x03,
- DW_CFA_advance_loc4 = 0x04,
- DW_CFA_offset_extended = 0x05,
- DW_CFA_restore_extended = 0x06,
- DW_CFA_undefined = 0x07,
- DW_CFA_same_value = 0x08,
- DW_CFA_register = 0x09,
- DW_CFA_remember_state = 0x0a,
- DW_CFA_restore_state = 0x0b,
- DW_CFA_def_cfa = 0x0c,
- DW_CFA_def_cfa_register = 0x0d,
- DW_CFA_def_cfa_offset = 0x0e,
- /* DWARF 3. */
- DW_CFA_def_cfa_expression = 0x0f,
- DW_CFA_expression = 0x10,
- DW_CFA_offset_extended_sf = 0x11,
- DW_CFA_def_cfa_sf = 0x12,
- DW_CFA_def_cfa_offset_sf = 0x13,
- DW_CFA_val_offset = 0x14,
- DW_CFA_val_offset_sf = 0x15,
- DW_CFA_val_expression = 0x16,
-
- DW_CFA_lo_user = 0x1c,
- DW_CFA_hi_user = 0x3f,
-
- /* SGI/MIPS specific. */
- DW_CFA_MIPS_advance_loc8 = 0x1d,
- /* GNU extensions. */
- DW_CFA_GNU_window_save = 0x2d,
- DW_CFA_GNU_args_size = 0x2e,
- DW_CFA_GNU_negative_offset_extended = 0x2f
+ DW_LLE_GNU_end_of_list_entry = 0,
+ DW_LLE_GNU_base_address_selection_entry = 1,
+ DW_LLE_GNU_start_end_entry = 2,
+ DW_LLE_GNU_start_length_entry = 3
};
#define DW_CIE_ID 0xffffffff
@@ -903,6 +344,11 @@ enum dwarf_macro_record_type
DW_MACRO_GNU_define_indirect = 5,
DW_MACRO_GNU_undef_indirect = 6,
DW_MACRO_GNU_transparent_include = 7,
+ /* Extensions for DWZ multifile.
+ See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */
+ DW_MACRO_GNU_define_indirect_alt = 8,
+ DW_MACRO_GNU_undef_indirect_alt = 9,
+ DW_MACRO_GNU_transparent_include_alt = 10,
DW_MACRO_GNU_lo_user = 0xe0,
DW_MACRO_GNU_hi_user = 0xff
};
@@ -930,4 +376,51 @@ enum dwarf_macro_record_type
#define DW_EH_PE_indirect 0x80
+/* Codes for the debug sections in a dwarf package (.dwp) file.
+ Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFissionDWP. */
+enum dwarf_sect
+ {
+ DW_SECT_INFO = 1,
+ DW_SECT_TYPES = 2,
+ DW_SECT_ABBREV = 3,
+ DW_SECT_LINE = 4,
+ DW_SECT_LOC = 5,
+ DW_SECT_STR_OFFSETS = 6,
+ DW_SECT_MACINFO = 7,
+ DW_SECT_MACRO = 8,
+ DW_SECT_MAX = 8
+ };
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Return the name of a DW_TAG_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_TAG_name (unsigned int tag);
+
+/* Return the name of a DW_AT_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_AT_name (unsigned int attr);
+
+/* Return the name of a DW_FORM_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_FORM_name (unsigned int form);
+
+/* Return the name of a DW_OP_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_OP_name (unsigned int op);
+
+/* Return the name of a DW_ATE_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_ATE_name (unsigned int enc);
+
+/* Return the name of a DW_CFA_ constant, or NULL if the value is not
+ recognized. */
+extern const char *get_DW_CFA_name (unsigned int opc);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* _DWARF2_H */
diff --git a/include/filenames.h b/include/filenames.h
index 75ec3302d1..e799a51b6a 100644
--- a/include/filenames.h
+++ b/include/filenames.h
@@ -26,6 +26,8 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef FILENAMES_H
#define FILENAMES_H
+#include "hashtab.h" /* for hashval_t */
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -84,6 +86,10 @@ extern int filename_cmp (const char *s1, const char *s2);
extern int filename_ncmp (const char *s1, const char *s2,
size_t n);
+extern hashval_t filename_hash (const void *s);
+
+extern int filename_eq (const void *s1, const void *s2);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/floatformat.h b/include/floatformat.h
index b5951644ea..04db61a265 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -128,7 +128,8 @@ extern const struct floatformat floatformat_ia64_spill_little;
extern const struct floatformat floatformat_ia64_quad_big;
extern const struct floatformat floatformat_ia64_quad_little;
/* IBM long double (double+double). */
-extern const struct floatformat floatformat_ibm_long_double;
+extern const struct floatformat floatformat_ibm_long_double_big;
+extern const struct floatformat floatformat_ibm_long_double_little;
/* Convert from FMT to a double.
FROM is the address of the extended float.
diff --git a/include/gdb/gdb-index.h b/include/gdb/gdb-index.h
new file mode 100644
index 0000000000..b43c68f9e3
--- /dev/null
+++ b/include/gdb/gdb-index.h
@@ -0,0 +1,99 @@
+/* Public attributes of the .gdb_index section.
+ Copyright 2012 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program 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 of the License, or
+ (at your option) any later version.
+
+ This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* This file contains values for understanding the .gdb_index section
+ needed by more than just GDB, e.g. readelf. */
+
+#ifndef GDB_INDEX_H
+#define GDB_INDEX_H
+
+/* Each symbol in .gdb_index refers to a set of CUs that defines the symbol.
+ Each CU is represented by a 32 bit number that is the index of the CU in
+ the CU table, plus some attributes of the use of the symbol in that CU.
+
+ The values are defined such that if all the bits are zero, then no
+ special meaning is assigned to any of them. This is done to preserve
+ compatibility with older indices. The way this is done is to specify
+ that if the GDB_INDEX_SYMBOL_KIND value is zero then all other attribute
+ bits must be zero.
+
+ 0-23 CU index
+ 24-27 reserved
+ 28-30 symbol kind
+ 31 0 == global, 1 == static
+
+ Bits 24-27 are reserved because it's easier to relax restrictions than
+ it is to impose them after the fact. At present 24 bits to represent
+ the CU index is plenty. If we need more bits for the CU index or for
+ attributes then we have them. */
+
+/* Whether the symbol is in GLOBAL_BLOCK (== 0) or STATIC_BLOCK (== 1). */
+#define GDB_INDEX_SYMBOL_STATIC_SHIFT 31
+#define GDB_INDEX_SYMBOL_STATIC_MASK 1
+#define GDB_INDEX_SYMBOL_STATIC_VALUE(cu_index) \
+ (((cu_index) >> GDB_INDEX_SYMBOL_STATIC_SHIFT) & GDB_INDEX_SYMBOL_STATIC_MASK)
+#define GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \
+ do { \
+ (cu_index) |= (((value) & GDB_INDEX_SYMBOL_STATIC_MASK) \
+ << GDB_INDEX_SYMBOL_STATIC_SHIFT); \
+ } while (0)
+
+/* The kind of the symbol.
+ We don't use GDB's internal values as these numbers are published
+ so that other tools can build and read .gdb_index. */
+
+typedef enum {
+ /* Special value to indicate no attributes are present. */
+ GDB_INDEX_SYMBOL_KIND_NONE = 0,
+ GDB_INDEX_SYMBOL_KIND_TYPE = 1,
+ GDB_INDEX_SYMBOL_KIND_VARIABLE = 2,
+ GDB_INDEX_SYMBOL_KIND_FUNCTION = 3,
+ GDB_INDEX_SYMBOL_KIND_OTHER = 4,
+ /* We currently allocate 3 bits to record the symbol kind.
+ Give the unused bits a value so gdb will print them sensibly. */
+ GDB_INDEX_SYMBOL_KIND_UNUSED5 = 5,
+ GDB_INDEX_SYMBOL_KIND_UNUSED6 = 6,
+ GDB_INDEX_SYMBOL_KIND_UNUSED7 = 7
+} gdb_index_symbol_kind;
+
+#define GDB_INDEX_SYMBOL_KIND_SHIFT 28
+#define GDB_INDEX_SYMBOL_KIND_MASK 7
+#define GDB_INDEX_SYMBOL_KIND_VALUE(cu_index) \
+ ((gdb_index_symbol_kind) (((cu_index) >> GDB_INDEX_SYMBOL_KIND_SHIFT) \
+ & GDB_INDEX_SYMBOL_KIND_MASK))
+#define GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \
+ do { \
+ (cu_index) |= (((value) & GDB_INDEX_SYMBOL_KIND_MASK) \
+ << GDB_INDEX_SYMBOL_KIND_SHIFT); \
+ } while (0)
+
+#define GDB_INDEX_RESERVED_SHIFT 24
+#define GDB_INDEX_RESERVED_MASK 15
+#define GDB_INDEX_RESERVED_VALUE(cu_index) \
+ (((cu_index) >> GDB_INDEX_RESERVED_SHIFT) & GDB_INDEX_RESERVED_MASK)
+
+/* CU index. */
+#define GDB_INDEX_CU_BITSIZE 24
+#define GDB_INDEX_CU_MASK ((1 << GDB_INDEX_CU_BITSIZE) - 1)
+#define GDB_INDEX_CU_VALUE(cu_index) ((cu_index) & GDB_INDEX_CU_MASK)
+#define GDB_INDEX_CU_SET_VALUE(cu_index, value) \
+ do { \
+ (cu_index) |= (value) & GDB_INDEX_CU_MASK; \
+ } while (0)
+
+#endif /* GDB_INDEX_H */
diff --git a/include/leb128.h b/include/leb128.h
new file mode 100644
index 0000000000..f584f72e5a
--- /dev/null
+++ b/include/leb128.h
@@ -0,0 +1,136 @@
+/* Utilities for reading leb128 values.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later version.
+
+Libiberty 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with libiberty; see the file COPYING.LIB. If not, write
+to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA. */
+
+/* The functions defined here can be speed critical.
+ Since they are all pretty small we keep things simple and just define
+ them all as "static inline".
+
+ WARNING: This file is used by GDB which is stuck at C90. :-(
+ Though it can use stdint.h, inttypes.h.
+ Therefore if you want to add support for "long long" you need
+ to wrap it in #ifdef CC_HAS_LONG_LONG. */
+
+#ifndef LEB128_H
+#define LEB128_H
+
+/* Get a definition for inline. */
+#include "ansidecl.h"
+
+/* Get a definition for NULL, size_t. */
+#include <stddef.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+
+/* Decode the unsigned LEB128 constant at BUF into the variable pointed to
+ by R, and return the number of bytes read.
+ If we read off the end of the buffer, zero is returned,
+ and nothing is stored in R.
+
+ Note: The result is an int instead of a pointer to the next byte to be
+ read to avoid const-vs-non-const problems. */
+
+static inline size_t
+read_uleb128_to_uint64 (const unsigned char *buf, const unsigned char *buf_end,
+ uint64_t *r)
+{
+ const unsigned char *p = buf;
+ unsigned int shift = 0;
+ uint64_t result = 0;
+ unsigned char byte;
+
+ while (1)
+ {
+ if (p >= buf_end)
+ return 0;
+
+ byte = *p++;
+ result |= ((uint64_t) (byte & 0x7f)) << shift;
+ if ((byte & 0x80) == 0)
+ break;
+ shift += 7;
+ }
+
+ *r = result;
+ return p - buf;
+}
+
+/* Decode the signed LEB128 constant at BUF into the variable pointed to
+ by R, and return the number of bytes read.
+ If we read off the end of the buffer, zero is returned,
+ and nothing is stored in R.
+
+ Note: The result is an int instead of a pointer to the next byte to be
+ read to avoid const-vs-non-const problems. */
+
+static inline size_t
+read_sleb128_to_int64 (const unsigned char *buf, const unsigned char *buf_end,
+ int64_t *r)
+{
+ const unsigned char *p = buf;
+ unsigned int shift = 0;
+ int64_t result = 0;
+ unsigned char byte;
+
+ while (1)
+ {
+ if (p >= buf_end)
+ return 0;
+
+ byte = *p++;
+ result |= ((uint64_t) (byte & 0x7f)) << shift;
+ shift += 7;
+ if ((byte & 0x80) == 0)
+ break;
+ }
+ if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
+ result |= -(((uint64_t) 1) << shift);
+
+ *r = result;
+ return p - buf;
+}
+
+/* Return the number of bytes to read to skip past an LEB128 number in BUF.
+ If the end isn't found before reaching BUF_END, return zero.
+
+ Note: The result is an int instead of a pointer to the next byte to be
+ read to avoid const-vs-non-const problems. */
+
+static inline size_t
+skip_leb128 (const unsigned char *buf, const unsigned char *buf_end)
+{
+ const unsigned char *p = buf;
+ unsigned char byte;
+
+ while (1)
+ {
+ if (p == buf_end)
+ return 0;
+
+ byte = *p++;
+ if ((byte & 0x80) == 0)
+ return p - buf;
+ }
+}
+
+#endif /* LEB128_H */
diff --git a/include/libiberty.h b/include/libiberty.h
index cacde800ea..78c42eb88f 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -1,7 +1,7 @@
/* Function declarations for libiberty.
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ 2006, 2007, 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
Note - certain prototypes declared in this header file are for
functions whoes implementation copyright does not belong to the
@@ -85,11 +85,11 @@ extern char **dupargv (char **) ATTRIBUTE_MALLOC;
/* Expand "@file" arguments in argv. */
-extern void expandargv PARAMS ((int *, char ***));
+extern void expandargv (int *, char ***);
/* Write argv to an @-file, inserting necessary quoting. */
-extern int writeargv PARAMS ((char **, FILE *));
+extern int writeargv (char **, FILE *);
/* Return the number of elements in argv. */
@@ -107,7 +107,7 @@ extern int countargv (char**);
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_BASENAME
#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME)
-extern char *basename (const char *);
+extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
#else
/* Do not allow basename to be used if there is no prototype seen. We
either need to use the above prototype or have one from
@@ -118,18 +118,18 @@ extern char *basename (const char *);
/* A well-defined basename () that is always compiled in. */
-extern const char *lbasename (const char *);
+extern const char *lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
/* Same, but assumes DOS semantics (drive name, backslash is also a
dir separator) regardless of host. */
-extern const char *dos_lbasename (const char *);
+extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
/* Same, but assumes Unix semantics (absolute paths always start with
a slash, only forward slash is accepted as dir separator)
regardless of host. */
-extern const char *unix_lbasename (const char *);
+extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
/* A well-defined realpath () that is always compiled in. */
@@ -139,7 +139,7 @@ extern char *lrealpath (const char *);
the last argument of this function, to terminate the list of
strings. Allocates memory using xmalloc. */
-extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
+extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
/* Concatenate an arbitrary number of strings. You must pass NULL as
the last argument of this function, to terminate the list of
@@ -148,7 +148,7 @@ extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
pointer to be freed after the new string is created, similar to the
way xrealloc works. */
-extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_SENTINEL;
+extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
/* Determine the length of concatenating an arbitrary number of
strings. You must pass NULL as the last argument of this function,
@@ -161,14 +161,14 @@ extern unsigned long concat_length (const char *, ...) ATTRIBUTE_SENTINEL;
to terminate the list of strings. The supplied memory is assumed
to be large enough. */
-extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_SENTINEL;
+extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
/* Concatenate an arbitrary number of strings into a GLOBAL area of
memory. You must pass NULL as the last argument of this function,
to terminate the list of strings. The supplied memory is assumed
to be large enough. */
-extern char *concat_copy2 (const char *, ...) ATTRIBUTE_SENTINEL;
+extern char *concat_copy2 (const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
/* This is the global area used by concat_copy2. */
@@ -226,7 +226,7 @@ extern char *make_relative_prefix_ignore_links (const char *, const char *,
/* Choose a temporary directory to use for scratch files. */
-extern char *choose_temp_base (void) ATTRIBUTE_MALLOC;
+extern char *choose_temp_base (void) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Return a temporary file name or NULL if unable to create one. */
@@ -256,7 +256,7 @@ extern int strtoerrno (const char *);
/* ANSI's strerror(), but more robust. */
-extern char *xstrerror (int);
+extern char *xstrerror (int) ATTRIBUTE_RETURNS_NONNULL;
/* Return the maximum signal number for which strsignal will return a
string. */
@@ -298,30 +298,30 @@ extern void xmalloc_failed (size_t) ATTRIBUTE_NORETURN;
message to stderr (using the name set by xmalloc_set_program_name,
if any) and then call xexit. */
-extern void *xmalloc (size_t) ATTRIBUTE_MALLOC;
+extern void *xmalloc (size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Reallocate memory without fail. This works like xmalloc. Note,
realloc type functions are not suitable for attribute malloc since
they may return the same address across multiple calls. */
-extern void *xrealloc (void *, size_t);
+extern void *xrealloc (void *, size_t) ATTRIBUTE_RETURNS_NONNULL;
/* Allocate memory without fail and set it to zero. This works like
xmalloc. */
-extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC;
+extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Copy a string into a memory buffer without fail. */
-extern char *xstrdup (const char *) ATTRIBUTE_MALLOC;
+extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Copy at most N characters from string into a buffer without fail. */
-extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC;
+extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Copy an existing memory buffer to a new memory buffer without fail. */
-extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC;
+extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
/* Physical memory routines. Return values are in BYTES. */
extern double physmem_total (void);
@@ -399,7 +399,7 @@ extern void hex_init (void);
Returns NULL on error. */
extern struct pex_obj *pex_init (int flags, const char *pname,
- const char *tempbase);
+ const char *tempbase) ATTRIBUTE_RETURNS_NONNULL;
/* Flags for pex_run. These are bits to be or'ed together. */
diff --git a/include/longlong.h b/include/longlong.h
new file mode 100644
index 0000000000..5f00e548a7
--- /dev/null
+++ b/include/longlong.h
@@ -0,0 +1,1724 @@
+/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
+ Copyright (C) 1991-2013 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+/* You have to define the following before including this file:
+
+ UWtype -- An unsigned type, default type for operations (typically a "word")
+ UHWtype -- An unsigned type, at least half the size of UWtype.
+ UDWtype -- An unsigned type, at least twice as large a UWtype
+ W_TYPE_SIZE -- size in bits of UWtype
+
+ UQItype -- Unsigned 8 bit type.
+ SItype, USItype -- Signed and unsigned 32 bit types.
+ DItype, UDItype -- Signed and unsigned 64 bit types.
+
+ On a 32 bit machine UWtype should typically be USItype;
+ on a 64 bit machine, UWtype should typically be UDItype. */
+
+#define __BITS4 (W_TYPE_SIZE / 4)
+#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
+#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
+#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
+
+#ifndef W_TYPE_SIZE
+#define W_TYPE_SIZE 32
+#define UWtype USItype
+#define UHWtype USItype
+#define UDWtype UDItype
+#endif
+
+/* Used in glibc only. */
+#ifndef attribute_hidden
+#define attribute_hidden
+#endif
+
+extern const UQItype __clz_tab[256] attribute_hidden;
+
+/* Define auxiliary asm macros.
+
+ 1) umul_ppmm(high_prod, low_prod, multiplier, multiplicand) multiplies two
+ UWtype integers MULTIPLIER and MULTIPLICAND, and generates a two UWtype
+ word product in HIGH_PROD and LOW_PROD.
+
+ 2) __umulsidi3(a,b) multiplies two UWtype integers A and B, and returns a
+ UDWtype product. This is just a variant of umul_ppmm.
+
+ 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator) divides a UDWtype, composed by the UWtype integers
+ HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and places the quotient
+ in QUOTIENT and the remainder in REMAINDER. HIGH_NUMERATOR must be less
+ than DENOMINATOR for correct operation. If, in addition, the most
+ significant bit of DENOMINATOR must be 1, then the pre-processor symbol
+ UDIV_NEEDS_NORMALIZATION is defined to 1.
+
+ 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator). Like udiv_qrnnd but the numbers are signed. The quotient
+ is rounded towards 0.
+
+ 5) count_leading_zeros(count, x) counts the number of zero-bits from the
+ msb to the first nonzero bit in the UWtype X. This is the number of
+ steps X needs to be shifted left to set the msb. Undefined for X == 0,
+ unless the symbol COUNT_LEADING_ZEROS_0 is defined to some value.
+
+ 6) count_trailing_zeros(count, x) like count_leading_zeros, but counts
+ from the least significant end.
+
+ 7) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
+ high_addend_2, low_addend_2) adds two UWtype integers, composed by
+ HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and LOW_ADDEND_2
+ respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow
+ (i.e. carry out) is not stored anywhere, and is lost.
+
+ 8) sub_ddmmss(high_difference, low_difference, high_minuend, low_minuend,
+ high_subtrahend, low_subtrahend) subtracts two two-word UWtype integers,
+ composed by HIGH_MINUEND_1 and LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and
+ LOW_SUBTRAHEND_2 respectively. The result is placed in HIGH_DIFFERENCE
+ and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
+ and is lost.
+
+ If any of these macros are left undefined for a particular CPU,
+ C macros are used. */
+
+/* The CPUs come in alphabetical order below.
+
+ Please add support for more CPUs here, or improve the current support
+ for the CPUs below!
+ (E.g. WE32100, IBM360.) */
+
+#if defined (__GNUC__) && !defined (NO_ASM)
+
+/* We sometimes need to clobber "cc" with gcc2, but that would not be
+ understood by gcc1. Use cpp to avoid major code duplication. */
+#if __GNUC__ < 2
+#define __CLOBBER_CC
+#define __AND_CLOBBER_CC
+#else /* __GNUC__ >= 2 */
+#define __CLOBBER_CC : "cc"
+#define __AND_CLOBBER_CC , "cc"
+#endif /* __GNUC__ < 2 */
+
+#if defined (__alpha) && W_TYPE_SIZE == 64
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ (ph) = __builtin_alpha_umulh (__m0, __m1); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define UMUL_TIME 46
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { UDItype __r; \
+ (q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
+ (r) = __r; \
+ } while (0)
+extern UDItype __udiv_qrnnd (UDItype *, UDItype, UDItype, UDItype);
+#define UDIV_TIME 220
+#endif /* LONGLONG_STANDALONE */
+#ifdef __alpha_cix__
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzl (X))
+#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzl (X))
+#define COUNT_LEADING_ZEROS_0 64
+#else
+#define count_leading_zeros(COUNT,X) \
+ do { \
+ UDItype __xr = (X), __t, __a; \
+ __t = __builtin_alpha_cmpbge (0, __xr); \
+ __a = __clz_tab[__t ^ 0xff] - 1; \
+ __t = __builtin_alpha_extbl (__xr, __a); \
+ (COUNT) = 64 - (__clz_tab[__t] + __a*8); \
+ } while (0)
+#define count_trailing_zeros(COUNT,X) \
+ do { \
+ UDItype __xr = (X), __t, __a; \
+ __t = __builtin_alpha_cmpbge (0, __xr); \
+ __t = ~__t & -~__t; \
+ __a = ((__t & 0xCC) != 0) * 2; \
+ __a += ((__t & 0xF0) != 0) * 4; \
+ __a += ((__t & 0xAA) != 0); \
+ __t = __builtin_alpha_extbl (__xr, __a); \
+ __a <<= 3; \
+ __t &= -__t; \
+ __a += ((__t & 0xCC) != 0) * 2; \
+ __a += ((__t & 0xF0) != 0) * 4; \
+ __a += ((__t & 0xAA) != 0); \
+ (COUNT) = __a; \
+ } while (0)
+#endif /* __alpha_cix__ */
+#endif /* __alpha */
+
+#if defined (__arc__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add.f %1, %4, %5\n\tadc %0, %2, %3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%r" ((USItype) (ah)), \
+ "rIJ" ((USItype) (bh)), \
+ "%r" ((USItype) (al)), \
+ "rIJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub.f %1, %4, %5\n\tsbc %0, %2, %3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "r" ((USItype) (ah)), \
+ "rIJ" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rIJ" ((USItype) (bl)))
+
+#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
+#ifdef __ARC_NORM__
+#define count_leading_zeros(count, x) \
+ do \
+ { \
+ SItype c_; \
+ \
+ __asm__ ("norm.f\t%0,%1\n\tmov.mi\t%0,-1" : "=r" (c_) : "r" (x) : "cc");\
+ (count) = c_ + 1; \
+ } \
+ while (0)
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif
+
+#if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \
+ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("adds %1, %4, %5\n\tadc %0, %2, %3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%r" ((USItype) (ah)), \
+ "rI" ((USItype) (bh)), \
+ "%r" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subs %1, %4, %5\n\tsbc %0, %2, %3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "r" ((USItype) (ah)), \
+ "rI" ((USItype) (bh)), \
+ "r" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) __CLOBBER_CC)
+# if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_2A__) \
+ || defined(__ARM_ARCH_3__)
+# define umul_ppmm(xh, xl, a, b) \
+ do { \
+ register USItype __t0, __t1, __t2; \
+ __asm__ ("%@ Inlined umul_ppmm\n" \
+ " mov %2, %5, lsr #16\n" \
+ " mov %0, %6, lsr #16\n" \
+ " bic %3, %5, %2, lsl #16\n" \
+ " bic %4, %6, %0, lsl #16\n" \
+ " mul %1, %3, %4\n" \
+ " mul %4, %2, %4\n" \
+ " mul %3, %0, %3\n" \
+ " mul %0, %2, %0\n" \
+ " adds %3, %4, %3\n" \
+ " addcs %0, %0, #65536\n" \
+ " adds %1, %1, %3, lsl #16\n" \
+ " adc %0, %0, %3, lsr #16" \
+ : "=&r" ((USItype) (xh)), \
+ "=r" ((USItype) (xl)), \
+ "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
+ : "r" ((USItype) (a)), \
+ "r" ((USItype) (b)) __CLOBBER_CC ); \
+ } while (0)
+# define UMUL_TIME 20
+# else
+# define umul_ppmm(xh, xl, a, b) \
+ do { \
+ /* Generate umull, under compiler control. */ \
+ register UDItype __t0 = (UDItype)(USItype)(a) * (USItype)(b); \
+ (xl) = (USItype)__t0; \
+ (xh) = (USItype)(__t0 >> 32); \
+ } while (0)
+# define UMUL_TIME 3
+# endif
+# define UDIV_TIME 100
+#endif /* __arm__ */
+
+#if defined(__arm__)
+/* Let gcc decide how best to implement count_leading_zeros. */
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
+#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+
+#if defined (__AVR__)
+
+#if W_TYPE_SIZE == 16
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
+#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctz (X))
+#define COUNT_LEADING_ZEROS_0 16
+#endif /* W_TYPE_SIZE == 16 */
+
+#if W_TYPE_SIZE == 32
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzl (X))
+#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzl (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif /* W_TYPE_SIZE == 32 */
+
+#if W_TYPE_SIZE == 64
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzll (X))
+#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzll (X))
+#define COUNT_LEADING_ZEROS_0 64
+#endif /* W_TYPE_SIZE == 64 */
+
+#endif /* defined (__AVR__) */
+
+#if defined (__CRIS__)
+
+#if __CRIS_arch_version >= 3
+#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif /* __CRIS_arch_version >= 3 */
+
+#if __CRIS_arch_version >= 8
+#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X))
+#endif /* __CRIS_arch_version >= 8 */
+
+#if __CRIS_arch_version >= 10
+#define __umulsidi3(u,v) ((UDItype)(USItype) (u) * (UDItype)(USItype) (v))
+#else
+#define __umulsidi3 __umulsidi3
+extern UDItype __umulsidi3 (USItype, USItype);
+#endif /* __CRIS_arch_version >= 10 */
+
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __x = __umulsidi3 (u, v); \
+ (w0) = (USItype) (__x); \
+ (w1) = (USItype) (__x >> 32); \
+ } while (0)
+
+/* FIXME: defining add_ssaaaa and sub_ddmmss should be advantageous for
+ DFmode ("double" intrinsics, avoiding two of the three insns handling
+ carry), but defining them as open-code C composing and doing the
+ operation in DImode (UDImode) shows that the DImode needs work:
+ register pressure from requiring neighboring registers and the
+ traffic to and from them come to dominate, in the 4.7 series. */
+
+#endif /* defined (__CRIS__) */
+
+#if defined (__hppa) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %4,%5,%1\n\taddc %2,%3,%0" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%rM" ((USItype) (ah)), \
+ "rM" ((USItype) (bh)), \
+ "%rM" ((USItype) (al)), \
+ "rM" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %4,%5,%1\n\tsubb %2,%3,%0" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "rM" ((USItype) (ah)), \
+ "rM" ((USItype) (bh)), \
+ "rM" ((USItype) (al)), \
+ "rM" ((USItype) (bl)))
+#if defined (_PA_RISC1_1)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ union \
+ { \
+ UDItype __f; \
+ struct {USItype __w1, __w0;} __w1w0; \
+ } __t; \
+ __asm__ ("xmpyu %1,%2,%0" \
+ : "=x" (__t.__f) \
+ : "x" ((USItype) (u)), \
+ "x" ((USItype) (v))); \
+ (w1) = __t.__w1w0.__w1; \
+ (w0) = __t.__w1w0.__w0; \
+ } while (0)
+#define UMUL_TIME 8
+#else
+#define UMUL_TIME 30
+#endif
+#define UDIV_TIME 40
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __tmp; \
+ __asm__ ( \
+ "ldi 1,%0\n" \
+" extru,= %1,15,16,%%r0 ; Bits 31..16 zero?\n" \
+" extru,tr %1,15,16,%1 ; No. Shift down, skip add.\n"\
+" ldo 16(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,23,8,%%r0 ; Bits 15..8 zero?\n" \
+" extru,tr %1,23,8,%1 ; No. Shift down, skip add.\n"\
+" ldo 8(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,27,4,%%r0 ; Bits 7..4 zero?\n" \
+" extru,tr %1,27,4,%1 ; No. Shift down, skip add.\n"\
+" ldo 4(%0),%0 ; Yes. Perform add.\n" \
+" extru,= %1,29,2,%%r0 ; Bits 3..2 zero?\n" \
+" extru,tr %1,29,2,%1 ; No. Shift down, skip add.\n"\
+" ldo 2(%0),%0 ; Yes. Perform add.\n" \
+" extru %1,30,1,%1 ; Extract bit 1.\n" \
+" sub %0,%1,%0 ; Subtract it.\n" \
+ : "=r" (count), "=r" (__tmp) : "1" (x)); \
+ } while (0)
+#endif
+
+#if (defined (__i370__) || defined (__s390__) || defined (__mvs__)) && W_TYPE_SIZE == 32
+#if !defined (__zarch__)
+#define smul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {DItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __asm__ ("lr %N0,%1\n\tmr %0,%2" \
+ : "=&r" (__x.__ll) \
+ : "r" (m0), "r" (m1)); \
+ (xh) = __x.__i.__h; (xl) = __x.__i.__l; \
+ } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {DItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __x; \
+ __x.__i.__h = n1; __x.__i.__l = n0; \
+ __asm__ ("dr %0,%2" \
+ : "=r" (__x.__ll) \
+ : "0" (__x.__ll), "r" (d)); \
+ (q) = __x.__i.__l; (r) = __x.__i.__h; \
+ } while (0)
+#else
+#define smul_ppmm(xh, xl, m0, m1) \
+ do { \
+ register SItype __r0 __asm__ ("0"); \
+ register SItype __r1 __asm__ ("1") = (m0); \
+ \
+ __asm__ ("mr\t%%r0,%3" \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r1), "r" (m1)); \
+ (xh) = __r0; (xl) = __r1; \
+ } while (0)
+
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ register SItype __r0 __asm__ ("0") = (n1); \
+ register SItype __r1 __asm__ ("1") = (n0); \
+ \
+ __asm__ ("dr\t%%r0,%4" \
+ : "=r" (__r0), "=r" (__r1) \
+ : "r" (__r0), "r" (__r1), "r" (d)); \
+ (q) = __r1; (r) = __r0; \
+ } while (0)
+#endif /* __zarch__ */
+#endif
+
+#if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add{l} {%5,%1|%1,%5}\n\tadc{l} {%3,%0|%0,%3}" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "%1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub{l} {%5,%1|%1,%5}\n\tsbb{l} {%3,%0|%0,%3}" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mul{l} %3" \
+ : "=a" ((USItype) (w0)), \
+ "=d" ((USItype) (w1)) \
+ : "%0" ((USItype) (u)), \
+ "rm" ((USItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+ __asm__ ("div{l} %4" \
+ : "=a" ((USItype) (q)), \
+ "=d" ((USItype) (r)) \
+ : "0" ((USItype) (n0)), \
+ "1" ((USItype) (n1)), \
+ "rm" ((USItype) (dv)))
+#define count_leading_zeros(count, x) ((count) = __builtin_clz (x))
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* 80x86 */
+
+#if (defined (__x86_64__) || defined (__i386__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add{q} {%5,%1|%1,%5}\n\tadc{q} {%3,%0|%0,%3}" \
+ : "=r" ((UDItype) (sh)), \
+ "=&r" ((UDItype) (sl)) \
+ : "%0" ((UDItype) (ah)), \
+ "rme" ((UDItype) (bh)), \
+ "%1" ((UDItype) (al)), \
+ "rme" ((UDItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub{q} {%5,%1|%1,%5}\n\tsbb{q} {%3,%0|%0,%3}" \
+ : "=r" ((UDItype) (sh)), \
+ "=&r" ((UDItype) (sl)) \
+ : "0" ((UDItype) (ah)), \
+ "rme" ((UDItype) (bh)), \
+ "1" ((UDItype) (al)), \
+ "rme" ((UDItype) (bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mul{q} %3" \
+ : "=a" ((UDItype) (w0)), \
+ "=d" ((UDItype) (w1)) \
+ : "%0" ((UDItype) (u)), \
+ "rm" ((UDItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, dv) \
+ __asm__ ("div{q} %4" \
+ : "=a" ((UDItype) (q)), \
+ "=d" ((UDItype) (r)) \
+ : "0" ((UDItype) (n0)), \
+ "1" ((UDItype) (n1)), \
+ "rm" ((UDItype) (dv)))
+#define count_leading_zeros(count, x) ((count) = __builtin_clzll (x))
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* x86_64 */
+
+#if defined (__i960__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __xx; \
+ __asm__ ("emul %2,%1,%0" \
+ : "=d" (__xx.__ll) \
+ : "%dI" ((USItype) (u)), \
+ "dI" ((USItype) (v))); \
+ (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({UDItype __w; \
+ __asm__ ("emul %2,%1,%0" \
+ : "=d" (__w) \
+ : "%dI" ((USItype) (u)), \
+ "dI" ((USItype) (v))); \
+ __w; })
+#endif /* __i960__ */
+
+#if defined (__ia64) && W_TYPE_SIZE == 64
+/* This form encourages gcc (pre-release 3.4 at least) to emit predicated
+ "sub r=r,r" and "sub r=r,r,1", giving a 2 cycle latency. The generic
+ code using "al<bl" arithmetically comes out making an actual 0 or 1 in a
+ register, which takes an extra cycle. */
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) - (bl); \
+ if ((al) < (bl)) \
+ (sh) = (ah) - (bh) - 1; \
+ else \
+ (sh) = (ah) - (bh); \
+ (sl) = __x; \
+ } while (0)
+
+/* Do both product parts in assembly, since that gives better code with
+ all gcc versions. Some callers will just use the upper part, and in
+ that situation we waste an instruction, but not any cycles. */
+#define umul_ppmm(ph, pl, m0, m1) \
+ __asm__ ("xma.hu %0 = %2, %3, f0\n\txma.l %1 = %2, %3, f0" \
+ : "=&f" (ph), "=f" (pl) \
+ : "f" (m0), "f" (m1))
+#define count_leading_zeros(count, x) \
+ do { \
+ UWtype _x = (x), _y, _a, _c; \
+ __asm__ ("mux1 %0 = %1, @rev" : "=r" (_y) : "r" (_x)); \
+ __asm__ ("czx1.l %0 = %1" : "=r" (_a) : "r" (-_y | _y)); \
+ _c = (_a - 1) << 3; \
+ _x >>= _c; \
+ if (_x >= 1 << 4) \
+ _x >>= 4, _c += 4; \
+ if (_x >= 1 << 2) \
+ _x >>= 2, _c += 2; \
+ _c += _x >> 1; \
+ (count) = W_TYPE_SIZE - 1 - _c; \
+ } while (0)
+/* similar to what gcc does for __builtin_ffs, but 0 based rather than 1
+ based, and we don't need a special case for x==0 here */
+#define count_trailing_zeros(count, x) \
+ do { \
+ UWtype __ctz_x = (x); \
+ __asm__ ("popcnt %0 = %1" \
+ : "=r" (count) \
+ : "r" ((__ctz_x-1) & ~__ctz_x)); \
+ } while (0)
+#define UMUL_TIME 14
+#endif
+
+#if defined (__M32R__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ /* The cmp clears the condition bit. */ \
+ __asm__ ("cmp %0,%0\n\taddx %1,%5\n\taddx %0,%3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "r" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "r" ((USItype) (bl)) \
+ : "cbit")
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ /* The cmp clears the condition bit. */ \
+ __asm__ ("cmp %0,%0\n\tsubx %1,%5\n\tsubx %0,%3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "r" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "r" ((USItype) (bl)) \
+ : "cbit")
+#endif /* __M32R__ */
+
+#if defined (__mc68000__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add%.l %5,%1\n\taddx%.l %3,%0" \
+ : "=d" ((USItype) (sh)), \
+ "=&d" ((USItype) (sl)) \
+ : "%0" ((USItype) (ah)), \
+ "d" ((USItype) (bh)), \
+ "%1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub%.l %5,%1\n\tsubx%.l %3,%0" \
+ : "=d" ((USItype) (sh)), \
+ "=&d" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "d" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+
+/* The '020, '030, '040, '060 and CPU32 have 32x32->64 and 64/32->32q-32r. */
+#if (defined (__mc68020__) && !defined (__mc68060__))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulu%.l %3,%1:%0" \
+ : "=d" ((USItype) (w0)), \
+ "=d" ((USItype) (w1)) \
+ : "%0" ((USItype) (u)), \
+ "dmi" ((USItype) (v)))
+#define UMUL_TIME 45
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("divu%.l %4,%1:%0" \
+ : "=d" ((USItype) (q)), \
+ "=d" ((USItype) (r)) \
+ : "0" ((USItype) (n0)), \
+ "1" ((USItype) (n1)), \
+ "dmi" ((USItype) (d)))
+#define UDIV_TIME 90
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("divs%.l %4,%1:%0" \
+ : "=d" ((USItype) (q)), \
+ "=d" ((USItype) (r)) \
+ : "0" ((USItype) (n0)), \
+ "1" ((USItype) (n1)), \
+ "dmi" ((USItype) (d)))
+
+#elif defined (__mcoldfire__) /* not mc68020 */
+
+#define umul_ppmm(xh, xl, a, b) \
+ __asm__ ("| Inlined umul_ppmm\n" \
+ " move%.l %2,%/d0\n" \
+ " move%.l %3,%/d1\n" \
+ " move%.l %/d0,%/d2\n" \
+ " swap %/d0\n" \
+ " move%.l %/d1,%/d3\n" \
+ " swap %/d1\n" \
+ " move%.w %/d2,%/d4\n" \
+ " mulu %/d3,%/d4\n" \
+ " mulu %/d1,%/d2\n" \
+ " mulu %/d0,%/d3\n" \
+ " mulu %/d0,%/d1\n" \
+ " move%.l %/d4,%/d0\n" \
+ " clr%.w %/d0\n" \
+ " swap %/d0\n" \
+ " add%.l %/d0,%/d2\n" \
+ " add%.l %/d3,%/d2\n" \
+ " jcc 1f\n" \
+ " add%.l %#65536,%/d1\n" \
+ "1: swap %/d2\n" \
+ " moveq %#0,%/d0\n" \
+ " move%.w %/d2,%/d0\n" \
+ " move%.w %/d4,%/d2\n" \
+ " move%.l %/d2,%1\n" \
+ " add%.l %/d1,%/d0\n" \
+ " move%.l %/d0,%0" \
+ : "=g" ((USItype) (xh)), \
+ "=g" ((USItype) (xl)) \
+ : "g" ((USItype) (a)), \
+ "g" ((USItype) (b)) \
+ : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+#else /* not ColdFire */
+/* %/ inserts REGISTER_PREFIX, %# inserts IMMEDIATE_PREFIX. */
+#define umul_ppmm(xh, xl, a, b) \
+ __asm__ ("| Inlined umul_ppmm\n" \
+ " move%.l %2,%/d0\n" \
+ " move%.l %3,%/d1\n" \
+ " move%.l %/d0,%/d2\n" \
+ " swap %/d0\n" \
+ " move%.l %/d1,%/d3\n" \
+ " swap %/d1\n" \
+ " move%.w %/d2,%/d4\n" \
+ " mulu %/d3,%/d4\n" \
+ " mulu %/d1,%/d2\n" \
+ " mulu %/d0,%/d3\n" \
+ " mulu %/d0,%/d1\n" \
+ " move%.l %/d4,%/d0\n" \
+ " eor%.w %/d0,%/d0\n" \
+ " swap %/d0\n" \
+ " add%.l %/d0,%/d2\n" \
+ " add%.l %/d3,%/d2\n" \
+ " jcc 1f\n" \
+ " add%.l %#65536,%/d1\n" \
+ "1: swap %/d2\n" \
+ " moveq %#0,%/d0\n" \
+ " move%.w %/d2,%/d0\n" \
+ " move%.w %/d4,%/d2\n" \
+ " move%.l %/d2,%1\n" \
+ " add%.l %/d1,%/d0\n" \
+ " move%.l %/d0,%0" \
+ : "=g" ((USItype) (xh)), \
+ "=g" ((USItype) (xl)) \
+ : "g" ((USItype) (a)), \
+ "g" ((USItype) (b)) \
+ : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+
+#endif /* not mc68020 */
+
+/* The '020, '030, '040 and '060 have bitfield insns.
+ cpu32 disguises as a 68020, but lacks them. */
+#if defined (__mc68020__) && !defined (__mcpu32__)
+#define count_leading_zeros(count, x) \
+ __asm__ ("bfffo %1{%b2:%b2},%0" \
+ : "=d" ((USItype) (count)) \
+ : "od" ((USItype) (x)), "n" (0))
+/* Some ColdFire architectures have a ff1 instruction supported via
+ __builtin_clz. */
+#elif defined (__mcfisaaplus__) || defined (__mcfisac__)
+#define count_leading_zeros(count,x) ((count) = __builtin_clz (x))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* mc68000 */
+
+#if defined (__m88000__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addu.co %1,%r4,%r5\n\taddu.ci %0,%r2,%r3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%rJ" ((USItype) (ah)), \
+ "rJ" ((USItype) (bh)), \
+ "%rJ" ((USItype) (al)), \
+ "rJ" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subu.co %1,%r4,%r5\n\tsubu.ci %0,%r2,%r3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "rJ" ((USItype) (ah)), \
+ "rJ" ((USItype) (bh)), \
+ "rJ" ((USItype) (al)), \
+ "rJ" ((USItype) (bl)))
+#define count_leading_zeros(count, x) \
+ do { \
+ USItype __cbtmp; \
+ __asm__ ("ff1 %0,%1" \
+ : "=r" (__cbtmp) \
+ : "r" ((USItype) (x))); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 63 /* sic */
+#if defined (__mc88110__)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __xx; \
+ __asm__ ("mulu.d %0,%1,%2" \
+ : "=r" (__xx.__ll) \
+ : "r" ((USItype) (u)), \
+ "r" ((USItype) (v))); \
+ (wh) = __xx.__i.__h; \
+ (wl) = __xx.__i.__l; \
+ } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ ({union {UDItype __ll; \
+ struct {USItype __h, __l;} __i; \
+ } __xx; \
+ USItype __q; \
+ __xx.__i.__h = (n1); __xx.__i.__l = (n0); \
+ __asm__ ("divu.d %0,%1,%2" \
+ : "=r" (__q) \
+ : "r" (__xx.__ll), \
+ "r" ((USItype) (d))); \
+ (r) = (n0) - __q * (d); (q) = __q; })
+#define UMUL_TIME 5
+#define UDIV_TIME 25
+#else
+#define UMUL_TIME 17
+#define UDIV_TIME 150
+#endif /* __mc88110__ */
+#endif /* __m88000__ */
+
+#if defined (__mn10300__)
+# if defined (__AM33__)
+# define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
+# define umul_ppmm(w1, w0, u, v) \
+ asm("mulu %3,%2,%1,%0" : "=r"(w0), "=r"(w1) : "r"(u), "r"(v))
+# define smul_ppmm(w1, w0, u, v) \
+ asm("mul %3,%2,%1,%0" : "=r"(w0), "=r"(w1) : "r"(u), "r"(v))
+# else
+# define umul_ppmm(w1, w0, u, v) \
+ asm("nop; nop; mulu %3,%0" : "=d"(w0), "=z"(w1) : "%0"(u), "d"(v))
+# define smul_ppmm(w1, w0, u, v) \
+ asm("nop; nop; mul %3,%0" : "=d"(w0), "=z"(w1) : "%0"(u), "d"(v))
+# endif
+# define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ DWunion __s, __a, __b; \
+ __a.s.low = (al); __a.s.high = (ah); \
+ __b.s.low = (bl); __b.s.high = (bh); \
+ __s.ll = __a.ll + __b.ll; \
+ (sl) = __s.s.low; (sh) = __s.s.high; \
+ } while (0)
+# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ DWunion __s, __a, __b; \
+ __a.s.low = (al); __a.s.high = (ah); \
+ __b.s.low = (bl); __b.s.high = (bh); \
+ __s.ll = __a.ll - __b.ll; \
+ (sl) = __s.s.low; (sh) = __s.s.high; \
+ } while (0)
+# define udiv_qrnnd(q, r, nh, nl, d) \
+ asm("divu %2,%0" : "=D"(q), "=z"(r) : "D"(d), "0"(nl), "1"(nh))
+# define sdiv_qrnnd(q, r, nh, nl, d) \
+ asm("div %2,%0" : "=D"(q), "=z"(r) : "D"(d), "0"(nl), "1"(nh))
+# define UMUL_TIME 3
+# define UDIV_TIME 38
+#endif
+
+#if defined (__mips__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \
+ (w1) = (USItype) (__x >> 32); \
+ (w0) = (USItype) (__x); \
+ } while (0)
+#define UMUL_TIME 10
+#define UDIV_TIME 100
+
+#if (__mips == 32 || __mips == 64) && ! __mips16
+#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clz (X))
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+#endif /* __mips__ */
+
+#if defined (__ns32000__) && W_TYPE_SIZE == 32
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __xx; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__xx.__ll) \
+ : "%0" ((USItype) (u)), \
+ "g" ((USItype) (v))); \
+ (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({UDItype __w; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__w) \
+ : "%0" ((USItype) (u)), \
+ "g" ((USItype) (v))); \
+ __w; })
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ ({union {UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __xx; \
+ __xx.__i.__h = (n1); __xx.__i.__l = (n0); \
+ __asm__ ("deid %2,%0" \
+ : "=g" (__xx.__ll) \
+ : "0" (__xx.__ll), \
+ "g" ((USItype) (d))); \
+ (r) = __xx.__i.__l; (q) = __xx.__i.__h; })
+#define count_trailing_zeros(count,x) \
+ do { \
+ __asm__ ("ffsd %2,%0" \
+ : "=r" ((USItype) (count)) \
+ : "0" ((USItype) 0), \
+ "r" ((USItype) (x))); \
+ } while (0)
+#endif /* __ns32000__ */
+
+/* FIXME: We should test _IBMR2 here when we add assembly support for the
+ system vendor compilers.
+ FIXME: What's needed for gcc PowerPC VxWorks? __vxworks__ is not good
+ enough, since that hits ARM and m68k too. */
+#if (defined (_ARCH_PPC) /* AIX */ \
+ || defined (__powerpc__) /* gcc */ \
+ || defined (__POWERPC__) /* BEOS */ \
+ || defined (__ppc__) /* Darwin */ \
+ || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
+ || (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
+ && CPU_FAMILY == PPC) \
+ ) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
+ __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+ else \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
+ } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (ah) && (ah) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ else \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("cntlzw %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 32
+#if defined (_ARCH_PPC) || defined (__powerpc__) || defined (__POWERPC__) \
+ || defined (__ppc__) \
+ || (defined (PPC) && ! defined (CPU_FAMILY)) /* gcc 2.7.x GNU&SysV */ \
+ || (defined (PPC) && defined (CPU_FAMILY) /* VxWorks */ \
+ && CPU_FAMILY == PPC)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+ do { \
+ SItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhw %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define SMUL_TIME 14
+#define UDIV_TIME 120
+#endif
+#endif /* 32-bit POWER architecture variants. */
+
+/* We should test _IBMR2 here when we add assembly support for the system
+ vendor compilers. */
+#if (defined (_ARCH_PPC64) || defined (__powerpc64__)) && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
+ else \
+ __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
+ } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (ah) && (ah) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ else \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
+ } while (0)
+#define count_leading_zeros(count, x) \
+ __asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
+#define COUNT_LEADING_ZEROS_0 64
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ UDItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhdu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define UMUL_TIME 15
+#define smul_ppmm(ph, pl, m0, m1) \
+ do { \
+ DItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
+ (pl) = __m0 * __m1; \
+ } while (0)
+#define SMUL_TIME 14 /* ??? */
+#define UDIV_TIME 120 /* ??? */
+#endif /* 64-bit PowerPC. */
+
+#if defined (__ibm032__) /* RT/ROMP */ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("a %1,%5\n\tae %0,%3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%0" ((USItype) (ah)), \
+ "r" ((USItype) (bh)), \
+ "%1" ((USItype) (al)), \
+ "r" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("s %1,%5\n\tse %0,%3" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "r" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "r" ((USItype) (bl)))
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ( \
+ "s r2,r2\n" \
+" mts r10,%2\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" m r2,%3\n" \
+" cas %0,r2,r0\n" \
+" mfs r10,%1" \
+ : "=r" ((USItype) (ph)), \
+ "=r" ((USItype) (pl)) \
+ : "%r" (__m0), \
+ "r" (__m1) \
+ : "r2"); \
+ (ph) += ((((SItype) __m0 >> 31) & __m1) \
+ + (((SItype) __m1 >> 31) & __m0)); \
+ } while (0)
+#define UMUL_TIME 20
+#define UDIV_TIME 200
+#define count_leading_zeros(count, x) \
+ do { \
+ if ((x) >= 0x10000) \
+ __asm__ ("clz %0,%1" \
+ : "=r" ((USItype) (count)) \
+ : "r" ((USItype) (x) >> 16)); \
+ else \
+ { \
+ __asm__ ("clz %0,%1" \
+ : "=r" ((USItype) (count)) \
+ : "r" ((USItype) (x))); \
+ (count) += 16; \
+ } \
+ } while (0)
+#endif
+
+#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
+#ifndef __sh1__
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ( \
+ "dmulu.l %2,%3\n\tsts%M1 macl,%1\n\tsts%M0 mach,%0" \
+ : "=r<" ((USItype)(w1)), \
+ "=r<" ((USItype)(w0)) \
+ : "r" ((USItype)(u)), \
+ "r" ((USItype)(v)) \
+ : "macl", "mach")
+#define UMUL_TIME 5
+#endif
+
+/* This is the same algorithm as __udiv_qrnnd_c. */
+#define UDIV_NEEDS_NORMALIZATION 1
+
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ extern UWtype __udiv_qrnnd_16 (UWtype, UWtype) \
+ __attribute__ ((visibility ("hidden"))); \
+ /* r0: rn r1: qn */ /* r0: n1 r4: n0 r5: d r6: d1 */ /* r2: __m */ \
+ __asm__ ( \
+ "mov%M4 %4,r5\n" \
+" swap.w %3,r4\n" \
+" swap.w r5,r6\n" \
+" jsr @%5\n" \
+" shll16 r6\n" \
+" swap.w r4,r4\n" \
+" jsr @%5\n" \
+" swap.w r1,%0\n" \
+" or r1,%0" \
+ : "=r" (q), "=&z" (r) \
+ : "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16) \
+ : "r1", "r2", "r4", "r5", "r6", "pr", "t"); \
+ } while (0)
+
+#define UDIV_TIME 80
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("clrt;subc %5,%1; subc %4,%0" \
+ : "=r" (sh), "=r" (sl) \
+ : "0" (ah), "1" (al), "r" (bh), "r" (bl) : "t")
+
+#endif /* __sh__ */
+
+#if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
+#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
+#define count_leading_zeros(count, x) \
+ do \
+ { \
+ UDItype x_ = (USItype)(x); \
+ SItype c_; \
+ \
+ __asm__ ("nsb %1, %0" : "=r" (c_) : "r" (x_)); \
+ (count) = c_ - 31; \
+ } \
+ while (0)
+#define COUNT_LEADING_ZEROS_0 32
+#endif
+
+#if defined (__sparc__) && !defined (__arch64__) && !defined (__sparcv9) \
+ && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addcc %r4,%5,%1\n\taddx %r2,%3,%0" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "%rJ" ((USItype) (ah)), \
+ "rI" ((USItype) (bh)), \
+ "%rJ" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) \
+ __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subcc %r4,%5,%1\n\tsubx %r2,%3,%0" \
+ : "=r" ((USItype) (sh)), \
+ "=&r" ((USItype) (sl)) \
+ : "rJ" ((USItype) (ah)), \
+ "rI" ((USItype) (bh)), \
+ "rJ" ((USItype) (al)), \
+ "rI" ((USItype) (bl)) \
+ __CLOBBER_CC)
+#if defined (__sparc_v9__)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ register USItype __g1 asm ("g1"); \
+ __asm__ ("umul\t%2,%3,%1\n\t" \
+ "srlx\t%1, 32, %0" \
+ : "=r" ((USItype) (w1)), \
+ "=r" (__g1) \
+ : "r" ((USItype) (u)), \
+ "r" ((USItype) (v))); \
+ (w0) = __g1; \
+ } while (0)
+#define udiv_qrnnd(__q, __r, __n1, __n0, __d) \
+ __asm__ ("mov\t%2,%%y\n\t" \
+ "udiv\t%3,%4,%0\n\t" \
+ "umul\t%0,%4,%1\n\t" \
+ "sub\t%3,%1,%1" \
+ : "=&r" ((USItype) (__q)), \
+ "=&r" ((USItype) (__r)) \
+ : "r" ((USItype) (__n1)), \
+ "r" ((USItype) (__n0)), \
+ "r" ((USItype) (__d)))
+#else
+#if defined (__sparc_v8__)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("umul %2,%3,%1;rd %%y,%0" \
+ : "=r" ((USItype) (w1)), \
+ "=r" ((USItype) (w0)) \
+ : "r" ((USItype) (u)), \
+ "r" ((USItype) (v)))
+#define udiv_qrnnd(__q, __r, __n1, __n0, __d) \
+ __asm__ ("mov %2,%%y;nop;nop;nop;udiv %3,%4,%0;umul %0,%4,%1;sub %3,%1,%1"\
+ : "=&r" ((USItype) (__q)), \
+ "=&r" ((USItype) (__r)) \
+ : "r" ((USItype) (__n1)), \
+ "r" ((USItype) (__n0)), \
+ "r" ((USItype) (__d)))
+#else
+#if defined (__sparclite__)
+/* This has hardware multiply but not divide. It also has two additional
+ instructions scan (ffs from high bit) and divscc. */
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("umul %2,%3,%1;rd %%y,%0" \
+ : "=r" ((USItype) (w1)), \
+ "=r" ((USItype) (w0)) \
+ : "r" ((USItype) (u)), \
+ "r" ((USItype) (v)))
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("! Inlined udiv_qrnnd\n" \
+" wr %%g0,%2,%%y ! Not a delayed write for sparclite\n" \
+" tst %%g0\n" \
+" divscc %3,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%%g1\n" \
+" divscc %%g1,%4,%0\n" \
+" rd %%y,%1\n" \
+" bl,a 1f\n" \
+" add %1,%4,%1\n" \
+"1: ! End of inline udiv_qrnnd" \
+ : "=r" ((USItype) (q)), \
+ "=r" ((USItype) (r)) \
+ : "r" ((USItype) (n1)), \
+ "r" ((USItype) (n0)), \
+ "rI" ((USItype) (d)) \
+ : "g1" __AND_CLOBBER_CC)
+#define UDIV_TIME 37
+#define count_leading_zeros(count, x) \
+ do { \
+ __asm__ ("scan %1,1,%0" \
+ : "=r" ((USItype) (count)) \
+ : "r" ((USItype) (x))); \
+ } while (0)
+/* Early sparclites return 63 for an argument of 0, but they warn that future
+ implementations might change this. Therefore, leave COUNT_LEADING_ZEROS_0
+ undefined. */
+#else
+/* SPARC without integer multiplication and divide instructions.
+ (i.e. at least Sun4/20,40,60,65,75,110,260,280,330,360,380,470,490) */
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("! Inlined umul_ppmm\n" \
+" wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr\n"\
+" sra %3,31,%%o5 ! Don't move this insn\n" \
+" and %2,%%o5,%%o5 ! Don't move this insn\n" \
+" andcc %%g0,0,%%g1 ! Don't move this insn\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,%3,%%g1\n" \
+" mulscc %%g1,0,%%g1\n" \
+" add %%g1,%%o5,%0\n" \
+" rd %%y,%1" \
+ : "=r" ((USItype) (w1)), \
+ "=r" ((USItype) (w0)) \
+ : "%rI" ((USItype) (u)), \
+ "r" ((USItype) (v)) \
+ : "g1", "o5" __AND_CLOBBER_CC)
+#define UMUL_TIME 39 /* 39 instructions */
+/* It's quite necessary to add this much assembler for the sparc.
+ The default udiv_qrnnd (in C) is more than 10 times slower! */
+#define udiv_qrnnd(__q, __r, __n1, __n0, __d) \
+ __asm__ ("! Inlined udiv_qrnnd\n" \
+" mov 32,%%g1\n" \
+" subcc %1,%2,%%g0\n" \
+"1: bcs 5f\n" \
+" addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n" \
+" sub %1,%2,%1 ! this kills msb of n\n" \
+" addx %1,%1,%1 ! so this can't give carry\n" \
+" subcc %%g1,1,%%g1\n" \
+"2: bne 1b\n" \
+" subcc %1,%2,%%g0\n" \
+" bcs 3f\n" \
+" addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n" \
+" b 3f\n" \
+" sub %1,%2,%1 ! this kills msb of n\n" \
+"4: sub %1,%2,%1\n" \
+"5: addxcc %1,%1,%1\n" \
+" bcc 2b\n" \
+" subcc %%g1,1,%%g1\n" \
+"! Got carry from n. Subtract next step to cancel this carry.\n" \
+" bne 4b\n" \
+" addcc %0,%0,%0 ! shift n1n0 and a 0-bit in lsb\n" \
+" sub %1,%2,%1\n" \
+"3: xnor %0,0,%0\n" \
+" ! End of inline udiv_qrnnd" \
+ : "=&r" ((USItype) (__q)), \
+ "=&r" ((USItype) (__r)) \
+ : "r" ((USItype) (__d)), \
+ "1" ((USItype) (__n1)), \
+ "0" ((USItype) (__n0)) : "g1" __AND_CLOBBER_CC)
+#define UDIV_TIME (3+7*32) /* 7 instructions/iteration. 32 iterations. */
+#endif /* __sparclite__ */
+#endif /* __sparc_v8__ */
+#endif /* __sparc_v9__ */
+#endif /* sparc32 */
+
+#if ((defined (__sparc__) && defined (__arch64__)) || defined (__sparcv9)) \
+ && W_TYPE_SIZE == 64
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ UDItype __carry = 0; \
+ __asm__ ("addcc\t%r5,%6,%1\n\t" \
+ "add\t%r3,%4,%0\n\t" \
+ "movcs\t%%xcc, 1, %2\n\t" \
+ "add\t%0, %2, %0" \
+ : "=r" ((UDItype)(sh)), \
+ "=&r" ((UDItype)(sl)), \
+ "+r" (__carry) \
+ : "%rJ" ((UDItype)(ah)), \
+ "rI" ((UDItype)(bh)), \
+ "%rJ" ((UDItype)(al)), \
+ "rI" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ } while (0)
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ UDItype __carry = 0; \
+ __asm__ ("subcc\t%r5,%6,%1\n\t" \
+ "sub\t%r3,%4,%0\n\t" \
+ "movcs\t%%xcc, 1, %2\n\t" \
+ "sub\t%0, %2, %0" \
+ : "=r" ((UDItype)(sh)), \
+ "=&r" ((UDItype)(sl)), \
+ "+r" (__carry) \
+ : "%rJ" ((UDItype)(ah)), \
+ "rI" ((UDItype)(bh)), \
+ "%rJ" ((UDItype)(al)), \
+ "rI" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ } while (0)
+
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ UDItype tmp1, tmp2, tmp3, tmp4; \
+ __asm__ __volatile__ ( \
+ "srl %7,0,%3\n\t" \
+ "mulx %3,%6,%1\n\t" \
+ "srlx %6,32,%2\n\t" \
+ "mulx %2,%3,%4\n\t" \
+ "sllx %4,32,%5\n\t" \
+ "srl %6,0,%3\n\t" \
+ "sub %1,%5,%5\n\t" \
+ "srlx %5,32,%5\n\t" \
+ "addcc %4,%5,%4\n\t" \
+ "srlx %7,32,%5\n\t" \
+ "mulx %3,%5,%3\n\t" \
+ "mulx %2,%5,%5\n\t" \
+ "sethi %%hi(0x80000000),%2\n\t" \
+ "addcc %4,%3,%4\n\t" \
+ "srlx %4,32,%4\n\t" \
+ "add %2,%2,%2\n\t" \
+ "movcc %%xcc,%%g0,%2\n\t" \
+ "addcc %5,%4,%5\n\t" \
+ "sllx %3,32,%3\n\t" \
+ "add %1,%3,%1\n\t" \
+ "add %5,%2,%0" \
+ : "=r" ((UDItype)(wh)), \
+ "=&r" ((UDItype)(wl)), \
+ "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \
+ : "r" ((UDItype)(u)), \
+ "r" ((UDItype)(v)) \
+ __CLOBBER_CC); \
+ } while (0)
+#define UMUL_TIME 96
+#define UDIV_TIME 230
+#endif /* sparc64 */
+
+#if defined (__vax__) && W_TYPE_SIZE == 32
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl2 %5,%1\n\tadwc %3,%0" \
+ : "=g" ((USItype) (sh)), \
+ "=&g" ((USItype) (sl)) \
+ : "%0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "%1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl2 %5,%1\n\tsbwc %3,%0" \
+ : "=g" ((USItype) (sh)), \
+ "=&g" ((USItype) (sl)) \
+ : "0" ((USItype) (ah)), \
+ "g" ((USItype) (bh)), \
+ "1" ((USItype) (al)), \
+ "g" ((USItype) (bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union { \
+ UDItype __ll; \
+ struct {USItype __l, __h;} __i; \
+ } __xx; \
+ USItype __m0 = (m0), __m1 = (m1); \
+ __asm__ ("emul %1,%2,$0,%0" \
+ : "=r" (__xx.__ll) \
+ : "g" (__m0), \
+ "g" (__m1)); \
+ (xh) = __xx.__i.__h; \
+ (xl) = __xx.__i.__l; \
+ (xh) += ((((SItype) __m0 >> 31) & __m1) \
+ + (((SItype) __m1 >> 31) & __m0)); \
+ } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {DItype __ll; \
+ struct {SItype __l, __h;} __i; \
+ } __xx; \
+ __xx.__i.__h = n1; __xx.__i.__l = n0; \
+ __asm__ ("ediv %3,%2,%0,%1" \
+ : "=g" (q), "=g" (r) \
+ : "g" (__xx.__ll), "g" (d)); \
+ } while (0)
+#endif /* __vax__ */
+
+#ifdef _TMS320C6X
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do \
+ { \
+ UDItype __ll; \
+ __asm__ ("addu .l1 %1, %2, %0" \
+ : "=a" (__ll) : "a" (al), "a" (bl)); \
+ (sl) = (USItype)__ll; \
+ (sh) = ((USItype)(__ll >> 32)) + (ah) + (bh); \
+ } \
+ while (0)
+
+#ifdef _TMS320C6400_PLUS
+#define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \
+ (w1) = (USItype) (__x >> 32); \
+ (w0) = (USItype) (__x); \
+ } while (0)
+#endif /* _TMS320C6400_PLUS */
+
+#define count_leading_zeros(count, x) ((count) = __builtin_clz (x))
+#ifdef _TMS320C6400
+#define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
+#endif
+#define UMUL_TIME 4
+#define UDIV_TIME 40
+#endif /* _TMS320C6X */
+
+#if defined (__xtensa__) && W_TYPE_SIZE == 32
+/* This code is not Xtensa-configuration-specific, so rely on the compiler
+ to expand builtin functions depending on what configuration features
+ are available. This avoids library calls when the operation can be
+ performed in-line. */
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ DWunion __w; \
+ __w.ll = __builtin_umulsidi3 (u, v); \
+ w1 = __w.s.high; \
+ w0 = __w.s.low; \
+ } while (0)
+#define __umulsidi3(u, v) __builtin_umulsidi3 (u, v)
+#define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X))
+#define count_trailing_zeros(COUNT, X) ((COUNT) = __builtin_ctz (X))
+#endif /* __xtensa__ */
+
+#if defined xstormy16
+extern UHItype __stormy16_count_leading_zeros (UHItype);
+#define count_leading_zeros(count, x) \
+ do \
+ { \
+ UHItype size; \
+ \
+ /* We assume that W_TYPE_SIZE is a multiple of 16... */ \
+ for ((count) = 0, size = W_TYPE_SIZE; size; size -= 16) \
+ { \
+ UHItype c; \
+ \
+ c = __clzhi2 ((x) >> (size - 16)); \
+ (count) += c; \
+ if (c != 16) \
+ break; \
+ } \
+ } \
+ while (0)
+#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
+#endif
+
+#if defined (__z8000__) && W_TYPE_SIZE == 16
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %H1,%H5\n\tadc %H0,%H3" \
+ : "=r" ((unsigned int)(sh)), \
+ "=&r" ((unsigned int)(sl)) \
+ : "%0" ((unsigned int)(ah)), \
+ "r" ((unsigned int)(bh)), \
+ "%1" ((unsigned int)(al)), \
+ "rQR" ((unsigned int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %H1,%H5\n\tsbc %H0,%H3" \
+ : "=r" ((unsigned int)(sh)), \
+ "=&r" ((unsigned int)(sl)) \
+ : "0" ((unsigned int)(ah)), \
+ "r" ((unsigned int)(bh)), \
+ "1" ((unsigned int)(al)), \
+ "rQR" ((unsigned int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {long int __ll; \
+ struct {unsigned int __h, __l;} __i; \
+ } __xx; \
+ unsigned int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mult %S0,%H3" \
+ : "=r" (__xx.__i.__h), \
+ "=r" (__xx.__i.__l) \
+ : "%1" (__m0), \
+ "rQR" (__m1)); \
+ (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
+ (xh) += ((((signed int) __m0 >> 15) & __m1) \
+ + (((signed int) __m1 >> 15) & __m0)); \
+ } while (0)
+#endif /* __z8000__ */
+
+#endif /* __GNUC__ */
+
+/* If this machine has no inline assembler, use C macros. */
+
+#if !defined (add_ssaaaa)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) + (bl); \
+ (sh) = (ah) + (bh) + (__x < (al)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+#if !defined (sub_ddmmss)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ UWtype __x; \
+ __x = (al) - (bl); \
+ (sh) = (ah) - (bh) - (__x > (al)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+/* If we lack umul_ppmm but have smul_ppmm, define umul_ppmm in terms of
+ smul_ppmm. */
+#if !defined (umul_ppmm) && defined (smul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UWtype __w1; \
+ UWtype __xm0 = (u), __xm1 = (v); \
+ smul_ppmm (__w1, w0, __xm0, __xm1); \
+ (w1) = __w1 + (-(__xm0 >> (W_TYPE_SIZE - 1)) & __xm1) \
+ + (-(__xm1 >> (W_TYPE_SIZE - 1)) & __xm0); \
+ } while (0)
+#endif
+
+/* If we still don't have umul_ppmm, define it using plain C. */
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UWtype __x0, __x1, __x2, __x3; \
+ UHWtype __ul, __vl, __uh, __vh; \
+ \
+ __ul = __ll_lowpart (u); \
+ __uh = __ll_highpart (u); \
+ __vl = __ll_lowpart (v); \
+ __vh = __ll_highpart (v); \
+ \
+ __x0 = (UWtype) __ul * __vl; \
+ __x1 = (UWtype) __ul * __vh; \
+ __x2 = (UWtype) __uh * __vl; \
+ __x3 = (UWtype) __uh * __vh; \
+ \
+ __x1 += __ll_highpart (__x0);/* this can't give carry */ \
+ __x1 += __x2; /* but this indeed can */ \
+ if (__x1 < __x2) /* did we get it? */ \
+ __x3 += __ll_B; /* yes, add it in the proper pos. */ \
+ \
+ (w1) = __x3 + __ll_highpart (__x1); \
+ (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \
+ } while (0)
+#endif
+
+#if !defined (__umulsidi3)
+#define __umulsidi3(u, v) \
+ ({DWunion __w; \
+ umul_ppmm (__w.s.high, __w.s.low, u, v); \
+ __w.ll; })
+#endif
+
+/* Define this unconditionally, so it can be used for debugging. */
+#define __udiv_qrnnd_c(q, r, n1, n0, d) \
+ do { \
+ UWtype __d1, __d0, __q1, __q0; \
+ UWtype __r1, __r0, __m; \
+ __d1 = __ll_highpart (d); \
+ __d0 = __ll_lowpart (d); \
+ \
+ __r1 = (n1) % __d1; \
+ __q1 = (n1) / __d1; \
+ __m = (UWtype) __q1 * __d0; \
+ __r1 = __r1 * __ll_B | __ll_highpart (n0); \
+ if (__r1 < __m) \
+ { \
+ __q1--, __r1 += (d); \
+ if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
+ if (__r1 < __m) \
+ __q1--, __r1 += (d); \
+ } \
+ __r1 -= __m; \
+ \
+ __r0 = __r1 % __d1; \
+ __q0 = __r1 / __d1; \
+ __m = (UWtype) __q0 * __d0; \
+ __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
+ if (__r0 < __m) \
+ { \
+ __q0--, __r0 += (d); \
+ if (__r0 >= (d)) \
+ if (__r0 < __m) \
+ __q0--, __r0 += (d); \
+ } \
+ __r0 -= __m; \
+ \
+ (q) = (UWtype) __q1 * __ll_B | __q0; \
+ (r) = __r0; \
+ } while (0)
+
+/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through
+ __udiv_w_sdiv (defined in libgcc or elsewhere). */
+#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd)
+#define udiv_qrnnd(q, r, nh, nl, d) \
+ do { \
+ USItype __r; \
+ (q) = __udiv_w_sdiv (&__r, nh, nl, d); \
+ (r) = __r; \
+ } while (0)
+#endif
+
+/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c. */
+#if !defined (udiv_qrnnd)
+#define UDIV_NEEDS_NORMALIZATION 1
+#define udiv_qrnnd __udiv_qrnnd_c
+#endif
+
+#if !defined (count_leading_zeros)
+#define count_leading_zeros(count, x) \
+ do { \
+ UWtype __xr = (x); \
+ UWtype __a; \
+ \
+ if (W_TYPE_SIZE <= 32) \
+ { \
+ __a = __xr < ((UWtype)1<<2*__BITS4) \
+ ? (__xr < ((UWtype)1<<__BITS4) ? 0 : __BITS4) \
+ : (__xr < ((UWtype)1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
+ } \
+ else \
+ { \
+ for (__a = W_TYPE_SIZE - 8; __a > 0; __a -= 8) \
+ if (((__xr >> __a) & 0xff) != 0) \
+ break; \
+ } \
+ \
+ (count) = W_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 W_TYPE_SIZE
+#endif
+
+#if !defined (count_trailing_zeros)
+/* Define count_trailing_zeros using count_leading_zeros. The latter might be
+ defined in asm, but if it is not, the C version above is good enough. */
+#define count_trailing_zeros(count, x) \
+ do { \
+ UWtype __ctz_x = (x); \
+ UWtype __ctz_c; \
+ count_leading_zeros (__ctz_c, __ctz_x & -__ctz_x); \
+ (count) = W_TYPE_SIZE - 1 - __ctz_c; \
+ } while (0)
+#endif
+
+#ifndef UDIV_NEEDS_NORMALIZATION
+#define UDIV_NEEDS_NORMALIZATION 0
+#endif
diff --git a/include/objalloc.h b/include/objalloc.h
index 36772d17b5..52857663ba 100644
--- a/include/objalloc.h
+++ b/include/objalloc.h
@@ -1,5 +1,5 @@
/* objalloc.h -- routines to allocate memory for objects
- Copyright 1997, 2001 Free Software Foundation, Inc.
+ Copyright 1997-2012 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Solutions.
This program is free software; you can redistribute it and/or modify it
@@ -91,7 +91,7 @@ extern void *_objalloc_alloc (struct objalloc *, unsigned long);
if (__len == 0) \
__len = 1; \
__len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \
- (__len <= __o->current_space \
+ (__len != 0 && __len <= __o->current_space \
? (__o->current_ptr += __len, \
__o->current_space -= __len, \
(void *) (__o->current_ptr - __len)) \
diff --git a/include/plugin-api.h b/include/plugin-api.h
index 122424c6cb..5797d4dce9 100644
--- a/include/plugin-api.h
+++ b/include/plugin-api.h
@@ -66,7 +66,8 @@ enum ld_plugin_output_file_type
{
LDPO_REL,
LDPO_EXEC,
- LDPO_DYN
+ LDPO_DYN,
+ LDPO_PIE
};
/* An input file managed by the plugin library. */
@@ -317,6 +318,33 @@ typedef
enum ld_plugin_status
(*ld_plugin_allow_section_ordering) (void);
+/* The linker's interface for specifying that a subset of sections is
+ to be mapped to a unique segment. If the plugin wants to call
+ unique_segment_for_sections, it must call this function from a
+ claim_file_handler or when it is first loaded. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_allow_unique_segment_for_sections) (void);
+
+/* The linker's interface for specifying that a specific set of sections
+ must be mapped to a unique segment. ELF segments do not have names
+ and the NAME is used as the name of the newly created output section
+ that is then placed in the unique PT_LOAD segment. FLAGS is used to
+ specify if any additional segment flags need to be set. For instance,
+ a specific segment flag can be set to identify this segment. Unsetting
+ segment flags that would be set by default is not possible. The
+ parameter SEGMENT_ALIGNMENT when non-zero will override the default. */
+
+typedef
+enum ld_plugin_status
+(*ld_plugin_unique_segment_for_sections) (
+ const char* segment_name,
+ uint64_t segment_flags,
+ uint64_t segment_alignment,
+ const struct ld_plugin_section * section_list,
+ unsigned int num_sections);
+
enum ld_plugin_level
{
LDPL_INFO,
@@ -330,31 +358,33 @@ enum ld_plugin_level
enum ld_plugin_tag
{
LDPT_NULL = 0,
- LDPT_API_VERSION,
- LDPT_GOLD_VERSION,
- LDPT_LINKER_OUTPUT,
- LDPT_OPTION,
- LDPT_REGISTER_CLAIM_FILE_HOOK,
- LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK,
- LDPT_REGISTER_CLEANUP_HOOK,
- LDPT_ADD_SYMBOLS,
- LDPT_GET_SYMBOLS,
- LDPT_ADD_INPUT_FILE,
- LDPT_MESSAGE,
- LDPT_GET_INPUT_FILE,
- LDPT_RELEASE_INPUT_FILE,
- LDPT_ADD_INPUT_LIBRARY,
- LDPT_OUTPUT_NAME,
- LDPT_SET_EXTRA_LIBRARY_PATH,
- LDPT_GNU_LD_VERSION,
- LDPT_GET_VIEW,
- LDPT_GET_INPUT_SECTION_COUNT,
- LDPT_GET_INPUT_SECTION_TYPE,
- LDPT_GET_INPUT_SECTION_NAME,
- LDPT_GET_INPUT_SECTION_CONTENTS,
- LDPT_UPDATE_SECTION_ORDER,
- LDPT_ALLOW_SECTION_ORDERING,
- LDPT_GET_SYMBOLS_V2
+ LDPT_API_VERSION = 1,
+ LDPT_GOLD_VERSION = 2,
+ LDPT_LINKER_OUTPUT = 3,
+ LDPT_OPTION = 4,
+ LDPT_REGISTER_CLAIM_FILE_HOOK = 5,
+ LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK = 6,
+ LDPT_REGISTER_CLEANUP_HOOK = 7,
+ LDPT_ADD_SYMBOLS = 8,
+ LDPT_GET_SYMBOLS = 9,
+ LDPT_ADD_INPUT_FILE = 10,
+ LDPT_MESSAGE = 11,
+ LDPT_GET_INPUT_FILE = 12,
+ LDPT_RELEASE_INPUT_FILE = 13,
+ LDPT_ADD_INPUT_LIBRARY = 14,
+ LDPT_OUTPUT_NAME = 15,
+ LDPT_SET_EXTRA_LIBRARY_PATH = 16,
+ LDPT_GNU_LD_VERSION = 17,
+ LDPT_GET_VIEW = 18,
+ LDPT_GET_INPUT_SECTION_COUNT = 19,
+ LDPT_GET_INPUT_SECTION_TYPE = 20,
+ LDPT_GET_INPUT_SECTION_NAME = 21,
+ LDPT_GET_INPUT_SECTION_CONTENTS = 22,
+ LDPT_UPDATE_SECTION_ORDER = 23,
+ LDPT_ALLOW_SECTION_ORDERING = 24,
+ LDPT_GET_SYMBOLS_V2 = 25,
+ LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS = 26,
+ LDPT_UNIQUE_SEGMENT_FOR_SECTIONS = 27
};
/* The plugin transfer vector. */
@@ -384,6 +414,8 @@ struct ld_plugin_tv
ld_plugin_get_input_section_contents tv_get_input_section_contents;
ld_plugin_update_section_order tv_update_section_order;
ld_plugin_allow_section_ordering tv_allow_section_ordering;
+ ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections;
+ ld_plugin_unique_segment_for_sections tv_unique_segment_for_sections;
} tv_u;
};
diff --git a/include/splay-tree.h b/include/splay-tree.h
index 480b2c43e7..a26135a099 100644
--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -37,18 +37,11 @@ extern "C" {
#include "ansidecl.h"
-#ifndef _WIN64
- typedef unsigned long int libi_uhostptr_t;
- typedef long int libi_shostptr_t;
-#else
-#ifdef __GNUC__
- __extension__
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
#endif
- typedef unsigned long long libi_uhostptr_t;
-#ifdef __GNUC__
- __extension__
-#endif
- typedef long long libi_shostptr_t;
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
#endif
#ifndef GTY
@@ -59,8 +52,8 @@ extern "C" {
these types, if necessary. These types should be sufficiently wide
that any pointer or scalar can be cast to these types, and then
cast back, without loss of precision. */
-typedef libi_uhostptr_t splay_tree_key;
-typedef libi_uhostptr_t splay_tree_value;
+typedef uintptr_t splay_tree_key;
+typedef uintptr_t splay_tree_value;
/* Forward declaration for a node in the tree. */
typedef struct splay_tree_node_s *splay_tree_node;
diff --git a/include/vtv-change-permission.h b/include/vtv-change-permission.h
new file mode 100644
index 0000000000..1adcb97459
--- /dev/null
+++ b/include/vtv-change-permission.h
@@ -0,0 +1,55 @@
+/* Copyright (C) 2013
+ Free Software Foundation
+
+ This file is part of GCC.
+
+ modify it under the terms of the GNU Library General Public License
+ as published by the Free Software Foundation; either version 2, or
+ (at your option) any later version.
+
+ In addition to the permissions in the GNU Library General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Library Public License restrictions do apply in other
+ respects; for example, they cover modification of the file, and
+ distribution when not linked into a combined executable.)
+
+ This program 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+
+#ifndef __VTV_H__
+#define __VTV_H__
+
+/* We could have used an enumeration here but it just makes it more
+ difficult for the compiler to generate a call to this. These are
+ used as arguments to the function __VLTChangePermission, declared
+ below. */
+#define __VLTP_READ_ONLY 0
+#define __VLTP_READ_WRITE 1
+
+#ifdef __cplusplus
+extern "C" void __VLTChangePermission (int);
+#else
+extern void __VLTChangePermission (int);
+#endif
+
+#ifdef BIG_PAGE_SIZE
+/* TODO - Replace '4096' below with correct big page size. */
+#define VTV_PAGE_SIZE 4096
+#else
+#define VTV_PAGE_SIZE 4096
+#endif
+
+
+
+#endif /* __VTV_H__ */