From 2bd5e058b774c204ec24f362180b9da438d08c31 Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Thu, 21 Nov 2013 16:38:57 +0000 Subject: [PATCH] gcc: another round of merges from the gcc pre-43 branch. Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks --- contrib/gcc/ChangeLog.gcc43 | 106 ++++++ contrib/gcc/Makefile.in | 3 +- contrib/gcc/builtin-types.def | 7 +- contrib/gcc/builtins.c | 97 +++++ contrib/gcc/builtins.def | 2 + contrib/gcc/cgraphunit.c | 2 +- contrib/gcc/collect2.c | 10 +- contrib/gcc/config/i386/beos-elf.h | 4 +- contrib/gcc/config/i386/cygwin.h | 2 +- contrib/gcc/config/i386/i386.c | 2 + contrib/gcc/config/i386/i386.h | 2 + contrib/gcc/config/i386/i386.md | 556 +++++++++++++++-------------- contrib/gcc/config/i386/nto.h | 2 +- contrib/gcc/config/rs6000/aix.h | 4 +- contrib/gcc/config/rs6000/sysv4.h | 2 +- contrib/gcc/config/svr4.h | 6 +- contrib/gcc/configure | 5 +- contrib/gcc/configure.ac | 5 +- contrib/gcc/coverage.c | 2 +- contrib/gcc/cp/ChangeLog.gcc43 | 28 ++ contrib/gcc/cp/decl2.c | 13 +- contrib/gcc/cp/name-lookup.c | 24 +- contrib/gcc/cppdefault.c | 2 +- contrib/gcc/doc/extend.texi | 10 + contrib/gcc/doc/libgcc.texi | 6 +- contrib/gcc/doc/rtl.texi | 5 + contrib/gcc/dwarf2out.c | 2 +- contrib/gcc/expr.c | 145 ++++---- contrib/gcc/fold-const.c | 2 + contrib/gcc/gcc.c | 4 +- contrib/gcc/genattrtab.c | 1 + contrib/gcc/genopinit.c | 1 + contrib/gcc/libgcc-std.ver | 7 + contrib/gcc/libgcc2.c | 26 +- contrib/gcc/libgcc2.h | 2 + contrib/gcc/mips-tdump.c | 4 +- contrib/gcc/mips-tfile.c | 4 +- contrib/gcc/mklibgcc.in | 2 +- contrib/gcc/optabs.c | 10 + contrib/gcc/optabs.h | 3 + contrib/gcc/reload1.c | 2 + contrib/gcc/rtl.def | 3 + contrib/gcc/simplify-rtx.c | 4 +- contrib/gcc/tree-ssa-propagate.c | 22 +- contrib/gcc/tree.c | 69 ++-- contrib/gcc/tree.h | 12 +- 46 files changed, 804 insertions(+), 428 deletions(-) create mode 100644 contrib/gcc/cp/ChangeLog.gcc43 diff --git a/contrib/gcc/ChangeLog.gcc43 b/contrib/gcc/ChangeLog.gcc43 index 3b3b3db7db08..a8faeff23e38 100644 --- a/contrib/gcc/ChangeLog.gcc43 +++ b/contrib/gcc/ChangeLog.gcc43 @@ -10,6 +10,12 @@ * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-31 Eric Christopher + + * expr.c (convert_move): Assert that we don't have a BLKmode + operand. + (store_expr): Handle BLKmode moves by calling emit_block_move. + 2007-05-24 Richard Sandiford (r125037) * postreload-gcse.c (reg_changed_after_insn_p): New function. @@ -99,6 +105,12 @@ (dwarf2out_imported_module_or_decl): Suppress struct debug information using should_emit_struct_debug when appropriate. +2007-04-16 Ian Lance Taylor (r123906) + + * tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer + predecessors at head rather than tail. + + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -333,6 +345,28 @@ * doc/invoke.texi (Warning Options): Update -Wparentheses description. +2006-12-12 Geoffrey Keating (r119820) + + * mips-tdump.c: Replace CROSS_COMPILE with + CROSS_DIRECTORY_STRUCTURE. + * mips-tfile.c: Likewise. + * gcc.c: Likewise. + * configure.ac: Likewise. + * cppdefault.c: Likewise. + * Makefile.in: Likewise. + * config/alpha/osf.h: Likewise. + * config/i386/cygwin.h: Likewise. + * config/i386/beos-elf.h: Likewise. + * config/i386/nto.h: Likewise. + * config/svr4.h: Likewise. + * config/rs6000/aix.h: Likewise. + * config/rs6000/sysv4.h: Likewise. + * collect2.c: Likewise. + * configure: Regenerate. + + * doc/tm.texi (Alignment Output): Document that ASM_OUTPUT_SKIP + actually takes an unsigned HOST_WIDE_INT for its second parameter. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -371,6 +405,30 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-11-07 Eric Christopher (r118576) + + * libgcc2.c (__bswapdi2): Rename from bswapDI2. + (__bswapsi2): Ditto. + * libgcc2.h: Remove transformation of bswap routines. + * config/i386/i386.md (bswapsi2): New. + (bswapdi2): Ditto. + +2006-10-31 Geoffrey Keating (r118360) + + * coverage.c (coverage_checksum_string): Update comment. + * dwarf2out.c (switch_to_eh_frame_section): Update for removal + of get_file_function_name. + * cgraphunit.c (cgraph_build_static_cdtor): Update for rename + of get_file_function_name_long. + * tree.c (get_file_function_name): Rename from + get_file_function_name_long; improve comment; handle 'I' and 'D' + specially when the target has ctor/dtor support; remove special + handling for 'F'. + (get_file_function_name): Remove. + * tree.h (get_file_function_name): Rename from + get_file_function_name_long. + (get_file_function_name): Remove prototype. + 2006-10-31 Geoffrey Keating (r118356) * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on @@ -521,3 +579,51 @@ * builtins.c (fold_builtin_classify): Fix typo. +2006-09-07 Eric Christopher (r118361) + Falk Hueffner + + * doc/extend.texi (__builtin_bswap32): Document. + (__builtin_bswap64): Ditto. + * doc/libgcc.texi (bswapsi2): Document. + (bswapdi2): Ditto. + * doc/rtl.texi (bswap): Document. + * optabs.c (expand_unop): Don't widen a bswap. + (init_optabs): Init bswap. Set libfuncs explicitly + for bswapsi2 and bswapdi2. + * optabs.h (OTI_bswap): New. + (bswap_optab): Ditto. + * genopinit.c (optabs): Handle bswap_optab. + * tree.h (tree_index): Add TI_UINT32_TYPE and + TI_UINT64_TYPE. + (uint32_type_node): New. + (uint64_type_node): Ditto. + * tree.c (build_common_tree_nodes_2): Initialize + uint32_type_node and uint64_type_node. + * builtins.c (expand_builtin_bswap): New. + (expand_builtin): Call. + (fold_builtin_bswap): New. + (fold_builtin_1): Call. + * fold-const.c (tree_expr_nonnegative_p): Return true + for bswap. + * builtin-types.def (BT_UINT32): New. + (BT_UINT64): Ditto. + (BT_FN_UINT32_UINT32): Ditto. + (BT_FN_UINT64_UINT64): Ditto. + * builtins.def (BUILT_IN_BSWAP32): New. + (BUILT_IN_BSWAP64): Ditto. + * rtl.def (BSWAP): New. + * genattrtab.c (check_attr_value): New. + * libgcc2.c (__bswapSI2): New. + (__bswapDI2): Ditto. + * libgcc2.h (__bswapSI2): Declare. + (__bswapDI2): Ditto. + * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. + * simplify-rtx.c (simplify_const_unary_operation): Return + 0 for BSWAP. + * libgcc-std.ver (__bwapsi2): Add. + (__bswapdi2): Ditto. + * reload1.c (eliminate_regs_1): Add bswap. + (elimination_effects): Ditto. + * config/i386/i386.h (x86_bswap): New. + (TARGET_BSWAP): Use. + * config/i386/i386.c (x86_bswap): Set. diff --git a/contrib/gcc/Makefile.in b/contrib/gcc/Makefile.in index 0f0ce9b4c743..eb19c2d07f6d 100644 --- a/contrib/gcc/Makefile.in +++ b/contrib/gcc/Makefile.in @@ -822,7 +822,8 @@ REAL_H = real.h $(MACHMODE_H) # IN_GCC distinguishes between code compiled into GCC itself and other # programs built during a bootstrap. -# autoconf inserts -DCROSS_COMPILE if we are building a cross compiler. +# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a +# cross compiler which does not use the native headers and libraries. INTERNAL_CFLAGS = -DIN_GCC @CROSS@ # This is the variable actually used when we compile. If you change this, diff --git a/contrib/gcc/builtin-types.def b/contrib/gcc/builtin-types.def index d6330b156525..5d42b2ef9aa8 100644 --- a/contrib/gcc/builtin-types.def +++ b/contrib/gcc/builtin-types.def @@ -75,6 +75,8 @@ DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node) DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node) DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node) +DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node) DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0)) DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node) DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node) @@ -204,6 +206,10 @@ DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFLOAT128, BT_DFLOAT128, BT_DFLOAT128) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG) +DEF_FUNCTION_TYPE_1 (BT_FN_ULONGLONG_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32) +DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64) DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR) @@ -435,4 +441,3 @@ DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR) DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE) - diff --git a/contrib/gcc/builtins.c b/contrib/gcc/builtins.c index a65d725bd281..ffae159c6873 100644 --- a/contrib/gcc/builtins.c +++ b/contrib/gcc/builtins.c @@ -4589,6 +4589,30 @@ expand_builtin_alloca (tree arglist, rtx target) return result; } +/* Expand a call to a bswap builtin. The arguments are in ARGLIST. MODE + is the mode to expand with. */ + +static rtx +expand_builtin_bswap (tree arglist, rtx target, rtx subtarget) +{ + enum machine_mode mode; + tree arg; + rtx op0; + + if (!validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + arg = TREE_VALUE (arglist); + mode = TYPE_MODE (TREE_TYPE (arg)); + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + target = expand_unop (mode, bswap_optab, op0, target, 1); + + gcc_assert (target); + + return convert_to_mode (mode, target, 0); +} + /* Expand a call to a unary builtin. The arguments are in ARGLIST. Return 0 if a normal call should be emitted rather than expanding the function in-line. If convenient, the result should be placed in TARGET. @@ -5877,6 +5901,14 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, expand_stack_restore (TREE_VALUE (arglist)); return const0_rtx; + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + target = expand_builtin_bswap (arglist, target, subtarget); + + if (target) + return target; + break; + CASE_INT_FN (BUILT_IN_FFS): case BUILT_IN_FFSIMAX: target = expand_builtin_unop (target_mode, arglist, target, @@ -7539,6 +7571,67 @@ fold_builtin_bitop (tree fndecl, tree arglist) return NULL_TREE; } +/* Fold function call to builtin_bswap and the long and long long + variants. Return NULL_TREE if no simplification can be made. */ +static tree +fold_builtin_bswap (tree fndecl, tree arglist) +{ + tree arg; + + if (! validate_arglist (arglist, INTEGER_TYPE, VOID_TYPE)) + return 0; + + /* Optimize constant value. */ + arg = TREE_VALUE (arglist); + if (TREE_CODE (arg) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (arg)) + { + HOST_WIDE_INT hi, width, r_hi = 0; + unsigned HOST_WIDE_INT lo, r_lo = 0; + tree type; + + type = TREE_TYPE (arg); + width = TYPE_PRECISION (type); + lo = TREE_INT_CST_LOW (arg); + hi = TREE_INT_CST_HIGH (arg); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + { + int s; + + for (s = 0; s < width; s += 8) + { + int d = width - s - 8; + unsigned HOST_WIDE_INT byte; + + if (s < HOST_BITS_PER_WIDE_INT) + byte = (lo >> s) & 0xff; + else + byte = (hi >> (s - HOST_BITS_PER_WIDE_INT)) & 0xff; + + if (d < HOST_BITS_PER_WIDE_INT) + r_lo |= byte << d; + else + r_hi |= byte << (d - HOST_BITS_PER_WIDE_INT); + } + } + + break; + + default: + gcc_unreachable (); + } + + if (width < HOST_BITS_PER_WIDE_INT) + return build_int_cst (TREE_TYPE (TREE_TYPE (fndecl)), r_lo); + else + return build_int_cst_wide (TREE_TYPE (TREE_TYPE (fndecl)), r_lo, r_hi); + } + + return NULL_TREE; +} /* Return true if EXPR is the real constant contained in VALUE. */ static bool @@ -9053,6 +9146,10 @@ fold_builtin_1 (tree fndecl, tree arglist, bool ignore) CASE_FLT_FN (BUILT_IN_LLRINT): return fold_fixed_mathfn (fndecl, arglist); + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: + return fold_builtin_bswap (fndecl, arglist); + CASE_INT_FN (BUILT_IN_FFS): CASE_INT_FN (BUILT_IN_CLZ): CASE_INT_FN (BUILT_IN_CTZ): diff --git a/contrib/gcc/builtins.def b/contrib/gcc/builtins.def index 37ea28c09602..7c1f2efef87d 100644 --- a/contrib/gcc/builtins.def +++ b/contrib/gcc/builtins.def @@ -594,6 +594,8 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_N DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST) +DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST) DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST) DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL) DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST) diff --git a/contrib/gcc/cgraphunit.c b/contrib/gcc/cgraphunit.c index 6d6ce2f1b42d..cc8b98f5480c 100644 --- a/contrib/gcc/cgraphunit.c +++ b/contrib/gcc/cgraphunit.c @@ -1676,7 +1676,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority) tree decl, name, resdecl; sprintf (which_buf, "%c_%d", which, counter++); - name = get_file_function_name_long (which_buf); + name = get_file_function_name (which_buf); decl = build_decl (FUNCTION_DECL, name, build_function_type (void_type_node, void_list_node)); diff --git a/contrib/gcc/collect2.c b/contrib/gcc/collect2.c index 02edde835d5a..c6c1f3f4a2ce 100644 --- a/contrib/gcc/collect2.c +++ b/contrib/gcc/collect2.c @@ -53,7 +53,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA the utilities are not correct for a cross-compiler; we have to hope that cross-versions are in the proper directories. */ -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #undef OBJECT_FORMAT_COFF #undef MD_EXEC_PREFIX #undef REAL_LD_FILE_NAME @@ -553,7 +553,7 @@ is_ctor_dtor (const char *s) static struct path_prefix cpath, path; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* This is the name of the target machine. We use it to form the name of the files to execute. */ @@ -746,7 +746,7 @@ main (int argc, char **argv) static const char *const strip_suffix = "strip"; static const char *const gstrip_suffix = "gstrip"; -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE /* If we look for a program in the compiler directories, we just use the short name, since these directories are already system-specific. But it we look for a program in the system directories, we need to @@ -775,7 +775,7 @@ main (int argc, char **argv) #endif const char *const full_strip_suffix = strip_suffix; const char *const full_gstrip_suffix = gstrip_suffix; -#endif /* CROSS_COMPILE */ +#endif /* CROSS_DIRECTORY_STRUCTURE */ const char *arg; FILE *outf; @@ -957,7 +957,7 @@ main (int argc, char **argv) c_file_name = getenv ("COLLECT_GCC"); if (c_file_name == 0) { -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE c_file_name = concat (target_machine, "-gcc", NULL); #else c_file_name = "gcc"; diff --git a/contrib/gcc/config/i386/beos-elf.h b/contrib/gcc/config/i386/beos-elf.h index f1e2cf8c6e19..3acc830bfe1e 100644 --- a/contrib/gcc/config/i386/beos-elf.h +++ b/contrib/gcc/config/i386/beos-elf.h @@ -135,7 +135,7 @@ Boston, MA 02110-1301, USA. */ for the BeOS include files relative to TOOL_INCLUDE_DIR. Yes, we use ANSI string concatenation here (FIXME) */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ @@ -177,7 +177,7 @@ Boston, MA 02110-1301, USA. */ { "/boot/develop/headers", 0, 0, 0 }, \ { 0, 0, 0, 0 } \ } -#else /* CROSS_COMPILE */ +#else /* CROSS_DIRECTORY_STRUCTURE */ #undef INCLUDE_DEFAULTS #define INCLUDE_DEFAULTS \ { \ diff --git a/contrib/gcc/config/i386/cygwin.h b/contrib/gcc/config/i386/cygwin.h index a7d5e47cdc95..fe85a6df4cde 100644 --- a/contrib/gcc/config/i386/cygwin.h +++ b/contrib/gcc/config/i386/cygwin.h @@ -146,7 +146,7 @@ char cygwin_tool_include_dir[sizeof (TOOL_INCLUDE_DIR) + 1 #undef TOOL_INCLUDE_DIR #define TOOL_INCLUDE_DIR ((const char *) cygwin_tool_include_dir) -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef STANDARD_INCLUDE_DIR #define STANDARD_INCLUDE_DIR "/usr/include" char cygwin_standard_include_dir[sizeof (STANDARD_INCLUDE_DIR) + 1 diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c index 1598ae91ecaa..51bd93cf9f4b 100644 --- a/contrib/gcc/config/i386/i386.c +++ b/contrib/gcc/config/i386/i386.c @@ -1089,6 +1089,8 @@ const int x86_cmpxchg = ~m_386; const int x86_cmpxchg8b = ~(m_386 | m_486); /* Exchange and add was added for 80486. */ const int x86_xadd = ~m_386; +/* Byteswap was added for 80486. */ +const int x86_bswap = ~m_386; const int x86_pad_returns = m_ATHLON_K8_AMDFAM10 | m_CORE2 | m_GENERIC; /* In case the average insn count for single function invocation is diff --git a/contrib/gcc/config/i386/i386.h b/contrib/gcc/config/i386/i386.h index 1394fbabfa71..4a303f61521f 100644 --- a/contrib/gcc/config/i386/i386.h +++ b/contrib/gcc/config/i386/i386.h @@ -168,6 +168,7 @@ extern const int x86_use_bt; extern const int x86_cmpxchg, x86_cmpxchg8b, x86_xadd; extern const int x86_use_incdec; extern const int x86_pad_returns; +extern const int x86_bswap; extern const int x86_partial_flag_reg_stall; extern int x86_prefetch_sse, x86_cmpxchg16b; @@ -243,6 +244,7 @@ extern int x86_prefetch_sse, x86_cmpxchg16b; #define TARGET_CMPXCHG8B (x86_cmpxchg8b & (1 << ix86_arch)) #define TARGET_CMPXCHG16B (x86_cmpxchg16b) #define TARGET_XADD (x86_xadd & (1 << ix86_arch)) +#define TARGET_BSWAP (x86_bswap & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 diff --git a/contrib/gcc/config/i386/i386.md b/contrib/gcc/config/i386/i386.md index 21b9cb39fe3e..f009cbb42a1d 100644 --- a/contrib/gcc/config/i386/i386.md +++ b/contrib/gcc/config/i386/i386.md @@ -284,14 +284,14 @@ (const_int 0))) ;; Set when string REP prefix is used. -(define_attr "prefix_rep" "" +(define_attr "prefix_rep" "" (if_then_else (and (eq_attr "unit" "sse") (eq_attr "mode" "SF,DF")) (const_int 1) (const_int 0))) ;; Set when 0f opcode prefix is used. (define_attr "prefix_0f" "" - (if_then_else + (if_then_else (ior (eq_attr "type" "imovx,setcc,icmov,bitmanip") (eq_attr "unit" "sse,mmx")) (const_int 1) @@ -466,7 +466,7 @@ ;; All x87 floating point modes (define_mode_macro X87MODEF [SF DF XF]) - + ;; All integer modes handled by x87 fisttp operator. (define_mode_macro X87MODEI [HI SI DI]) @@ -475,7 +475,7 @@ ;; All SSE floating point modes (define_mode_macro SSEMODEF [SF DF]) - + ;; All integer modes handled by SSE cvtts?2si* operators. (define_mode_macro SSEMODEI24 [SI DI]) @@ -1098,7 +1098,7 @@ ;; Push/pop instructions. They are separate since autoinc/dec is not a ;; general_operand. ;; -;; %%% We don't use a post-inc memory reference because x86 is not a +;; %%% We don't use a post-inc memory reference because x86 is not a ;; general AUTO_INC_DEC host, which impacts how it is treated in flow. ;; Changing this impacts compiler performance on other non-AUTO_INC_DEC ;; targets without our curiosities, and it is just as easy to represent @@ -1160,7 +1160,7 @@ [(set_attr "type" "alu1") (set_attr "mode" "SI") (set_attr "length_immediate" "0")]) - + (define_insn "*movsi_or" [(set (match_operand:SI 0 "register_operand" "=r") (match_operand:SI 1 "immediate_operand" "i")) @@ -2308,7 +2308,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], SFmode))" + || memory_operand (operands[0], SFmode))" { switch (which_alternative) { @@ -2368,7 +2368,7 @@ (const_string "V4SF")) /* For architectures resolving dependencies on whole SSE registers use APS move to break dependency - chains, otherwise use short move to avoid extra work. + chains, otherwise use short move to avoid extra work. Do the same for architectures resolving dependencies on the parts. While in DF mode it is better to always handle @@ -2476,7 +2476,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2596,7 +2596,7 @@ && (reload_in_progress || reload_completed || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE) || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], DFmode))" + || memory_operand (operands[0], DFmode))" { switch (which_alternative) { @@ -2712,10 +2712,10 @@ (match_operand:DF 1 "general_operand" ""))] "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -2807,7 +2807,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2841,7 +2841,7 @@ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && (reload_in_progress || reload_completed || GET_CODE (operands[1]) != CONST_DOUBLE - || memory_operand (operands[0], XFmode))" + || memory_operand (operands[0], XFmode))" { switch (which_alternative) { @@ -2875,10 +2875,10 @@ "reload_completed && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM) && GET_MODE (operands[0]) == XFmode - && ! (ANY_FP_REG_P (operands[0]) || + && ! (ANY_FP_REG_P (operands[0]) || (GET_CODE (operands[0]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[0])))) - && ! (ANY_FP_REG_P (operands[1]) || + && ! (ANY_FP_REG_P (operands[1]) || (GET_CODE (operands[1]) == SUBREG && ANY_FP_REG_P (SUBREG_REG (operands[1]))))" [(const_int 0)] @@ -3073,7 +3073,7 @@ [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_operand:HI 0 "register_operand" "") @@ -3143,7 +3143,7 @@ [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" ""))) (clobber (reg:CC FLAGS_REG))] - "reload_completed + "reload_completed && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))" [(set (match_dup 0) @@ -3220,7 +3220,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (zero_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3229,7 +3229,7 @@ [(set (match_dup 4) (const_int 0))] "split_di (&operands[0], 1, &operands[3], &operands[4]);") -(define_split +(define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") (zero_extend:DI (match_operand:SI 1 "general_operand" ""))) (clobber (reg:CC FLAGS_REG))] @@ -3308,7 +3308,7 @@ (set_attr "mode" "DI")]) ;; Extend to memory case when source register does die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3323,7 +3323,7 @@ "split_di (&operands[0], 1, &operands[3], &operands[4]);") ;; Extend to memory case when source register does not die. -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3353,7 +3353,7 @@ ;; Extend to register case. Optimize case where source and destination ;; registers match and cases where we can use cltd. -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (sign_extend:DI (match_operand:SI 1 "register_operand" ""))) (clobber (reg:CC FLAGS_REG)) @@ -3482,7 +3482,7 @@ ;; These are all no-ops in the model used for the 80387. So just ;; emit moves. -;; %%% Kill these when call knows how to work out a DFmode push earlier. +;; %%% Kill these when call knows how to work out a DFmode push earlier. (define_insn "*dummy_extendsfdf2" [(set (match_operand:DF 0 "push_operand" "=<") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "fY")))] @@ -4365,7 +4365,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4380,7 +4380,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (fix:DI (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4421,7 +4421,7 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4434,7 +4434,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (fix:X87MODEI12 (match_operand 1 "register_operand" ""))) (use (match_operand:HI 2 "memory_operand" "")) @@ -4913,7 +4913,7 @@ (define_insn "*addsi3_carry_zext" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI + (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 3 "ix86_carry_flag_operator" "") (match_operand:SI 1 "nonimmediate_operand" "%0")) (match_operand:SI 2 "general_operand" "rim")))) @@ -5222,7 +5222,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "x86_64_general_operand" "rme,re")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "nonimmediate_operand" "=r,rm") (plus:DI (match_dup 1) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5369,7 +5369,7 @@ (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "x86_64_general_operand" "rme")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:DI 0 "=r"))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5568,7 +5568,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") (match_operand:SI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:SI 0 "nonimmediate_operand" "=r,rm") (plus:SI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -5616,7 +5616,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] "TARGET_64BIT && ix86_match_ccmode (insn, CCGOCmode) @@ -5794,7 +5794,7 @@ (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") (match_operand:SI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:SI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM) @@ -5934,7 +5934,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0") (match_operand:HI 2 "general_operand" "rmni,rni")) - (const_int 0))) + (const_int 0))) (set (match_operand:HI 0 "nonimmediate_operand" "=r,rm") (plus:HI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCGOCmode) @@ -6054,7 +6054,7 @@ (compare (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0") (match_operand:HI 2 "general_operand" "rmni")) - (const_int 0))) + (const_int 0))) (clobber (match_scratch:HI 0 "=r"))] "ix86_match_ccmode (insn, CCGOCmode) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" @@ -7483,7 +7483,7 @@ (match_operand:DF 2 "nonimmediate_operand" "")))] "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)" "") - + (define_expand "divsf3" [(set (match_operand:SF 0 "register_operand" "") (div:SF (match_operand:SF 1 "register_operand" "") @@ -8161,7 +8161,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bq|x}\t{%1,%0|%0, %1}"; @@ -8226,7 +8226,7 @@ gcc_assert (INTVAL (operands[2]) == 0xffff); mode = HImode; } - + operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) return "movz{bl|x}\t{%1,%0|%0, %1}"; @@ -8270,7 +8270,7 @@ [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8)) @@ -8458,7 +8458,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8487,7 +8487,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_dup 1) (const_int 8) @@ -8503,7 +8503,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8521,7 +8521,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8864,7 +8864,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8881,7 +8881,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8900,7 +8900,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -8919,7 +8919,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (ior:SI + (ior:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9202,7 +9202,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9219,7 +9219,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9238,7 +9238,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) @@ -9257,7 +9257,7 @@ [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_operand 1 "ext_register_operand" "0") (const_int 8) (const_int 8)) @@ -9325,7 +9325,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "!TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9346,7 +9346,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))] "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)" @@ -9368,7 +9368,7 @@ (set (zero_extract:SI (match_operand 0 "ext_register_operand" "") (const_int 8) (const_int 8)) - (xor:SI + (xor:SI (zero_extract:SI (match_dup 1) (const_int 8) (const_int 8)) (match_dup 2)))])] "" @@ -9867,7 +9867,7 @@ enum machine_mode mode = GET_MODE (operands[0]); enum machine_mode vmode = GET_MODE (operands[2]); rtx tmp; - + operands[0] = simplify_gen_subreg (vmode, operands[0], mode, 0); operands[1] = simplify_gen_subreg (vmode, operands[1], mode, 0); if (operands_match_p (operands[0], operands[2])) @@ -9891,7 +9891,7 @@ "reload_completed" [(parallel [(set (match_dup 0) (match_dup 1)) (clobber (reg:CC FLAGS_REG))])] -{ +{ rtx tmp; operands[0] = gen_lowpart (SImode, operands[0]); if (GET_CODE (operands[1]) == ABS) @@ -9998,7 +9998,7 @@ operands[1] = tmp; }) -;; Conditionalize these after reload. If they match before reload, we +;; Conditionalize these after reload. If they match before reload, we ;; lose the clobber and ability to use integer instructions. (define_insn "*negsf2_1" @@ -11415,8 +11415,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11448,8 +11448,8 @@ && ix86_binary_operator_ok (ASHIFTRT, DImode, operands)" "sar{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11628,8 +11628,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11684,8 +11684,8 @@ && ix86_binary_operator_ok (ASHIFTRT, SImode, operands)" "sar{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11785,8 +11785,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11818,8 +11818,8 @@ && ix86_binary_operator_ok (ASHIFTRT, HImode, operands)" "sar{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11888,8 +11888,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{b}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11903,8 +11903,8 @@ && (TARGET_SHIFT1 || optimize_size)" "sar{b}\t%0" [(set_attr "type" "ishift1") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -11949,8 +11949,8 @@ && ix86_binary_operator_ok (ASHIFTRT, QImode, operands)" "sar{b}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12042,7 +12042,7 @@ "#" [(set_attr "type" "multi")]) -(define_split +(define_split [(set (match_operand:TI 0 "register_operand" "") (lshiftrt:TI (match_operand:TI 1 "register_operand" "") (match_operand:QI 2 "register_operand" ""))) @@ -12052,7 +12052,7 @@ [(const_int 0)] "ix86_split_lshr (operands, operands[3], TImode); DONE;") -(define_split +(define_split [(set (match_operand:TI 0 "register_operand" "") (lshiftrt:TI (match_operand:TI 1 "register_operand" "") (match_operand:QI 2 "immediate_operand" ""))) @@ -12077,8 +12077,8 @@ && (TARGET_SHIFT1 || optimize_size)" "shr{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12110,8 +12110,8 @@ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "shr{q}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12186,7 +12186,7 @@ [(const_int 0)] "ix86_split_lshr (operands, operands[3], DImode); DONE;") -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (lshiftrt:DI (match_operand:DI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) @@ -12213,8 +12213,8 @@ && (TARGET_SHIFT1 || optimize_size)" "shr{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12270,8 +12270,8 @@ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "shr{l}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12371,8 +12371,8 @@ && (TARGET_SHIFT1 || optimize_size)" "shr{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12404,8 +12404,8 @@ && ix86_binary_operator_ok (LSHIFTRT, HImode, operands)" "shr{w}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12474,8 +12474,8 @@ && (TARGET_SHIFT1 || optimize_size)" "shr{b}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12488,8 +12488,8 @@ && (TARGET_SHIFT1 || optimize_size)" "shr{b}\t%0" [(set_attr "type" "ishift1") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12534,8 +12534,8 @@ && ix86_binary_operator_ok (LSHIFTRT, QImode, operands)" "shr{b}\t%0" [(set_attr "type" "ishift") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12608,7 +12608,7 @@ }) ;; Implement rotation using two double-precision shift instructions -;; and a scratch register. +;; and a scratch register. (define_insn_and_split "ix86_rotldi3" [(set (match_operand:DI 0 "register_operand" "=r") (rotate:DI (match_operand:DI 1 "register_operand" "0") @@ -12616,7 +12616,7 @@ (clobber (reg:CC FLAGS_REG)) (clobber (match_scratch:SI 3 "=&r"))] "!TARGET_64BIT" - "" + "" "&& reload_completed" [(set (match_dup 3) (match_dup 4)) (parallel @@ -12632,7 +12632,7 @@ (minus:QI (const_int 32) (match_dup 2))))) (clobber (reg:CC FLAGS_REG))])] "split_di (operands, 1, operands + 4, operands + 5);") - + (define_insn "*rotlsi3_1_one_bit_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=rm") (rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0") @@ -12642,8 +12642,8 @@ && (TARGET_SHIFT1 || optimize_size)" "rol{q}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12676,8 +12676,8 @@ && (TARGET_SHIFT1 || optimize_size)" "rol{l}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12735,8 +12735,8 @@ && (TARGET_SHIFT1 || optimize_size)" "rol{w}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12769,8 +12769,8 @@ && (TARGET_SHIFT1 || optimize_size)" "rol{b}\t%0" [(set_attr "type" "rotate1") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12783,8 +12783,8 @@ && (TARGET_SHIFT1 || optimize_size)" "rol{b}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12830,9 +12830,9 @@ emit_insn (gen_ix86_rotrdi3 (operands[0], operands[1], operands[2])); DONE; }) - + ;; Implement rotation using two double-precision shift instructions -;; and a scratch register. +;; and a scratch register. (define_insn_and_split "ix86_rotrdi3" [(set (match_operand:DI 0 "register_operand" "=r") (rotatert:DI (match_operand:DI 1 "register_operand" "0") @@ -12866,8 +12866,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{q}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand:DI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:DI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12900,8 +12900,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{l}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12915,8 +12915,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{l}\t%k0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand:SI 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand:SI 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12962,8 +12962,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{w}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -12996,8 +12996,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{b}\t%0" [(set_attr "type" "rotate") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -13010,8 +13010,8 @@ && (TARGET_SHIFT1 || optimize_size)" "ror{b}\t%0" [(set_attr "type" "rotate1") - (set (attr "length") - (if_then_else (match_operand 0 "register_operand" "") + (set (attr "length") + (if_then_else (match_operand 0 "register_operand" "") (const_string "2") (const_string "*")))]) @@ -13378,14 +13378,14 @@ (set_attr "mode" "QI")]) ;; In general it is not safe to assume too much about CCmode registers, -;; so simplify-rtx stops when it sees a second one. Under certain +;; so simplify-rtx stops when it sees a second one. Under certain ;; conditions this is safe on x86, so help combine not create ;; ;; seta %al ;; testb %al, %al ;; sete %al -(define_split +(define_split [(set (match_operand:QI 0 "nonimmediate_operand" "") (ne:QI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -13396,7 +13396,7 @@ PUT_MODE (operands[1], QImode); }) -(define_split +(define_split [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) (ne:QI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -13407,7 +13407,7 @@ PUT_MODE (operands[1], QImode); }) -(define_split +(define_split [(set (match_operand:QI 0 "nonimmediate_operand" "") (eq:QI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -13427,7 +13427,7 @@ FAIL; }) -(define_split +(define_split [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "")) (eq:QI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -13659,14 +13659,14 @@ (const_int 6)))]) ;; In general it is not safe to assume too much about CCmode registers, -;; so simplify-rtx stops when it sees a second one. Under certain +;; so simplify-rtx stops when it sees a second one. Under certain ;; conditions this is safe on x86, so help combine not create ;; ;; seta %al ;; testb %al, %al ;; je Lfoo -(define_split +(define_split [(set (pc) (if_then_else (ne (match_operator 0 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -13681,8 +13681,8 @@ { PUT_MODE (operands[0], VOIDmode); }) - -(define_split + +(define_split [(set (pc) (if_then_else (eq (match_operator 0 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) @@ -14157,7 +14157,7 @@ return "call\t%P0"; } [(set_attr "type" "call")]) - + (define_insn "*call_pop_1" [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm")) (match_operand:SI 1 "" "")) @@ -14493,7 +14493,7 @@ }) (define_insn_and_split "eh_return_si" - [(set (pc) + [(set (pc) (unspec [(match_operand:SI 0 "register_operand" "c")] UNSPEC_EH_RETURN))] "!TARGET_64BIT" @@ -14503,7 +14503,7 @@ "ix86_expand_epilogue (2); DONE;") (define_insn_and_split "eh_return_di" - [(set (pc) + [(set (pc) (unspec [(match_operand:DI 0 "register_operand" "c")] UNSPEC_EH_RETURN))] "TARGET_64BIT" @@ -14530,7 +14530,7 @@ (define_expand "ffssi2" [(parallel - [(set (match_operand:SI 0 "register_operand" "") + [(set (match_operand:SI 0 "register_operand" "") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" ""))) (clobber (match_scratch:SI 2 "")) (clobber (reg:CC FLAGS_REG))])] @@ -14538,7 +14538,7 @@ "") (define_insn_and_split "*ffs_cmove" - [(set (match_operand:SI 0 "register_operand" "=r") + [(set (match_operand:SI 0 "register_operand" "=r") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))) (clobber (match_scratch:SI 2 "=&r")) (clobber (reg:CC FLAGS_REG))] @@ -14557,7 +14557,7 @@ "") (define_insn_and_split "*ffs_no_cmove" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r") + [(set (match_operand:SI 0 "nonimmediate_operand" "=r") (ffs:SI (match_operand:SI 1 "nonimmediate_operand" "rm"))) (clobber (match_scratch:SI 2 "=&q")) (clobber (reg:CC FLAGS_REG))] @@ -14591,7 +14591,7 @@ (define_expand "ffsdi2" [(parallel - [(set (match_operand:DI 0 "register_operand" "") + [(set (match_operand:DI 0 "register_operand" "") (ffs:DI (match_operand:DI 1 "nonimmediate_operand" ""))) (clobber (match_scratch:DI 2 "")) (clobber (reg:CC FLAGS_REG))])] @@ -14599,7 +14599,7 @@ "") (define_insn_and_split "*ffs_rex64" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "register_operand" "=r") (ffs:DI (match_operand:DI 1 "nonimmediate_operand" "rm"))) (clobber (match_scratch:DI 2 "=&r")) (clobber (reg:CC FLAGS_REG))] @@ -14718,6 +14718,24 @@ (set_attr "type" "bitmanip") (set_attr "mode" "SI")]) +(define_insn "bswapsi2" + [(set (match_operand:SI 0 "register_operand" "=r") + (bswap:SI (match_operand:SI 1 "register_operand" "0"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_BSWAP" + "bswap\t%k0" + [(set_attr "prefix_0f" "1") + (set_attr "length" "2")]) + +(define_insn "bswapdi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (bswap:DI (match_operand:DI 1 "register_operand" "0"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_64BIT && TARGET_BSWAP" + "bswap\t%0" + [(set_attr "prefix_0f" "1") + (set_attr "length" "3")]) + (define_expand "clzdi2" [(parallel [(set (match_operand:DI 0 "register_operand" "") @@ -15231,12 +15249,12 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") + [(set (attr "type") (if_then_else (eq_attr "alternative" "1") - (if_then_else (match_operand:SF 3 "mult_operator" "") + (if_then_else (match_operand:SF 3 "mult_operator" "") (const_string "ssemul") (const_string "sseadd")) - (if_then_else (match_operand:SF 3 "mult_operator" "") + (if_then_else (match_operand:SF 3 "mult_operator" "") (const_string "fmul") (const_string "fop")))) (set_attr "mode" "SF")]) @@ -15250,8 +15268,8 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:SF 3 "mult_operator" "") + [(set (attr "type") + (if_then_else (match_operand:SF 3 "mult_operator" "") (const_string "ssemul") (const_string "sseadd"))) (set_attr "mode" "SF")]) @@ -15265,8 +15283,8 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:SF 3 "mult_operator" "") + [(set (attr "type") + (if_then_else (match_operand:SF 3 "mult_operator" "") (const_string "fmul") (const_string "fop"))) (set_attr "mode" "SF")]) @@ -15280,7 +15298,7 @@ && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") + [(set (attr "type") (cond [(and (eq_attr "alternative" "2") (match_operand:SF 3 "mult_operator" "")) (const_string "ssemul") @@ -15289,9 +15307,9 @@ (const_string "ssediv") (eq_attr "alternative" "2") (const_string "sseadd") - (match_operand:SF 3 "mult_operator" "") + (match_operand:SF 3 "mult_operator" "") (const_string "fmul") - (match_operand:SF 3 "div_operator" "") + (match_operand:SF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15305,7 +15323,7 @@ "TARGET_SSE_MATH && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") + [(set (attr "type") (cond [(match_operand:SF 3 "mult_operator" "") (const_string "ssemul") (match_operand:SF 3 "div_operator" "") @@ -15324,10 +15342,10 @@ && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:SF 3 "mult_operator" "") (const_string "fmul") - (match_operand:SF 3 "div_operator" "") + (match_operand:SF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15341,10 +15359,10 @@ (match_operand:SF 2 "register_operand" "0,0")]))] "TARGET_80387 && TARGET_USE_MODE_FIOP && !TARGET_SSE_MATH" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:SF 3 "mult_operator" "") (const_string "fmul") - (match_operand:SF 3 "div_operator" "") + (match_operand:SF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15358,10 +15376,10 @@ (float:SF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))] "TARGET_80387 && TARGET_USE_MODE_FIOP && !TARGET_SSE_MATH" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:SF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:SF 3 "mult_operator" "") (const_string "fmul") - (match_operand:SF 3 "div_operator" "") + (match_operand:SF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15377,12 +15395,12 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") + [(set (attr "type") (if_then_else (eq_attr "alternative" "1") - (if_then_else (match_operand:DF 3 "mult_operator" "") + (if_then_else (match_operand:DF 3 "mult_operator" "") (const_string "ssemul") (const_string "sseadd")) - (if_then_else (match_operand:DF 3 "mult_operator" "") + (if_then_else (match_operand:DF 3 "mult_operator" "") (const_string "fmul") (const_string "fop")))) (set_attr "mode" "DF")]) @@ -15396,8 +15414,8 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (if_then_else (match_operand:DF 3 "mult_operator" "") (const_string "ssemul") (const_string "sseadd"))) (set_attr "mode" "DF")]) @@ -15411,8 +15429,8 @@ && COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (if_then_else (match_operand:DF 3 "mult_operator" "") (const_string "fmul") (const_string "fop"))) (set_attr "mode" "DF")]) @@ -15426,7 +15444,7 @@ && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") + [(set (attr "type") (cond [(and (eq_attr "alternative" "2") (match_operand:DF 3 "mult_operator" "")) (const_string "ssemul") @@ -15435,9 +15453,9 @@ (const_string "ssediv") (eq_attr "alternative" "2") (const_string "sseadd") - (match_operand:DF 3 "mult_operator" "") + (match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15452,7 +15470,7 @@ && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" [(set_attr "mode" "DF") - (set (attr "type") + (set (attr "type") (cond [(match_operand:DF 3 "mult_operator" "") (const_string "ssemul") (match_operand:DF 3 "div_operator" "") @@ -15470,8 +15488,8 @@ && !COMMUTATIVE_ARITH_P (operands[3]) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") (match_operand:DF 3 "div_operator" "") (const_string "fdiv") @@ -15488,10 +15506,10 @@ "TARGET_80387 && TARGET_USE_MODE_FIOP && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15506,10 +15524,10 @@ "TARGET_80387 && TARGET_USE_MODE_FIOP && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15524,10 +15542,10 @@ "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH) && (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != MEM)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15541,10 +15559,10 @@ (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))] "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15559,10 +15577,10 @@ (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))] "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:DF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:DF 3 "mult_operator" "") (const_string "fmul") - (match_operand:DF 3 "div_operator" "") + (match_operand:DF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15576,8 +15594,8 @@ "TARGET_80387 && COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (if_then_else (match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (if_then_else (match_operand:XF 3 "mult_operator" "") (const_string "fmul") (const_string "fop"))) (set_attr "mode" "XF")]) @@ -15590,10 +15608,10 @@ "TARGET_80387 && !COMMUTATIVE_ARITH_P (operands[3])" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15606,10 +15624,10 @@ (match_operand:XF 2 "register_operand" "0,0")]))] "TARGET_80387 && TARGET_USE_MODE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15623,10 +15641,10 @@ (float:XF (match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))] "TARGET_80387 && TARGET_USE_MODE_FIOP" "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15640,10 +15658,10 @@ (match_operand:XF 2 "register_operand" "0,f")]))] "TARGET_80387" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15657,10 +15675,10 @@ (match_operand 2 "nonimmediate_operand" "fm,0"))]))] "TARGET_80387" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15675,10 +15693,10 @@ (match_operand 2 "nonimmediate_operand" "fm,0"))]))] "TARGET_80387" "* return output_387_binary_op (insn, operands);" - [(set (attr "type") - (cond [(match_operand:XF 3 "mult_operator" "") + [(set (attr "type") + (cond [(match_operand:XF 3 "mult_operator" "") (const_string "fmul") - (match_operand:XF 3 "div_operator" "") + (match_operand:XF 3 "div_operator" "") (const_string "fdiv") ] (const_string "fop"))) @@ -15692,7 +15710,7 @@ "TARGET_80387 && reload_completed && FLOAT_MODE_P (GET_MODE (operands[0]))" [(const_int 0)] -{ +{ operands[4] = ix86_force_to_memory (GET_MODE (operands[1]), operands[1]); operands[4] = gen_rtx_FLOAT (GET_MODE (operands[0]), operands[4]); emit_insn (gen_rtx_SET (VOIDmode, operands[0], @@ -16105,7 +16123,7 @@ (set_attr "mode" "XF")]) ;; With sincos pattern defined, sin and cos builtin function will be -;; expanded to sincos pattern with one of its outputs left unused. +;; expanded to sincos pattern with one of its outputs left unused. ;; Cse pass will detected, if two sincos patterns can be combined, ;; otherwise sincos pattern will be split back to sin or cos pattern, ;; depending on the unused output. @@ -17507,7 +17525,7 @@ [(set_attr "type" "fpspc") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST)) @@ -17519,7 +17537,7 @@ (set (match_dup 0) (match_dup 2))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST)) @@ -17570,7 +17588,7 @@ [(set_attr "type" "fpspc") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST)) @@ -17581,7 +17599,7 @@ (set (match_dup 0) (match_dup 2))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST)) @@ -17744,7 +17762,7 @@ (set_attr "i387_cw" "floor") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_FLOOR)) @@ -17760,7 +17778,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_FLOOR)) @@ -17802,7 +17820,7 @@ (set_attr "i387_cw" "floor") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_FLOOR)) @@ -17817,7 +17835,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_FLOOR)) @@ -17985,7 +18003,7 @@ (set_attr "i387_cw" "ceil") (set_attr "mode" "DI")]) -(define_split +(define_split [(set (match_operand:DI 0 "register_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_CEIL)) @@ -18001,7 +18019,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:DI 0 "memory_operand" "") (unspec:DI [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_CEIL)) @@ -18043,7 +18061,7 @@ (set_attr "i387_cw" "ceil") (set_attr "mode" "")]) -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "register_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_CEIL)) @@ -18058,7 +18076,7 @@ (set (match_dup 0) (match_dup 4))] "") -(define_split +(define_split [(set (match_operand:X87MODEI12 0 "memory_operand" "") (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] UNSPEC_FIST_CEIL)) @@ -18452,11 +18470,11 @@ (define_insn "*rep_movdi_rex64" [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2") (const_int 3)) (match_operand:DI 3 "register_operand" "0"))) - (set (match_operand:DI 1 "register_operand" "=S") + (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (ashift:DI (match_dup 5) (const_int 3)) (match_operand:DI 4 "register_operand" "1"))) (set (mem:BLK (match_dup 3)) @@ -18472,11 +18490,11 @@ (define_insn "*rep_movsi" [(set (match_operand:SI 2 "register_operand" "=c") (const_int 0)) - (set (match_operand:SI 0 "register_operand" "=D") + (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (ashift:SI (match_operand:SI 5 "register_operand" "2") (const_int 2)) (match_operand:SI 3 "register_operand" "0"))) - (set (match_operand:SI 1 "register_operand" "=S") + (set (match_operand:SI 1 "register_operand" "=S") (plus:SI (ashift:SI (match_dup 5) (const_int 2)) (match_operand:SI 4 "register_operand" "1"))) (set (mem:BLK (match_dup 3)) @@ -18492,11 +18510,11 @@ (define_insn "*rep_movsi_rex64" [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (ashift:DI (match_operand:DI 5 "register_operand" "2") (const_int 2)) (match_operand:DI 3 "register_operand" "0"))) - (set (match_operand:DI 1 "register_operand" "=S") + (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (ashift:DI (match_dup 5) (const_int 2)) (match_operand:DI 4 "register_operand" "1"))) (set (mem:BLK (match_dup 3)) @@ -18512,10 +18530,10 @@ (define_insn "*rep_movqi" [(set (match_operand:SI 2 "register_operand" "=c") (const_int 0)) - (set (match_operand:SI 0 "register_operand" "=D") + (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (match_operand:SI 3 "register_operand" "0") (match_operand:SI 5 "register_operand" "2"))) - (set (match_operand:SI 1 "register_operand" "=S") + (set (match_operand:SI 1 "register_operand" "=S") (plus:SI (match_operand:SI 4 "register_operand" "1") (match_dup 5))) (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) @@ -18530,10 +18548,10 @@ (define_insn "*rep_movqi_rex64" [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_operand:DI 3 "register_operand" "0") (match_operand:DI 5 "register_operand" "2"))) - (set (match_operand:DI 1 "register_operand" "=S") + (set (match_operand:DI 1 "register_operand" "=S") (plus:DI (match_operand:DI 4 "register_operand" "1") (match_dup 5))) (set (mem:BLK (match_dup 3)) (mem:BLK (match_dup 4))) @@ -18720,7 +18738,7 @@ (define_insn "*rep_stosdi_rex64" [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1") (const_int 3)) (match_operand:DI 3 "register_operand" "0"))) @@ -18738,7 +18756,7 @@ (define_insn "*rep_stossi" [(set (match_operand:SI 1 "register_operand" "=c") (const_int 0)) - (set (match_operand:SI 0 "register_operand" "=D") + (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (ashift:SI (match_operand:SI 4 "register_operand" "1") (const_int 2)) (match_operand:SI 3 "register_operand" "0"))) @@ -18756,7 +18774,7 @@ (define_insn "*rep_stossi_rex64" [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (ashift:DI (match_operand:DI 4 "register_operand" "1") (const_int 2)) (match_operand:DI 3 "register_operand" "0"))) @@ -18774,7 +18792,7 @@ (define_insn "*rep_stosqi" [(set (match_operand:SI 1 "register_operand" "=c") (const_int 0)) - (set (match_operand:SI 0 "register_operand" "=D") + (set (match_operand:SI 0 "register_operand" "=D") (plus:SI (match_operand:SI 3 "register_operand" "0") (match_operand:SI 4 "register_operand" "1"))) (set (mem:BLK (match_dup 3)) @@ -18791,7 +18809,7 @@ (define_insn "*rep_stosqi_rex64" [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) - (set (match_operand:DI 0 "register_operand" "=D") + (set (match_operand:DI 0 "register_operand" "=D") (plus:DI (match_operand:DI 3 "register_operand" "0") (match_operand:DI 4 "register_operand" "1"))) (set (mem:BLK (match_dup 3)) @@ -19167,7 +19185,7 @@ (define_insn "*movdicc_c_rex64" [(set (match_operand:DI 0 "register_operand" "=r,r") - (if_then_else:DI (match_operator 1 "ix86_comparison_operator" + (if_then_else:DI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:DI 2 "nonimmediate_operand" "rm,0") (match_operand:DI 3 "nonimmediate_operand" "0,rm")))] @@ -19210,7 +19228,7 @@ (define_insn "*movsicc_noc" [(set (match_operand:SI 0 "register_operand" "=r,r") - (if_then_else:SI (match_operator 1 "ix86_comparison_operator" + (if_then_else:SI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:SI 2 "nonimmediate_operand" "rm,0") (match_operand:SI 3 "nonimmediate_operand" "0,rm")))] @@ -19232,7 +19250,7 @@ (define_insn "*movhicc_noc" [(set (match_operand:HI 0 "register_operand" "=r,r") - (if_then_else:HI (match_operator 1 "ix86_comparison_operator" + (if_then_else:HI (match_operator 1 "ix86_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:HI 2 "nonimmediate_operand" "rm,0") (match_operand:HI 3 "nonimmediate_operand" "0,rm")))] @@ -19254,7 +19272,7 @@ (define_insn_and_split "*movqicc_noc" [(set (match_operand:QI 0 "register_operand" "=r,r") - (if_then_else:QI (match_operator 1 "ix86_comparison_operator" + (if_then_else:QI (match_operator 1 "ix86_comparison_operator" [(match_operand 4 "flags_reg_operand" "") (const_int 0)]) (match_operand:QI 2 "register_operand" "r,0") @@ -19282,7 +19300,7 @@ (define_insn "*movsfcc_1_387" [(set (match_operand:SF 0 "register_operand" "=f,f,r,r") - (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" + (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:SF 2 "nonimmediate_operand" "f,0,rm,0") (match_operand:SF 3 "nonimmediate_operand" "0,f,0,rm")))] @@ -19306,7 +19324,7 @@ (define_insn "*movdfcc_1" [(set (match_operand:DF 0 "register_operand" "=f,f,&r,&r") - (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" + (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0") (match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))] @@ -19322,7 +19340,7 @@ (define_insn "*movdfcc_1_rex64" [(set (match_operand:DF 0 "register_operand" "=f,f,r,r") - (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" + (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:DF 2 "nonimmediate_operand" "f,0,rm,0") (match_operand:DF 3 "nonimmediate_operand" "0,f,0,rm")))] @@ -19338,7 +19356,7 @@ (define_split [(set (match_operand:DF 0 "register_and_not_any_fp_reg_operand" "") - (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" + (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" [(match_operand 4 "flags_reg_operand" "") (const_int 0)]) (match_operand:DF 2 "nonimmediate_operand" "") @@ -19366,7 +19384,7 @@ (define_insn "*movxfcc_1" [(set (match_operand:XF 0 "register_operand" "=f,f") - (if_then_else:XF (match_operator 1 "fcmov_comparison_operator" + (if_then_else:XF (match_operator 1 "fcmov_comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:XF 2 "register_operand" "f,0") (match_operand:XF 3 "register_operand" "0,f")))] @@ -19528,7 +19546,7 @@ ;; This pattern exists to put a dependency on all ebp-based memory accesses. ;; Otherwise there will be nothing to keep -;; +;; ;; [(set (reg ebp) (reg esp))] ;; [(set (reg esp) (plus (reg esp) (const_int -160000))) ;; (clobber (eflags)] @@ -19720,7 +19738,7 @@ && INTVAL (operands[1]) < CHECK_STACK_LIMIT) emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, operands[1])); - else + else #endif emit_insn (gen_allocate_stack_worker (copy_to_mode_reg (SImode, operands[1]))); @@ -19760,12 +19778,12 @@ (match_operand 2 "aligned_operand" "")])) (clobber (reg:CC FLAGS_REG))] "! TARGET_PARTIAL_REG_STALL && reload_completed - && ((GET_MODE (operands[0]) == HImode + && ((GET_MODE (operands[0]) == HImode && ((!optimize_size && !TARGET_FAST_PREFIX) /* ??? next two lines just !satisfies_constraint_K (...) */ || GET_CODE (operands[2]) != CONST_INT || satisfies_constraint_K (operands[2]))) - || (GET_MODE (operands[0]) == QImode + || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(parallel [(set (match_dup 0) (match_op_dup 3 [(match_dup 1) (match_dup 2)])) @@ -19838,7 +19856,7 @@ (clobber (reg:CC FLAGS_REG))] "! TARGET_PARTIAL_REG_STALL && reload_completed && (GET_MODE (operands[0]) == HImode - || (GET_MODE (operands[0]) == QImode + || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(parallel [(set (match_dup 0) (neg:SI (match_dup 1))) @@ -19851,29 +19869,29 @@ (not (match_operand 1 "register_operand" "")))] "! TARGET_PARTIAL_REG_STALL && reload_completed && (GET_MODE (operands[0]) == HImode - || (GET_MODE (operands[0]) == QImode + || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(set (match_dup 0) (not:SI (match_dup 1)))] "operands[0] = gen_lowpart (SImode, operands[0]); operands[1] = gen_lowpart (SImode, operands[1]);") -(define_split +(define_split [(set (match_operand 0 "register_operand" "") - (if_then_else (match_operator 1 "comparison_operator" + (if_then_else (match_operator 1 "comparison_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand 2 "register_operand" "") (match_operand 3 "register_operand" "")))] "! TARGET_PARTIAL_REG_STALL && TARGET_CMOVE && (GET_MODE (operands[0]) == HImode - || (GET_MODE (operands[0]) == QImode + || (GET_MODE (operands[0]) == QImode && (TARGET_PROMOTE_QImode || optimize_size)))" [(set (match_dup 0) (if_then_else:SI (match_dup 1) (match_dup 2) (match_dup 3)))] "operands[0] = gen_lowpart (SImode, operands[0]); operands[2] = gen_lowpart (SImode, operands[2]); operands[3] = gen_lowpart (SImode, operands[3]);") - + ;; RTL Peephole optimizations, run before sched2. These primarily look to ;; transform a complex memory operation into two memory to register operations. @@ -20018,7 +20036,7 @@ (set (match_dup 0) (match_op_dup 1 [(match_dup 3) (const_int 0)]))] "") -;; NOT is not pairable on Pentium, while XOR is, but one byte longer. +;; NOT is not pairable on Pentium, while XOR is, but one byte longer. ;; Don't split NOTs with a displacement operand, because resulting XOR ;; will not be pairable anyway. ;; @@ -20034,7 +20052,7 @@ (not:SI (match_operand:SI 1 "nonimmediate_operand" "")))] "!optimize_size && peep2_regno_dead_p (0, FLAGS_REG) - && ((TARGET_PENTIUM + && ((TARGET_PENTIUM && (GET_CODE (operands[0]) != MEM || !memory_displacement_operand (operands[0], SImode))) || (TARGET_K6 && long_memory_operand (operands[0], SImode)))" @@ -20048,7 +20066,7 @@ (not:HI (match_operand:HI 1 "nonimmediate_operand" "")))] "!optimize_size && peep2_regno_dead_p (0, FLAGS_REG) - && ((TARGET_PENTIUM + && ((TARGET_PENTIUM && (GET_CODE (operands[0]) != MEM || !memory_displacement_operand (operands[0], HImode))) || (TARGET_K6 && long_memory_operand (operands[0], HImode)))" @@ -20062,7 +20080,7 @@ (not:QI (match_operand:QI 1 "nonimmediate_operand" "")))] "!optimize_size && peep2_regno_dead_p (0, FLAGS_REG) - && ((TARGET_PENTIUM + && ((TARGET_PENTIUM && (GET_CODE (operands[0]) != MEM || !memory_displacement_operand (operands[0], QImode))) || (TARGET_K6 && long_memory_operand (operands[0], QImode)))" @@ -20143,7 +20161,7 @@ (set (zero_extract:SI (match_dup 2) (const_int 8) (const_int 8)) - (and:SI + (and:SI (zero_extract:SI (match_dup 2) (const_int 8) @@ -20245,7 +20263,7 @@ [(set (match_operand 0 "register_operand" "") (const_int -1))] "(GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == SImode + || GET_MODE (operands[0]) == SImode || (GET_MODE (operands[0]) == DImode && TARGET_64BIT)) && (optimize_size || TARGET_PENTIUM) && peep2_regno_dead_p (0, FLAGS_REG)" @@ -20601,7 +20619,7 @@ (mult:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] - "!optimize_size + "!optimize_size && (INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 5 || INTVAL (operands[2]) == 9)" @@ -20633,7 +20651,7 @@ (match_operand:DI 2 "const_int_operand" ""))) (clobber (reg:CC FLAGS_REG))])] "TARGET_64BIT - && !optimize_size + && !optimize_size && (INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 5 || INTVAL (operands[2]) == 9)" @@ -20764,7 +20782,7 @@ && ((!TARGET_PARTIAL_REG_STALL && (GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode)) - || GET_MODE (operands[0]) == SImode + || GET_MODE (operands[0]) == SImode || (TARGET_64BIT && GET_MODE (operands[0]) == DImode)) /* We reorder load and the shift. */ && !rtx_equal_p (operands[1], operands[3]) @@ -20913,7 +20931,7 @@ [(set_attr "type" "callv")]) ;; We used to use "int $5", in honor of #BR which maps to interrupt vector 5. -;; That, however, is usually mapped by the OS to SIGSEGV, which is often +;; That, however, is usually mapped by the OS to SIGSEGV, which is often ;; caught for use by garbage collectors and the like. Using an insn that ;; maps to SIGILL makes it more likely the program will rightfully die. ;; Keeping with tradition, "6" is in honor of #UD. @@ -21021,7 +21039,7 @@ int locality = INTVAL (operands[1]); gcc_assert (locality >= 0 && locality <= 3); - return patterns[locality]; + return patterns[locality]; } [(set_attr "type" "sse") (set_attr "memory" "none")]) @@ -21039,7 +21057,7 @@ int locality = INTVAL (operands[1]); gcc_assert (locality >= 0 && locality <= 3); - return patterns[locality]; + return patterns[locality]; } [(set_attr "type" "sse") (set_attr "memory" "none")]) diff --git a/contrib/gcc/config/i386/nto.h b/contrib/gcc/config/i386/nto.h index 1095a6313198..42ae5563d678 100644 --- a/contrib/gcc/config/i386/nto.h +++ b/contrib/gcc/config/i386/nto.h @@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */ #undef THREAD_MODEL_SPEC #define THREAD_MODEL_SPEC "posix" -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #define SYSROOT_SUFFIX_SPEC "x86" #endif diff --git a/contrib/gcc/config/rs6000/aix.h b/contrib/gcc/config/rs6000/aix.h index 57f487664a97..242bd024177a 100644 --- a/contrib/gcc/config/rs6000/aix.h +++ b/contrib/gcc/config/rs6000/aix.h @@ -124,14 +124,14 @@ /* #define ASM_SPEC "-u %(asm_cpu)" */ /* Default location of syscalls.exp under AIX */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #define LINK_SYSCALLS_SPEC "-bI:/lib/syscalls.exp" #else #define LINK_SYSCALLS_SPEC "" #endif /* Default location of libg.exp under AIX */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #define LINK_LIBG_SPEC "-bexport:/usr/lib/libg.exp" #else #define LINK_LIBG_SPEC "" diff --git a/contrib/gcc/config/rs6000/sysv4.h b/contrib/gcc/config/rs6000/sysv4.h index 0adde2bc8be2..0b1eb1ebb4d9 100644 --- a/contrib/gcc/config/rs6000/sysv4.h +++ b/contrib/gcc/config/rs6000/sysv4.h @@ -634,7 +634,7 @@ extern int fixuplabelno; %{profile: -p}" /* Don't put -Y P, for cross compilers. */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #define LINK_PATH_SPEC "\ %{!R*:%{L*:-R %*}} \ %{!nostdlib: %{!YP,*: \ diff --git a/contrib/gcc/config/svr4.h b/contrib/gcc/config/svr4.h index 6fa88fcd821d..216e9290e6fc 100644 --- a/contrib/gcc/config/svr4.h +++ b/contrib/gcc/config/svr4.h @@ -84,7 +84,7 @@ Boston, MA 02110-1301, USA. /* Under svr4, the normal location of the `ld' and `as' programs is the /usr/ccs/bin directory. */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef MD_EXEC_PREFIX #define MD_EXEC_PREFIX "/usr/ccs/bin/" #endif @@ -92,7 +92,7 @@ Boston, MA 02110-1301, USA. /* Under svr4, the normal location of the various *crt*.o files is the /usr/ccs/lib directory. */ -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #undef MD_STARTFILE_PREFIX #define MD_STARTFILE_PREFIX "/usr/ccs/lib/" #endif @@ -136,7 +136,7 @@ Boston, MA 02110-1301, USA. not being done. */ #undef LINK_SPEC -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE #define LINK_SPEC "%{h*} %{v:-V} \ %{b} \ %{static:-dn -Bstatic} \ diff --git a/contrib/gcc/configure b/contrib/gcc/configure index a248d39c2136..7baa70a577b9 100755 --- a/contrib/gcc/configure +++ b/contrib/gcc/configure @@ -13151,7 +13151,8 @@ for f in $build_xm_file; do esac done -# Define macro CROSS_COMPILE in compilation if this is a cross-compiler. +# Define macro CROSS_DIRECTORY_STRUCTURE in compilation if this is a +# cross-compiler which does not use the native headers and libraries. # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR. CROSS= ALL=all.internal @@ -13168,7 +13169,7 @@ fi if test x$host != x$target then - CROSS="-DCROSS_COMPILE" + CROSS="-DCROSS_DIRECTORY_STRUCTURE" ALL=all.cross SYSTEM_HEADER_DIR=$build_system_header_dir case "$host","$target" in diff --git a/contrib/gcc/configure.ac b/contrib/gcc/configure.ac index b6c394ca2686..fc292336a51a 100644 --- a/contrib/gcc/configure.ac +++ b/contrib/gcc/configure.ac @@ -1729,7 +1729,8 @@ for f in $build_xm_file; do esac done -# Define macro CROSS_COMPILE in compilation if this is a cross-compiler. +# Define macro CROSS_DIRECTORY_STRUCTURE in compilation if this is a +# cross-compiler which does not use the native headers and libraries. # Also use all.cross instead of all.internal and adjust SYSTEM_HEADER_DIR. CROSS= AC_SUBST(CROSS) ALL=all.internal AC_SUBST(ALL) @@ -1746,7 +1747,7 @@ fi if test x$host != x$target then - CROSS="-DCROSS_COMPILE" + CROSS="-DCROSS_DIRECTORY_STRUCTURE" ALL=all.cross SYSTEM_HEADER_DIR=$build_system_header_dir case "$host","$target" in diff --git a/contrib/gcc/coverage.c b/contrib/gcc/coverage.c index 5eaf4888fe3e..399eb6ea6c6a 100644 --- a/contrib/gcc/coverage.c +++ b/contrib/gcc/coverage.c @@ -433,7 +433,7 @@ coverage_checksum_string (unsigned chksum, const char *string) char *dup = NULL; /* Look for everything that looks if it were produced by - get_file_function_name_long and zero out the second part + get_file_function_name and zero out the second part that may result from flag_random_seed. This is not critical as the checksums are used only for sanity checking. */ for (i = 0; string[i]; i++) diff --git a/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43 new file mode 100644 index 000000000000..ed9c7b5a2cbd --- /dev/null +++ b/contrib/gcc/cp/ChangeLog.gcc43 @@ -0,0 +1,28 @@ +2007-06-28 Geoffrey Keating (r126080) + + * decl2.c (start_objects): Mark constructor-runnning function + as artificial. + +2007-06-14 Geoff Keating (r125721) + + PR 31093 + * decl2.c (determine_visibility): Remove duplicate code for + handling type info. + +2007-03-12 Seongbae Park (r122851) + + * decl.c (compute_array_index_type): New warning flag warn_vla. + +2007-01-07 Manuel Lopez-Ibanez + + PR c++/28986 + * typeck.c (build_binary_op): Call overflow_warning if + TREE_OVERFLOW_P is true for the result and not for any of the + operands. + +2006-10-31 Geoffrey Keating (r118360) + + * name-lookup.c (get_anonymous_namespace_name): New. + (push_namespace_with_attribs): Use get_anonymous_namespace_name. + * decl2.c (start_objects): Update for rename of + get_file_function_name_long. diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c index 310dc83159dd..f0b46c91dce3 100644 --- a/contrib/gcc/cp/decl2.c +++ b/contrib/gcc/cp/decl2.c @@ -1698,10 +1698,6 @@ determine_visibility (tree decl) class can influence the visibility of the DECL. */ if (DECL_CLASS_SCOPE_P (decl)) class_type = DECL_CONTEXT (decl); - else if (TREE_CODE (decl) == VAR_DECL - && DECL_TINFO_P (decl) - && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))) - class_type = TREE_TYPE (DECL_NAME (decl)); else { /* Not a class member. */ @@ -1787,7 +1783,8 @@ determine_visibility (tree decl) { /* Propagate anonymity from type to decl. */ int tvis = type_visibility (TREE_TYPE (decl)); - if (tvis == VISIBILITY_ANON) + if (tvis == VISIBILITY_ANON + || ! DECL_VISIBILITY_SPECIFIED (decl)) constrain_visibility (decl, tvis); } } @@ -2326,7 +2323,7 @@ start_objects (int method_type, int initp) sprintf (type, "%c", method_type); fndecl = build_lang_decl (FUNCTION_DECL, - get_file_function_name_long (type), + get_file_function_name (type), build_function_type (void_type_node, void_list_node)); start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED); @@ -2335,6 +2332,10 @@ start_objects (int method_type, int initp) to scan the object file to find its ctor/dtor routine. */ TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors; + /* Mark as artificial because it's not explicitly in the user's + source code. */ + DECL_ARTIFICIAL (current_function_decl) = 1; + /* Mark this declaration as used to avoid spurious warnings. */ TREE_USED (current_function_decl) = 1; diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c index 744dd5c489ec..4d08174a4be8 100644 --- a/contrib/gcc/cp/name-lookup.c +++ b/contrib/gcc/cp/name-lookup.c @@ -61,6 +61,24 @@ tree global_namespace; unit. */ static GTY(()) tree anonymous_namespace_name; +/* Initialise anonymous_namespace_name if necessary, and return it. */ + +static tree +get_anonymous_namespace_name(void) +{ + if (!anonymous_namespace_name) + { + /* The anonymous namespace has to have a unique name + if typeinfo objects are being compared by name. */ + if (! flag_weak || ! SUPPORTS_ONE_ONLY) + anonymous_namespace_name = get_file_function_name ("N"); + else + /* The demangler expects anonymous namespaces to be called + something starting with '_GLOBAL__N_'. */ + anonymous_namespace_name = get_identifier ("_GLOBAL__N_1"); + } + return anonymous_namespace_name; +} /* Compute the chain index of a binding_entry given the HASH value of its name and the total COUNT of chains. COUNT is assumed to be a power @@ -3011,11 +3029,7 @@ push_namespace_with_attribs (tree name, tree attributes) if (anon) { - /* The name of anonymous namespace is unique for the translation - unit. */ - if (!anonymous_namespace_name) - anonymous_namespace_name = get_file_function_name ('N'); - name = anonymous_namespace_name; + name = get_anonymous_namespace_name(); d = IDENTIFIER_NAMESPACE_VALUE (name); if (d) /* Reopening anonymous namespace. */ diff --git a/contrib/gcc/cppdefault.c b/contrib/gcc/cppdefault.c index d040558b54c9..434666096883 100644 --- a/contrib/gcc/cppdefault.c +++ b/contrib/gcc/cppdefault.c @@ -33,7 +33,7 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #define STANDARD_INCLUDE_COMPONENT 0 #endif -#if defined (CROSS_COMPILE) && !defined (TARGET_SYSTEM_ROOT) +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) # undef LOCAL_INCLUDE_DIR # undef SYSTEM_INCLUDE_DIR # undef STANDARD_INCLUDE_DIR diff --git a/contrib/gcc/doc/extend.texi b/contrib/gcc/doc/extend.texi index d27af1083a41..46cbc8460a74 100644 --- a/contrib/gcc/doc/extend.texi +++ b/contrib/gcc/doc/extend.texi @@ -6146,6 +6146,16 @@ Similar to @code{__builtin_powi}, except the argument and return types are @code{long double}. @end deftypefn +@deftypefn {Built-in Function} int32_t __builtin_bswap32 (int32_t x) +Returns @var{x} with the order of the bytes reversed; for example, +@code{0xaabbccdd} becomes @code{0xddccbbaa}. Byte here always means +exactly 8 bits. +@end deftypefn + +@deftypefn {Built-in Function} int64_t __builtin_bswap64 (int64_t x) +Similar to @code{__builtin_bswap32}, except the argument and return types +are 64-bit. +@end deftypefn @node Target Builtins @section Built-in Functions Specific to Particular Target Machines diff --git a/contrib/gcc/doc/libgcc.texi b/contrib/gcc/doc/libgcc.texi index f67b117f06d2..fcc55d737c3b 100644 --- a/contrib/gcc/doc/libgcc.texi +++ b/contrib/gcc/doc/libgcc.texi @@ -212,6 +212,11 @@ These functions return the value zero if the number of bits set in These functions return the number of bits set in @var{a}. @end deftypefn +@deftypefn {Runtime Function} int32_t __bswapsi2 (int32_t @var{a}) +@deftypefnx {Runtime Function} int64_t __bswapdi2 (int64_t @var{a}) +These functions return the @var{a} byteswapped. +@end deftypefn + @node Soft float library routines @section Routines for floating point emulation @cindex soft float library @@ -728,4 +733,3 @@ document me! @deftypefn {Runtime Function} void __clear_cache (char *@var{beg}, char *@var{end}) This function clears the instruction cache between @var{beg} and @var{end}. @end deftypefn - diff --git a/contrib/gcc/doc/rtl.texi b/contrib/gcc/doc/rtl.texi index 76e8f16face2..d97b2b327efe 100644 --- a/contrib/gcc/doc/rtl.texi +++ b/contrib/gcc/doc/rtl.texi @@ -2084,6 +2084,11 @@ mode @var{m}. The mode of @var{x} will usually be an integer mode. Represents the number of 1-bits modulo 2 in @var{x}, represented as an integer of mode @var{m}. The mode of @var{x} will usually be an integer mode. + +@findex bswap +@item (bswap:@var{m} @var{x}) +Represents the value @var{x} with the order of bytes reversed, carried out +in mode @var{m}, which must be a fixed-point machine mode. @end table @node Comparisons diff --git a/contrib/gcc/dwarf2out.c b/contrib/gcc/dwarf2out.c index 461990bf4dfd..266973ab6c8d 100644 --- a/contrib/gcc/dwarf2out.c +++ b/contrib/gcc/dwarf2out.c @@ -2030,7 +2030,7 @@ switch_to_eh_frame_section (void) /* We have no special eh_frame section. Put the information in the data section and emit special labels to guide collect2. */ switch_to_section (data_section); - label = get_file_function_name ('F'); + label = get_file_function_name ("F"); ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE)); targetm.asm_out.globalize_label (asm_out_file, IDENTIFIER_POINTER (label)); diff --git a/contrib/gcc/expr.c b/contrib/gcc/expr.c index 3655eb0aa044..16e43aa3d742 100644 --- a/contrib/gcc/expr.c +++ b/contrib/gcc/expr.c @@ -361,6 +361,8 @@ convert_move (rtx to, rtx from, int unsignedp) gcc_assert (to_real == from_real); + gcc_assert (to_mode != BLKmode); + gcc_assert (from_mode != BLKmode); /* If the source and destination are already the same, then there's nothing to do. */ @@ -415,7 +417,7 @@ convert_move (rtx to, rtx from, int unsignedp) != GET_MODE_PRECISION (to_mode)) || (DECIMAL_FLOAT_MODE_P (from_mode) != DECIMAL_FLOAT_MODE_P (to_mode))); - + if (GET_MODE_PRECISION (from_mode) == GET_MODE_PRECISION (to_mode)) /* Conversion between decimal float and binary float, same size. */ tab = DECIMAL_FLOAT_MODE_P (from_mode) ? trunc_optab : sext_optab; @@ -2135,7 +2137,7 @@ void use_reg (rtx *call_fusage, rtx reg) { gcc_assert (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER); - + *call_fusage = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, reg), *call_fusage); @@ -2682,7 +2684,7 @@ set_storage_via_setmem (rtx object, rtx size, rtx val, unsigned int align) pred = insn_data[(int) code].operand[1].predicate; if (pred != 0 && ! (*pred) (opsize, mode)) opsize = copy_to_mode_reg (mode, opsize); - + opchar = val; char_mode = insn_data[(int) code].operand[2].mode; if (char_mode != VOIDmode) @@ -3140,9 +3142,9 @@ emit_move_multi_word (enum machine_mode mode, rtx x, rtx y) rtx seq, inner; bool need_clobber; int i; - + gcc_assert (GET_MODE_SIZE (mode) >= UNITS_PER_WORD); - + /* If X is a push on the stack, do the push now and replace X with a reference to the stack pointer. */ if (push_operand (x, mode)) @@ -4440,6 +4442,11 @@ store_expr (tree exp, rtx target, int call_param_p) temp = convert_to_mode (GET_MODE (target), temp, unsignedp); emit_move_insn (target, temp); } + else if (GET_MODE (target) == BLKmode) + emit_block_move (target, temp, expr_size (exp), + (call_param_p + ? BLOCK_OP_CALL_PARM + : BLOCK_OP_NORMAL)); else convert_move (target, temp, unsignedp); } @@ -4571,7 +4578,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts, case CONSTRUCTOR: { HOST_WIDE_INT nz = 0, ic = 0; - + bool const_elt_p = categorize_ctor_elements_1 (value, &nz, &ic, p_must_clear); @@ -4648,7 +4655,7 @@ categorize_ctor_elements_1 (tree ctor, HOST_WIDE_INT *p_nz_elts, largest element. Which would avoid comparing the size of the initialized element against any tail padding in the union. Doesn't seem worth the effort... */ - if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (ctor)), + if (simple_cst_equal (TYPE_SIZE (TREE_TYPE (ctor)), TYPE_SIZE (init_sub_type)) == 1) { /* And now we have to find out if the element itself is fully @@ -4944,24 +4951,24 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) HOST_WIDE_INT bitpos = 0; tree offset; rtx to_rtx = target; - + /* Just ignore missing fields. We cleared the whole structure, above, if any fields are missing. */ if (field == 0) continue; - + if (cleared && initializer_zerop (value)) continue; - + if (host_integerp (DECL_SIZE (field), 1)) bitsize = tree_low_cst (DECL_SIZE (field), 1); else bitsize = -1; - + mode = DECL_MODE (field); if (DECL_BIT_FIELD (field)) mode = VOIDmode; - + offset = DECL_FIELD_OFFSET (field); if (host_integerp (offset, 0) && host_integerp (bit_position (field), 0)) @@ -4971,11 +4978,11 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) } else bitpos = tree_low_cst (DECL_FIELD_BIT_OFFSET (field), 0); - + if (offset) { rtx offset_rtx; - + offset = SUBSTITUTE_PLACEHOLDER_IN_EXPR (offset, make_tree (TREE_TYPE (exp), @@ -4983,7 +4990,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) offset_rtx = expand_normal (offset); gcc_assert (MEM_P (to_rtx)); - + #ifdef POINTERS_EXTEND_UNSIGNED if (GET_MODE (offset_rtx) != Pmode) offset_rtx = convert_to_mode (Pmode, offset_rtx, 0); @@ -5011,14 +5018,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) && bitpos + BITS_PER_WORD <= exp_size * BITS_PER_UNIT) { tree type = TREE_TYPE (value); - + if (TYPE_PRECISION (type) < BITS_PER_WORD) { type = lang_hooks.types.type_for_size (BITS_PER_WORD, TYPE_UNSIGNED (type)); value = fold_convert (type, value); } - + if (BYTES_BIG_ENDIAN) value = fold_build2 (LSHIFT_EXPR, type, value, @@ -5035,7 +5042,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) to_rtx = copy_rtx (to_rtx); MEM_KEEP_ALIAS_SET_P (to_rtx) = 1; } - + store_constructor_field (to_rtx, bitsize, bitpos, mode, value, type, cleared, get_alias_set (TREE_TYPE (field))); @@ -5079,7 +5086,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) tree index, value; HOST_WIDE_INT count = 0, zero_count = 0; need_to_clear = ! const_bounds_p; - + /* This loop is a more accurate version of the loop in mostly_zeros_p (it handles RANGE_EXPR in an index). It is also needed to check for missing elements. */ @@ -5089,30 +5096,30 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (need_to_clear) break; - + if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR) { tree lo_index = TREE_OPERAND (index, 0); tree hi_index = TREE_OPERAND (index, 1); - + if (! host_integerp (lo_index, 1) || ! host_integerp (hi_index, 1)) { need_to_clear = 1; break; } - + this_node_count = (tree_low_cst (hi_index, 1) - tree_low_cst (lo_index, 1) + 1); } else this_node_count = 1; - + count += this_node_count; if (mostly_zeros_p (value)) zero_count += this_node_count; } - + /* Clear the entire array first if there are any missing elements, or if the incidence of zero elements is >= 75%. */ @@ -5121,7 +5128,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) || 4 * zero_count >= 3 * count)) need_to_clear = 1; } - + if (need_to_clear && size > 0) { if (REG_P (target)) @@ -5145,10 +5152,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) HOST_WIDE_INT bitpos; int unsignedp; rtx xtarget = target; - + if (cleared && initializer_zerop (value)) continue; - + unsignedp = TYPE_UNSIGNED (elttype); mode = TYPE_MODE (elttype); if (mode == BLKmode) @@ -5157,7 +5164,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) : -1); else bitsize = GET_MODE_BITSIZE (mode); - + if (index != NULL_TREE && TREE_CODE (index) == RANGE_EXPR) { tree lo_index = TREE_OPERAND (index, 0); @@ -5165,7 +5172,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) rtx index_r, pos_rtx; HOST_WIDE_INT lo, hi, count; tree position; - + /* If the range is constant and "small", unroll the loop. */ if (const_bounds_p && host_integerp (lo_index, 0) @@ -5183,7 +5190,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) for (; lo <= hi; lo++) { bitpos = lo * tree_low_cst (TYPE_SIZE (elttype), 0); - + if (MEM_P (target) && !MEM_KEEP_ALIAS_SET_P (target) && TREE_CODE (type) == ARRAY_TYPE @@ -5192,7 +5199,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) target = copy_rtx (target); MEM_KEEP_ALIAS_SET_P (target) = 1; } - + store_constructor_field (target, bitsize, bitpos, mode, value, type, cleared, get_alias_set (elttype)); @@ -5203,18 +5210,18 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) rtx loop_start = gen_label_rtx (); rtx loop_end = gen_label_rtx (); tree exit_cond; - + expand_normal (hi_index); unsignedp = TYPE_UNSIGNED (domain); - + index = build_decl (VAR_DECL, NULL_TREE, domain); - + index_r = gen_reg_rtx (promote_mode (domain, DECL_MODE (index), &unsignedp, 0)); SET_DECL_RTL (index, index_r); store_expr (lo_index, index_r, 0); - + /* Build the head of the loop. */ do_pending_stack_adjust (); emit_label (loop_start); @@ -5231,7 +5238,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) size_binop (MULT_EXPR, position, fold_convert (ssizetype, TYPE_SIZE_UNIT (elttype))); - + pos_rtx = expand_normal (position); xtarget = offset_address (target, pos_rtx, highest_pow2_factor (position)); @@ -5246,15 +5253,15 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) exit_cond = build2 (LT_EXPR, integer_type_node, index, hi_index); jumpif (exit_cond, loop_end); - + /* Update the loop counter, and jump to the head of the loop. */ expand_assignment (index, build2 (PLUS_EXPR, TREE_TYPE (index), index, integer_one_node)); - + emit_jump (loop_start); - + /* Build the end of the loop. */ emit_label (loop_end); } @@ -5263,17 +5270,17 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) || ! host_integerp (TYPE_SIZE (elttype), 1)) { tree position; - + if (index == 0) index = ssize_int (1); - + if (minelt) index = fold_convert (ssizetype, fold_build2 (MINUS_EXPR, TREE_TYPE (index), index, TYPE_MIN_VALUE (domain))); - + position = size_binop (MULT_EXPR, index, fold_convert (ssizetype, @@ -5291,7 +5298,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) * tree_low_cst (TYPE_SIZE (elttype), 1)); else bitpos = (i * tree_low_cst (TYPE_SIZE (elttype), 1)); - + if (MEM_P (target) && !MEM_KEEP_ALIAS_SET_P (target) && TREE_CODE (type) == ARRAY_TYPE && TYPE_NONALIASED_COMPONENT (type)) @@ -5320,25 +5327,25 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) HOST_WIDE_INT bitpos; rtvec vector = NULL; unsigned n_elts; - + gcc_assert (eltmode != BLKmode); - + n_elts = TYPE_VECTOR_SUBPARTS (type); if (REG_P (target) && VECTOR_MODE_P (GET_MODE (target))) { enum machine_mode mode = GET_MODE (target); - + icode = (int) vec_init_optab->handlers[mode].insn_code; if (icode != CODE_FOR_nothing) { unsigned int i; - + vector = rtvec_alloc (n_elts); for (i = 0; i < n_elts; i++) RTVEC_ELT (vector, i) = CONST0_RTX (GET_MODE_INNER (mode)); } } - + /* If the constructor has fewer elements than the vector, clear the whole array first. Similarly if this is static constructor of a non-BLKmode object. */ @@ -5350,14 +5357,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) { unsigned HOST_WIDE_INT count = 0, zero_count = 0; tree value; - + FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (exp), idx, value) { int n_elts_here = tree_low_cst (int_const_binop (TRUNC_DIV_EXPR, TYPE_SIZE (TREE_TYPE (value)), TYPE_SIZE (elttype), 0), 1); - + count += n_elts_here; if (mostly_zeros_p (value)) zero_count += n_elts_here; @@ -5367,7 +5374,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) or if the incidence of zero elements is >= 75%. */ need_to_clear = (count < n_elts || 4 * zero_count >= 3 * count); } - + if (need_to_clear && size > 0 && !vector) { if (REG_P (target)) @@ -5376,7 +5383,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL); cleared = 1; } - + /* Inform later passes that the old value is dead. */ if (!cleared && !vector && REG_P (target)) emit_move_insn (target, CONST0_RTX (GET_MODE (target))); @@ -5389,16 +5396,16 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) { HOST_WIDE_INT eltpos; tree value = ce->value; - + bitsize = tree_low_cst (TYPE_SIZE (TREE_TYPE (value)), 1); if (cleared && initializer_zerop (value)) continue; - + if (ce->index) eltpos = tree_low_cst (ce->index, 1); else eltpos = i; - + if (vector) { /* Vector CONSTRUCTORs should only be built from smaller @@ -5419,14 +5426,14 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) cleared, get_alias_set (elttype)); } } - + if (vector) emit_insn (GEN_FCN (icode) (target, gen_rtx_PARALLEL (GET_MODE (target), vector))); break; } - + default: gcc_unreachable (); } @@ -6965,7 +6972,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, && GET_MODE (decl_rtl) != DECL_MODE (exp)) { enum machine_mode pmode; - + /* Get the signedness used for this variable. Ensure we get the same mode we got when the variable was declared. */ pmode = promote_mode (type, DECL_MODE (exp), &unsignedp, @@ -7336,19 +7343,19 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, tree index1 = index; tree low_bound = array_ref_low_bound (exp); index1 = fold_convert (sizetype, TREE_OPERAND (exp, 1)); - + /* Optimize the special-case of a zero lower bound. - + We convert the low_bound to sizetype to avoid some problems with constant folding. (E.g. suppose the lower bound is 1, and its mode is QI. Without the conversion,l (ARRAY +(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned char)1)) +INDEX), which becomes (ARRAY+255+INDEX). Opps!) */ - + if (! integer_zerop (low_bound)) index1 = size_diffop (index1, fold_convert (sizetype, low_bound)); - + if (0 > compare_tree_int (index1, TREE_STRING_LENGTH (init))) { @@ -7751,7 +7758,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, else { gcc_assert (REG_P (target)); - + /* Store this field into a union of the proper type. */ store_field (target, MIN ((int_size_in_bytes (TREE_TYPE @@ -7837,9 +7844,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, other. */ else if (SCALAR_INT_MODE_P (GET_MODE (op0)) && SCALAR_INT_MODE_P (TYPE_MODE (type))) - op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0, + op0 = convert_modes (TYPE_MODE (type), GET_MODE (op0), op0, TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); - /* As a last resort, spill op0 to memory, and reload it in a + /* As a last resort, spill op0 to memory, and reload it in a different mode. */ else if (!MEM_P (op0)) { @@ -8742,7 +8749,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, case REALIGN_LOAD_EXPR: { - tree oprnd0 = TREE_OPERAND (exp, 0); + tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd1 = TREE_OPERAND (exp, 1); tree oprnd2 = TREE_OPERAND (exp, 2); rtx op2; @@ -8750,7 +8757,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, this_optab = optab_for_tree_code (code, type); expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); op2 = expand_normal (oprnd2); - temp = expand_ternary_op (mode, this_optab, op0, op1, op2, + temp = expand_ternary_op (mode, this_optab, op0, op1, op2, target, unsignedp); gcc_assert (temp); return temp; @@ -8765,7 +8772,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); op2 = expand_normal (oprnd2); - target = expand_widen_pattern_expr (exp, op0, op1, op2, + target = expand_widen_pattern_expr (exp, op0, op1, op2, target, unsignedp); return target; } @@ -8774,7 +8781,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, { tree oprnd0 = TREE_OPERAND (exp, 0); tree oprnd1 = TREE_OPERAND (exp, 1); - + expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, 0); target = expand_widen_pattern_expr (exp, op0, NULL_RTX, op1, target, unsignedp); diff --git a/contrib/gcc/fold-const.c b/contrib/gcc/fold-const.c index 1aadd300a9b8..e43fb3b86282 100644 --- a/contrib/gcc/fold-const.c +++ b/contrib/gcc/fold-const.c @@ -12591,6 +12591,8 @@ tree_expr_nonnegative_warnv_p (tree t, bool *strict_overflow_p) CASE_INT_FN (BUILT_IN_FFS): CASE_INT_FN (BUILT_IN_PARITY): CASE_INT_FN (BUILT_IN_POPCOUNT): + case BUILT_IN_BSWAP32: + case BUILT_IN_BSWAP64: /* Always true. */ return 1; diff --git a/contrib/gcc/gcc.c b/contrib/gcc/gcc.c index e88dc53a855b..62d248b10f06 100644 --- a/contrib/gcc/gcc.c +++ b/contrib/gcc/gcc.c @@ -240,7 +240,7 @@ static const char *spec_machine = DEFAULT_TARGET_MACHINE; /* Nonzero if cross-compiling. When -b is used, the value comes from the `specs' file. */ -#ifdef CROSS_COMPILE +#ifdef CROSS_DIRECTORY_STRUCTURE static const char *cross_compile = "1"; #else static const char *cross_compile = "0"; @@ -1469,7 +1469,7 @@ static const char *gcc_libexec_prefix; #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" #endif -#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */ +#ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX_1 diff --git a/contrib/gcc/genattrtab.c b/contrib/gcc/genattrtab.c index 2555e10750ae..9e2c1df08e91 100644 --- a/contrib/gcc/genattrtab.c +++ b/contrib/gcc/genattrtab.c @@ -959,6 +959,7 @@ check_attr_value (rtx exp, struct attr_desc *attr) case CTZ: case POPCOUNT: case PARITY: + case BSWAP: XEXP (exp, 0) = check_attr_value (XEXP (exp, 0), attr); break; diff --git a/contrib/gcc/genopinit.c b/contrib/gcc/genopinit.c index c9cea085852a..8541c1b6fd21 100644 --- a/contrib/gcc/genopinit.c +++ b/contrib/gcc/genopinit.c @@ -148,6 +148,7 @@ static const char * const optabs[] = "atan_optab->handlers[$A].insn_code = CODE_FOR_$(atan$a2$)", "strlen_optab->handlers[$A].insn_code = CODE_FOR_$(strlen$a$)", "one_cmpl_optab->handlers[$A].insn_code = CODE_FOR_$(one_cmpl$a2$)", + "bswap_optab->handlers[$A].insn_code = CODE_FOR_$(bswap$a2$)", "ffs_optab->handlers[$A].insn_code = CODE_FOR_$(ffs$a2$)", "clz_optab->handlers[$A].insn_code = CODE_FOR_$(clz$a2$)", "ctz_optab->handlers[$A].insn_code = CODE_FOR_$(ctz$a2$)", diff --git a/contrib/gcc/libgcc-std.ver b/contrib/gcc/libgcc-std.ver index f8e9e52d0820..2d0a43df01d3 100644 --- a/contrib/gcc/libgcc-std.ver +++ b/contrib/gcc/libgcc-std.ver @@ -274,3 +274,10 @@ GCC_4.2.0 { __floatuntitf _Unwind_GetIPInfo } + +%inherit GCC_4.3 GCC_4.2.0 +GCC_4.3.0 { + # byte swapping routines + __bswapsi2 + __bswapdi2 +} diff --git a/contrib/gcc/libgcc2.c b/contrib/gcc/libgcc2.c index 851bdd073c70..58ad32039a4b 100644 --- a/contrib/gcc/libgcc2.c +++ b/contrib/gcc/libgcc2.c @@ -492,6 +492,30 @@ __ashrdi3 (DWtype u, word_type b) } #endif +#ifdef L_bswapsi2 +UWtype +__bswapsi2 (UWtype u) +{ + return ((((u) & 0xff000000) >> 24) + | (((u) & 0x00ff0000) >> 8) + | (((u) & 0x0000ff00) << 8) + | (((u) & 0x000000ff) << 24)); +} +#endif +#ifdef L_bswapdi2 +UDWtype +__bswapdi2 (UDWtype u) +{ + return ((((u) & 0xff00000000000000ull) >> 56) + | (((u) & 0x00ff000000000000ull) >> 40) + | (((u) & 0x0000ff0000000000ull) >> 24) + | (((u) & 0x000000ff00000000ull) >> 8) + | (((u) & 0x00000000ff000000ull) << 8) + | (((u) & 0x0000000000ff0000ull) << 24) + | (((u) & 0x000000000000ff00ull) << 40) + | (((u) & 0x00000000000000ffull) << 56)); +} +#endif #ifdef L_ffssi2 #undef int int @@ -1862,7 +1886,7 @@ CONCAT3(__div,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d) { MTYPE denom, ratio, x, y; - /* ??? We can get better behavior from logarithmic scaling instead of + /* ??? We can get better behavior from logarithmic scaling instead of the division. But that would mean starting to link libgcc against libm. We could implement something akin to ldexp/frexp as gcc builtins fairly easily... */ diff --git a/contrib/gcc/libgcc2.h b/contrib/gcc/libgcc2.h index c13f0c76bcce..d15ab8d9dadf 100644 --- a/contrib/gcc/libgcc2.h +++ b/contrib/gcc/libgcc2.h @@ -345,11 +345,13 @@ extern Wtype __addvSI3 (Wtype, Wtype); extern Wtype __subvSI3 (Wtype, Wtype); extern Wtype __mulvSI3 (Wtype, Wtype); extern Wtype __negvSI2 (Wtype); +extern UWtype __bswapsi2 (UWtype); extern DWtype __absvDI2 (DWtype); extern DWtype __addvDI3 (DWtype, DWtype); extern DWtype __subvDI3 (DWtype, DWtype); extern DWtype __mulvDI3 (DWtype, DWtype); extern DWtype __negvDI2 (DWtype); +extern UDWtype __bswapdi2 (UDWtype); #ifdef COMPAT_SIMODE_TRAPPING_ARITHMETIC extern SItype __absvsi2 (SItype); diff --git a/contrib/gcc/mips-tdump.c b/contrib/gcc/mips-tdump.c index 6cdbcfe48ba8..cd5df3887a11 100644 --- a/contrib/gcc/mips-tdump.c +++ b/contrib/gcc/mips-tdump.c @@ -29,11 +29,11 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #ifdef index #undef index #endif -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #include #else #include "mips/a.out.h" -#endif /* CROSS_COMPILE */ +#endif /* CROSS_DIRECTORY_STRUCTURE */ /* Include getopt.h for the sake of getopt_long. */ #include "getopt.h" diff --git a/contrib/gcc/mips-tfile.c b/contrib/gcc/mips-tfile.c index 7530ac7c64ec..c543f9781589 100644 --- a/contrib/gcc/mips-tfile.c +++ b/contrib/gcc/mips-tfile.c @@ -667,11 +667,11 @@ main (void) #include -#ifndef CROSS_COMPILE +#ifndef CROSS_DIRECTORY_STRUCTURE #include #else #include "mips/a.out.h" -#endif /* CROSS_COMPILE */ +#endif /* CROSS_DIRECTORY_STRUCTURE */ #include "gstab.h" diff --git a/contrib/gcc/mklibgcc.in b/contrib/gcc/mklibgcc.in index b4a31a6ca04a..60e390500ea0 100644 --- a/contrib/gcc/mklibgcc.in +++ b/contrib/gcc/mklibgcc.in @@ -91,7 +91,7 @@ lib2funcs='_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 - _divxc3 _divtc3' + _divxc3 _divtc3 _bswapsi2 _bswapdi2' if [ "$LIB2_SIDITI_CONV_FUNCS" ]; then for func in $swfloatfuncs; do diff --git a/contrib/gcc/optabs.c b/contrib/gcc/optabs.c index 539b3adaf282..3b9a23dd1b92 100644 --- a/contrib/gcc/optabs.c +++ b/contrib/gcc/optabs.c @@ -2591,6 +2591,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, goto try_libcall; } + /* We can't widen a bswap. */ + if (unoptab == bswap_optab) + goto try_libcall; + if (CLASS_HAS_WIDER_MODES_P (class)) for (wider_mode = GET_MODE_WIDER_MODE (mode); wider_mode != VOIDmode; @@ -5253,6 +5257,7 @@ init_optabs (void) absv_optab = init_optabv (ABS); addcc_optab = init_optab (UNKNOWN); one_cmpl_optab = init_optab (NOT); + bswap_optab = init_optab (BSWAP); ffs_optab = init_optab (FFS); clz_optab = init_optab (CLZ); ctz_optab = init_optab (CTZ); @@ -5456,6 +5461,11 @@ init_optabs (void) init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_FLOAT, MODE_DECIMAL_FLOAT); init_interclass_conv_libfuncs (trunc_optab, "trunc", MODE_DECIMAL_FLOAT, MODE_FLOAT); + /* Explicitly initialize the bswap libfuncs since we need them to be + valid for things other than word_mode. */ + set_optab_libfunc (bswap_optab, SImode, "__bswapsi2"); + set_optab_libfunc (bswap_optab, DImode, "__bswapdi2"); + /* Use cabs for double complex abs, since systems generally have cabs. Don't define any libcall for float complex, so that cabs will be used. */ if (complex_double_type_node) diff --git a/contrib/gcc/optabs.h b/contrib/gcc/optabs.h index 58fb6905175c..854341b5efac 100644 --- a/contrib/gcc/optabs.h +++ b/contrib/gcc/optabs.h @@ -146,6 +146,8 @@ enum optab_index /* Abs value */ OTI_abs, OTI_absv, + /* Byteswap */ + OTI_bswap, /* Bitwise not */ OTI_one_cmpl, /* Bit scanning and counting */ @@ -315,6 +317,7 @@ extern GTY(()) optab optab_table[OTI_MAX]; #define abs_optab (optab_table[OTI_abs]) #define absv_optab (optab_table[OTI_absv]) #define one_cmpl_optab (optab_table[OTI_one_cmpl]) +#define bswap_optab (optab_table[OTI_bswap]) #define ffs_optab (optab_table[OTI_ffs]) #define clz_optab (optab_table[OTI_clz]) #define ctz_optab (optab_table[OTI_ctz]) diff --git a/contrib/gcc/reload1.c b/contrib/gcc/reload1.c index 20da1b67b419..30ea7f3ef217 100644 --- a/contrib/gcc/reload1.c +++ b/contrib/gcc/reload1.c @@ -2555,6 +2555,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn, case CTZ: case POPCOUNT: case PARITY: + case BSWAP: new = eliminate_regs_1 (XEXP (x, 0), mem_mode, insn, false); if (new != XEXP (x, 0)) return gen_rtx_fmt_e (code, GET_MODE (x), new); @@ -2775,6 +2776,7 @@ elimination_effects (rtx x, enum machine_mode mem_mode) case CTZ: case POPCOUNT: case PARITY: + case BSWAP: elimination_effects (XEXP (x, 0), mem_mode); return; diff --git a/contrib/gcc/rtl.def b/contrib/gcc/rtl.def index 847b51c63217..cb37f1ab2b2b 100644 --- a/contrib/gcc/rtl.def +++ b/contrib/gcc/rtl.def @@ -567,6 +567,9 @@ DEF_RTL_EXPR(ABS, "abs", "e", RTX_UNARY) /* Square root */ DEF_RTL_EXPR(SQRT, "sqrt", "e", RTX_UNARY) +/* Swap bytes. */ +DEF_RTL_EXPR(BSWAP, "bswap", "e", RTX_UNARY) + /* Find first bit that is set. Value is 1 + number of trailing zeros in the arg., or 0 if arg is 0. */ diff --git a/contrib/gcc/simplify-rtx.c b/contrib/gcc/simplify-rtx.c index b088d9208784..531face8b9d3 100644 --- a/contrib/gcc/simplify-rtx.c +++ b/contrib/gcc/simplify-rtx.c @@ -1044,6 +1044,9 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode, val &= 1; break; + case BSWAP: + return 0; + case TRUNCATE: val = arg0; break; @@ -4887,4 +4890,3 @@ simplify_rtx (rtx x) } return NULL; } - diff --git a/contrib/gcc/tree-ssa-propagate.c b/contrib/gcc/tree-ssa-propagate.c index e08591106792..1a8a614e58ec 100644 --- a/contrib/gcc/tree-ssa-propagate.c +++ b/contrib/gcc/tree-ssa-propagate.c @@ -1,5 +1,5 @@ /* Generic SSA value propagation engine. - Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -176,6 +176,8 @@ cfg_blocks_empty_p (void) static void cfg_blocks_add (basic_block bb) { + bool head = false; + gcc_assert (bb != ENTRY_BLOCK_PTR && bb != EXIT_BLOCK_PTR); gcc_assert (!TEST_BIT (bb_in_list, bb->index)); @@ -198,12 +200,26 @@ cfg_blocks_add (basic_block bb) cfg_blocks_head = 0; VEC_safe_grow (basic_block, heap, cfg_blocks, 2 * cfg_blocks_tail); } - else + /* Minor optimization: we prefer to see blocks with more + predecessors later, because there is more of a chance that + the incoming edges will be executable. */ + else if (EDGE_COUNT (bb->preds) + >= EDGE_COUNT (VEC_index (basic_block, cfg_blocks, + cfg_blocks_head)->preds)) cfg_blocks_tail = ((cfg_blocks_tail + 1) % VEC_length (basic_block, cfg_blocks)); + else + { + if (cfg_blocks_head == 0) + cfg_blocks_head = VEC_length (basic_block, cfg_blocks); + --cfg_blocks_head; + head = true; + } } - VEC_replace (basic_block, cfg_blocks, cfg_blocks_tail, bb); + VEC_replace (basic_block, cfg_blocks, + head ? cfg_blocks_head : cfg_blocks_tail, + bb); SET_BIT (bb_in_list, bb->index); } diff --git a/contrib/gcc/tree.c b/contrib/gcc/tree.c index a4f0616323bc..a778b08512f5 100644 --- a/contrib/gcc/tree.c +++ b/contrib/gcc/tree.c @@ -6044,41 +6044,48 @@ clean_symbol_name (char *p) *p = '_'; } -/* Generate a name for a function unique to this translation unit. +/* Generate a name for a special-purpose function function. + The generated name may need to be unique across the whole link. TYPE is some string to identify the purpose of this function to the - linker or collect2. */ + linker or collect2; it must start with an uppercase letter, + one of: + I - for constructors + D - for destructors + N - for C++ anonymous namespaces + F - for DWARF unwind frame information. */ tree -get_file_function_name_long (const char *type) +get_file_function_name (const char *type) { char *buf; const char *p; char *q; + /* If we already have a name we know to be unique, just use that. */ if (first_global_object_name) + p = first_global_object_name; + /* If the target is handling the constructors/destructors, they + will be local to this file and the name is only necessary for + debugging purposes. */ + else if ((type[0] == 'I' || type[0] == 'D') && targetm.have_ctors_dtors) { - p = first_global_object_name; - - /* For type 'F', the generated name must be unique not only to this - translation unit but also to any given link. Since global names - can be overloaded, we concatenate the first global object name - with a string derived from the file name of this object. */ - if (!strcmp (type, "F")) - { - const char *file = main_input_filename; - - if (! file) - file = input_filename; - - q = alloca (strlen (p) + 10); - sprintf (q, "%s_%08X", p, crc32_string (0, file)); - - p = q; - } + const char *file = main_input_filename; + if (! file) + file = input_filename; + /* Just use the file's basename, because the full pathname + might be quite long. */ + p = strrchr (file, '/'); + if (p) + p++; + else + p = file; + p = q = ASTRDUP (p); + clean_symbol_name (q); } else { - /* We don't have anything that we know to be unique to this translation + /* Otherwise, the name must be unique across the entire link. + We don't have anything that we know to be unique to this translation unit, so use what we do have and throw in some randomness. */ unsigned len; const char *name = weak_global_object_name; @@ -6110,20 +6117,6 @@ get_file_function_name_long (const char *type) return get_identifier (buf); } - -/* If KIND=='I', return a suitable global initializer (constructor) name. - If KIND=='D', return a suitable global clean-up (destructor) name. */ - -tree -get_file_function_name (int kind) -{ - char p[2]; - - p[0] = kind; - p[1] = 0; - - return get_file_function_name_long (p); -} #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) @@ -6585,6 +6578,10 @@ build_common_tree_nodes_2 (int short_double) long_double_ptr_type_node = build_pointer_type (long_double_type_node); integer_ptr_type_node = build_pointer_type (integer_type_node); + /* Fixed size integer types. */ + uint32_type_node = build_nonstandard_integer_type (32, true); + uint64_type_node = build_nonstandard_integer_type (64, true); + /* Decimal float types. */ dfloat32_type_node = make_node (REAL_TYPE); TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE; diff --git a/contrib/gcc/tree.h b/contrib/gcc/tree.h index 4075ab0bae4b..c502182eba39 100644 --- a/contrib/gcc/tree.h +++ b/contrib/gcc/tree.h @@ -3245,6 +3245,9 @@ enum tree_index TI_UINTDI_TYPE, TI_UINTTI_TYPE, + TI_UINT32_TYPE, + TI_UINT64_TYPE, + TI_INTEGER_ZERO, TI_INTEGER_ONE, TI_INTEGER_MINUS_ONE, @@ -3320,6 +3323,9 @@ extern GTY(()) tree global_trees[TI_MAX]; #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE] #define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE] +#define uint32_type_node global_trees[TI_UINT32_TYPE] +#define uint64_type_node global_trees[TI_UINT64_TYPE] + #define integer_zero_node global_trees[TI_INTEGER_ZERO] #define integer_one_node global_trees[TI_INTEGER_ONE] #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE] @@ -4185,7 +4191,7 @@ extern GTY(()) const char * current_function_func_begin_label; /* In tree.c */ extern unsigned crc32_string (unsigned, const char *); extern void clean_symbol_name (char *); -extern tree get_file_function_name_long (const char *); +extern tree get_file_function_name (const char *); extern tree get_callee_fndecl (tree); extern void change_decl_assembler_name (tree, tree); extern int type_num_arguments (tree); @@ -4528,10 +4534,6 @@ extern void gimplify_function_tree (tree); extern const char *get_name (tree); extern tree unshare_expr (tree); extern void sort_case_labels (tree); - -/* If KIND=='I', return a suitable global initializer (constructor) name. - If KIND=='D', return a suitable global clean-up (destructor) name. */ -extern tree get_file_function_name (int); /* Interface of the DWARF2 unwind info support. */