/[gentoo]/src/patchsets/gcc/4.7.2/gentoo/90_all_gcc-4.7-x32.patch
Gentoo

Diff of /src/patchsets/gcc/4.7.2/gentoo/90_all_gcc-4.7-x32.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1git diff -p 475e5d65b13bfb798ff1f2c45ab46619ab050283^..remotes/origin/hjl/x32/gcc-4_7-branch 1git diff 6bd686c1cc586e318a520b1b3b09732bf7c915f0^...74e1f4df1f44b2249061b7770e4020b2abdb3877
2 (remotes/origin/gcc-4_7-branch) (remotes/origin/hjl/x32/gcc-4_7-branch)
3
4then filtered out useless configure & ChangeLog files
2 5
3--- a/boehm-gc/configure 6--- a/boehm-gc/configure
4+++ b/boehm-gc/configure 7+++ b/boehm-gc/configure
5@@ -6786,7 +6786,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 8@@ -6786,7 +6786,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6 LD="${LD-ld} -m elf_i386_fbsd" 9 LD="${LD-ld} -m elf_i386_fbsd"
36 # ifndef HBLKSIZE 39 # ifndef HBLKSIZE
37 # define HBLKSIZE 4096 40 # define HBLKSIZE 4096
38 # endif 41 # endif
39--- a/gcc/ada/gcc-interface/Makefile.in 42--- a/gcc/ada/gcc-interface/Makefile.in
40+++ b/gcc/ada/gcc-interface/Makefile.in 43+++ b/gcc/ada/gcc-interface/Makefile.in
41@@ -349,6 +349,10 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \ 44@@ -350,6 +350,10 @@ GNATMAKE_OBJS = a-except.o ali.o ali-util.o aspects.o s-casuti.o alloc.o \
42 ifeq ($(strip $(filter-out %x86_64, $(arch))),) 45 ifeq ($(strip $(filter-out %x86_64, $(arch))),)
43 ifeq ($(strip $(MULTISUBDIR)),/32) 46 ifeq ($(strip $(MULTISUBDIR)),/32)
44 arch:=i686 47 arch:=i686
45+ else 48+ else
46+ ifeq ($(strip $(MULTISUBDIR)),/x32) 49+ ifeq ($(strip $(MULTISUBDIR)),/x32)
47+ arch:=x32 50+ arch:=x32
48+ endif 51+ endif
49 endif 52 endif
50 endif 53 endif
51 54
52@@ -2131,6 +2135,43 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),) 55@@ -2132,6 +2136,43 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
53 LIBRARY_VERSION := $(LIB_VERSION) 56 LIBRARY_VERSION := $(LIB_VERSION)
54 endif 57 endif
55 58
56+ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),) 59+ifeq ($(strip $(filter-out %x32 linux%,$(arch) $(osys))),)
57+ LIBGNAT_TARGET_PAIRS = \ 60+ LIBGNAT_TARGET_PAIRS = \
112 mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long); 115 mcontext->gregs[REG_RSP] += 4096 + 4 * sizeof (unsigned long);
113 #elif defined (__ia64__) 116 #elif defined (__ia64__)
114 /* ??? The IA-64 unwinder doesn't compensate for signals. */ 117 /* ??? The IA-64 unwinder doesn't compensate for signals. */
115--- a/gcc/ada/link.c 118--- a/gcc/ada/link.c
116+++ b/gcc/ada/link.c 119+++ b/gcc/ada/link.c
117@@ -187,7 +187,11 @@ unsigned char __gnat_using_gnu_linker = 1; 120@@ -165,7 +165,11 @@ unsigned char __gnat_objlist_file_supported = 1;
118 const char *__gnat_object_library_extension = ".a"; 121 const char *__gnat_object_library_extension = ".a";
119 unsigned char __gnat_separate_run_path_options = 0; 122 unsigned char __gnat_separate_run_path_options = 0;
120 #if defined (__x86_64) 123 #if defined (__x86_64)
121+# if defined (__LP64__) 124+# if defined (__LP64__)
122 const char *__gnat_default_libgcc_subdir = "lib64"; 125 const char *__gnat_default_libgcc_subdir = "lib64";
126 #else 129 #else
127 const char *__gnat_default_libgcc_subdir = "lib"; 130 const char *__gnat_default_libgcc_subdir = "lib";
128 #endif 131 #endif
129--- a/gcc/config.gcc 132--- a/gcc/config.gcc
130+++ b/gcc/config.gcc 133+++ b/gcc/config.gcc
131@@ -486,6 +486,10 @@ fi 134@@ -494,6 +494,10 @@ fi
132 135
133 case ${target} in 136 case ${target} in
134 i[34567]86-*-*) 137 i[34567]86-*-*)
135+ if test "x$with_abi" != x; then 138+ if test "x$with_abi" != x; then
136+ echo "This target does not support --with-abi." 139+ echo "This target does not support --with-abi."
137+ exit 1 140+ exit 1
138+ fi 141+ fi
139 if test "x$enable_cld" = xyes; then 142 if test "x$enable_cld" = xyes; then
140 tm_defines="${tm_defines} USE_IX86_CLD=1" 143 tm_defines="${tm_defines} USE_IX86_CLD=1"
141 fi 144 fi
142@@ -495,7 +499,24 @@ i[34567]86-*-*) 145@@ -503,7 +507,24 @@ i[34567]86-*-*)
143 tm_file="vxworks-dummy.h ${tm_file}" 146 tm_file="vxworks-dummy.h ${tm_file}"
144 ;; 147 ;;
145 x86_64-*-*) 148 x86_64-*-*)
146- tm_file="i386/biarch64.h ${tm_file}" 149- tm_file="i386/biarch64.h ${tm_file}"
147+ case ${with_abi} in 150+ case ${with_abi} in
163+ exit 1 166+ exit 1
164+ esac 167+ esac
165 if test "x$enable_cld" = xyes; then 168 if test "x$enable_cld" = xyes; then
166 tm_defines="${tm_defines} USE_IX86_CLD=1" 169 tm_defines="${tm_defines} USE_IX86_CLD=1"
167 fi 170 fi
171@@ -1318,7 +1339,14 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
172 tmake_file="${tmake_file} i386/t-linux64"
173 x86_multilibs="${with_multilib_list}"
174 if test "$x86_multilibs" = "default"; then
175- x86_multilibs="m64,m32"
176+ case ${with_abi} in
177+ x32 | mx32)
178+ x86_multilibs="mx32"
179+ ;;
180+ *)
181+ x86_multilibs="m64,m32"
182+ ;;
183+ esac
184 fi
185 x86_multilibs=`echo $x86_multilibs | sed -e 's/,/ /g'`
186 for x86_multilib in ${x86_multilibs}; do
168@@ -3201,7 +3222,7 @@ case "${target}" in 187@@ -3227,7 +3255,7 @@ case "${target}" in
169 ;; 188 ;;
170 189
171 i[34567]86-*-* | x86_64-*-*) 190 i[34567]86-*-* | x86_64-*-*)
172- supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" 191- supported_defaults="arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
173+ supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64" 192+ supported_defaults="abi arch arch_32 arch_64 cpu cpu_32 cpu_64 tune tune_32 tune_64"
256 ;; <http://www.gnu.org/licenses/>. 275 ;; <http://www.gnu.org/licenses/>.
257 276
258 ;;; Unused letters: 277 ;;; Unused letters:
259-;;; B H T W 278-;;; B H T W
260+;;; B H T 279+;;; B H T
261 ;;; h k v 280 ;;; h jk v
262 281
263 ;; Integer register constraints. 282 ;; Integer register constraints.
264@@ -193,6 +193,16 @@ 283@@ -188,6 +188,16 @@
265 instructions)." 284 instructions)."
266 (match_operand 0 "x86_64_immediate_operand")) 285 (match_operand 0 "x86_64_immediate_operand"))
267 286
268+;; We use W prefix to denote any number of 287+;; We use W prefix to denote any number of
269+;; constant-or-symbol-reference constraints 288+;; constant-or-symbol-reference constraints
304 #define MULTILIB_DEFAULTS { "m64" } 323 #define MULTILIB_DEFAULTS { "m64" }
305+#endif 324+#endif
306 #else 325 #else
307 #define MULTILIB_DEFAULTS { "m32" } 326 #define MULTILIB_DEFAULTS { "m32" }
308 #endif 327 #endif
328@@ -126,3 +135,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
329 #define TARGET_THREAD_SPLIT_STACK_OFFSET \
330 (TARGET_64BIT ? (TARGET_X32 ? 0x40 : 0x70) : 0x30)
331 #endif
332+
333+#undef WCHAR_TYPE
334+#define WCHAR_TYPE (TARGET_LP64 ? "int" : "long int")
309--- a/gcc/config/i386/i386-opts.h 335--- a/gcc/config/i386/i386-opts.h
310+++ b/gcc/config/i386/i386-opts.h 336+++ b/gcc/config/i386/i386-opts.h
311@@ -71,6 +71,11 @@ enum cmodel { 337@@ -71,6 +71,11 @@ enum cmodel {
312 CM_LARGE_PIC /* No assumptions. */ 338 CM_LARGE_PIC /* No assumptions. */
313 }; 339 };
320 enum asm_dialect { 346 enum asm_dialect {
321 ASM_ATT, 347 ASM_ATT,
322 ASM_INTEL 348 ASM_INTEL
323--- a/gcc/config/i386/i386.c 349--- a/gcc/config/i386/i386.c
324+++ b/gcc/config/i386/i386.c 350+++ b/gcc/config/i386/i386.c
325@@ -2445,6 +2445,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx); 351@@ -2448,6 +2448,8 @@ static rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
326 static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx); 352 static rtx (*ix86_gen_allocate_stack_worker) (rtx, rtx);
327 static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx); 353 static rtx (*ix86_gen_adjust_stack_and_probe) (rtx, rtx, rtx);
328 static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx); 354 static rtx (*ix86_gen_probe_stack_range) (rtx, rtx, rtx);
329+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx); 355+static rtx (*ix86_gen_tls_global_dynamic_64) (rtx, rtx, rtx);
330+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx); 356+static rtx (*ix86_gen_tls_local_dynamic_base_64) (rtx, rtx);
331 357
332 /* Preferred alignment for stack boundary in bits. */ 358 /* Preferred alignment for stack boundary in bits. */
333 unsigned int ix86_preferred_stack_boundary; 359 unsigned int ix86_preferred_stack_boundary;
334@@ -2655,7 +2657,6 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, 360@@ -2658,7 +2660,6 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
335 preceding options while match those first. */ 361 preceding options while match those first. */
336 static struct ix86_target_opts isa_opts[] = 362 static struct ix86_target_opts isa_opts[] =
337 { 363 {
338- { "-m64", OPTION_MASK_ISA_64BIT }, 364- { "-m64", OPTION_MASK_ISA_64BIT },
339 { "-mfma4", OPTION_MASK_ISA_FMA4 }, 365 { "-mfma4", OPTION_MASK_ISA_FMA4 },
340 { "-mfma", OPTION_MASK_ISA_FMA }, 366 { "-mfma", OPTION_MASK_ISA_FMA },
341 { "-mxop", OPTION_MASK_ISA_XOP }, 367 { "-mxop", OPTION_MASK_ISA_XOP },
342@@ -2727,6 +2728,7 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, 368@@ -2730,6 +2731,7 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
343 size_t len; 369 size_t len;
344 size_t line_len; 370 size_t line_len;
345 size_t sep_len; 371 size_t sep_len;
346+ const char *abi; 372+ const char *abi;
347 373
348 memset (opts, '\0', sizeof (opts)); 374 memset (opts, '\0', sizeof (opts));
349 375
350@@ -2744,6 +2746,21 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch, 376@@ -2747,6 +2749,21 @@ ix86_target_string (HOST_WIDE_INT isa, int flags, const char *arch,
351 opts[num++][1] = tune; 377 opts[num++][1] = tune;
352 } 378 }
353 379
354+ /* Add -m32/-m64/-mx32. */ 380+ /* Add -m32/-m64/-mx32. */
355+ if ((isa & OPTION_MASK_ISA_64BIT) != 0) 381+ if ((isa & OPTION_MASK_ISA_64BIT) != 0)
367+ opts[num++][0] = abi; 393+ opts[num++][0] = abi;
368+ 394+
369 /* Pick out the options in isa options. */ 395 /* Pick out the options in isa options. */
370 for (i = 0; i < ARRAY_SIZE (isa_opts); i++) 396 for (i = 0; i < ARRAY_SIZE (isa_opts); i++)
371 { 397 {
372@@ -3090,6 +3107,46 @@ ix86_option_override_internal (bool main_args_p) 398@@ -3095,6 +3112,46 @@ ix86_option_override_internal (bool main_args_p)
373 sw = "attribute"; 399 sw = "attribute";
374 } 400 }
375 401
376+ /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if 402+ /* Turn off both OPTION_MASK_ABI_64 and OPTION_MASK_ABI_X32 if
377+ TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */ 403+ TARGET_64BIT_DEFAULT is true and TARGET_64BIT is false. */
414+ } 440+ }
415+ 441+
416 #ifdef SUBTARGET_OVERRIDE_OPTIONS 442 #ifdef SUBTARGET_OVERRIDE_OPTIONS
417 SUBTARGET_OVERRIDE_OPTIONS; 443 SUBTARGET_OVERRIDE_OPTIONS;
418 #endif 444 #endif
419@@ -3098,9 +3155,6 @@ ix86_option_override_internal (bool main_args_p) 445@@ -3103,9 +3160,6 @@ ix86_option_override_internal (bool main_args_p)
420 SUBSUBTARGET_OVERRIDE_OPTIONS; 446 SUBSUBTARGET_OVERRIDE_OPTIONS;
421 #endif 447 #endif
422 448
423- if (TARGET_X32) 449- if (TARGET_X32)
424- ix86_isa_flags |= OPTION_MASK_ISA_64BIT; 450- ix86_isa_flags |= OPTION_MASK_ISA_64BIT;
425- 451-
426 /* -fPIC is the default for x86_64. */ 452 /* -fPIC is the default for x86_64. */
427 if (TARGET_MACHO && TARGET_64BIT) 453 if (TARGET_MACHO && TARGET_64BIT)
428 flag_pic = 2; 454 flag_pic = 2;
429@@ -3169,6 +3223,17 @@ ix86_option_override_internal (bool main_args_p) 455@@ -3174,6 +3228,17 @@ ix86_option_override_internal (bool main_args_p)
430 else 456 else
431 ix86_arch_specified = 1; 457 ix86_arch_specified = 1;
432 458
433+ if (global_options_set.x_ix86_pmode) 459+ if (global_options_set.x_ix86_pmode)
434+ { 460+ {
442+ ix86_pmode = TARGET_LP64 ? PMODE_DI : PMODE_SI; 468+ ix86_pmode = TARGET_LP64 ? PMODE_DI : PMODE_SI;
443+ 469+
444 if (!global_options_set.x_ix86_abi) 470 if (!global_options_set.x_ix86_abi)
445 ix86_abi = DEFAULT_ABI; 471 ix86_abi = DEFAULT_ABI;
446 472
473@@ -3587,7 +3652,7 @@ ix86_option_override_internal (bool main_args_p)
474 ix86_preferred_stack_boundary = PREFERRED_STACK_BOUNDARY_DEFAULT;
475 if (global_options_set.x_ix86_preferred_stack_boundary_arg)
476 {
477- int min = (TARGET_64BIT ? 4 : 2);
478+ int min = (TARGET_64BIT ? (TARGET_SSE ? 4 : 3) : 2);
479 int max = (TARGET_SEH ? 4 : 12);
480
481 if (ix86_preferred_stack_boundary_arg < min
447@@ -3743,11 +3808,33 @@ ix86_option_override_internal (bool main_args_p) 482@@ -3750,11 +3815,33 @@ ix86_option_override_internal (bool main_args_p)
448 if (TARGET_64BIT) 483 if (TARGET_64BIT)
449 { 484 {
450 ix86_gen_leave = gen_leave_rex64; 485 ix86_gen_leave = gen_leave_rex64;
451+ if (Pmode == DImode) 486+ if (Pmode == DImode)
452+ { 487+ {
477 ix86_gen_one_cmpl2 = gen_one_cmpldi2; 512 ix86_gen_one_cmpl2 = gen_one_cmpldi2;
478- ix86_gen_monitor = gen_sse3_monitor64; 513- ix86_gen_monitor = gen_sse3_monitor64;
479 ix86_gen_andsp = gen_anddi3; 514 ix86_gen_andsp = gen_anddi3;
480 ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di; 515 ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_di;
481 ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi; 516 ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probedi;
482@@ -3755,12 +3842,10 @@ ix86_option_override_internal (bool main_args_p) 517@@ -3762,12 +3849,10 @@ ix86_option_override_internal (bool main_args_p)
483 } 518 }
484 else 519 else
485 { 520 {
486- ix86_gen_leave = gen_leave; 521- ix86_gen_leave = gen_leave;
487 ix86_gen_add3 = gen_addsi3; 522 ix86_gen_add3 = gen_addsi3;
490 ix86_gen_one_cmpl2 = gen_one_cmplsi2; 525 ix86_gen_one_cmpl2 = gen_one_cmplsi2;
491- ix86_gen_monitor = gen_sse3_monitor; 526- ix86_gen_monitor = gen_sse3_monitor;
492 ix86_gen_andsp = gen_andsi3; 527 ix86_gen_andsp = gen_andsi3;
493 ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si; 528 ix86_gen_allocate_stack_worker = gen_allocate_stack_worker_probe_si;
494 ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi; 529 ix86_gen_adjust_stack_and_probe = gen_adjust_stack_and_probesi;
495@@ -7220,8 +7305,8 @@ function_value_64 (enum machine_mode orig_mode, enum machine_mode mode, 530@@ -7227,8 +7312,8 @@ function_value_64 (enum machine_mode orig_mode, enum machine_mode mode,
496 } 531 }
497 else if (POINTER_TYPE_P (valtype)) 532 else if (POINTER_TYPE_P (valtype))
498 { 533 {
499- /* Pointers are always returned in Pmode. */ 534- /* Pointers are always returned in Pmode. */
500- mode = Pmode; 535- mode = Pmode;
501+ /* Pointers are always returned in word_mode. */ 536+ /* Pointers are always returned in word_mode. */
502+ mode = word_mode; 537+ mode = word_mode;
503 } 538 }
504 539
505 ret = construct_container (mode, orig_mode, valtype, 1, 540 ret = construct_container (mode, orig_mode, valtype, 1,
506@@ -7292,7 +7377,8 @@ ix86_function_value (const_tree valtype, const_tree fntype_or_decl, 541@@ -7299,7 +7384,8 @@ ix86_function_value (const_tree valtype, const_tree fntype_or_decl,
507 return ix86_function_value_1 (valtype, fntype_or_decl, orig_mode, mode); 542 return ix86_function_value_1 (valtype, fntype_or_decl, orig_mode, mode);
508 } 543 }
509 544
510-/* Pointer function arguments and return values are promoted to Pmode. */ 545-/* Pointer function arguments and return values are promoted to Pmode. */
511+/* Pointer function arguments and return values are promoted to 546+/* Pointer function arguments and return values are promoted to
512+ word_mode. */ 547+ word_mode. */
513 548
514 static enum machine_mode 549 static enum machine_mode
515 ix86_promote_function_mode (const_tree type, enum machine_mode mode, 550 ix86_promote_function_mode (const_tree type, enum machine_mode mode,
516@@ -7302,7 +7388,7 @@ ix86_promote_function_mode (const_tree type, enum machine_mode mode, 551@@ -7309,7 +7395,7 @@ ix86_promote_function_mode (const_tree type, enum machine_mode mode,
517 if (type != NULL_TREE && POINTER_TYPE_P (type)) 552 if (type != NULL_TREE && POINTER_TYPE_P (type))
518 { 553 {
519 *punsignedp = POINTERS_EXTEND_UNSIGNED; 554 *punsignedp = POINTERS_EXTEND_UNSIGNED;
520- return Pmode; 555- return Pmode;
521+ return word_mode; 556+ return word_mode;
522 } 557 }
523 return default_promote_function_mode (type, mode, punsignedp, fntype, 558 return default_promote_function_mode (type, mode, punsignedp, fntype,
524 for_return); 559 for_return);
525@@ -7580,12 +7666,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum) 560@@ -7587,12 +7673,13 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
526 561
527 for (i = cum->regno; i < max; i++) 562 for (i = cum->regno; i < max; i++)
528 { 563 {
529- mem = gen_rtx_MEM (Pmode, 564- mem = gen_rtx_MEM (Pmode,
530+ mem = gen_rtx_MEM (word_mode, 565+ mem = gen_rtx_MEM (word_mode,
537+ gen_rtx_REG (word_mode, 572+ gen_rtx_REG (word_mode,
538+ x86_64_int_parameter_registers[i])); 573+ x86_64_int_parameter_registers[i]));
539 } 574 }
540 575
541 if (ix86_varargs_fpr_size) 576 if (ix86_varargs_fpr_size)
542@@ -8640,8 +8727,11 @@ gen_push (rtx arg) 577@@ -8652,8 +8739,11 @@ gen_push (rtx arg)
543 m->fs.cfa_offset += UNITS_PER_WORD; 578 m->fs.cfa_offset += UNITS_PER_WORD;
544 m->fs.sp_offset += UNITS_PER_WORD; 579 m->fs.sp_offset += UNITS_PER_WORD;
545 580
546+ if (REG_P (arg) && GET_MODE (arg) != word_mode) 581+ if (REG_P (arg) && GET_MODE (arg) != word_mode)
547+ arg = gen_rtx_REG (word_mode, REGNO (arg)); 582+ arg = gen_rtx_REG (word_mode, REGNO (arg));
550- gen_rtx_MEM (Pmode, 585- gen_rtx_MEM (Pmode,
551+ gen_rtx_MEM (word_mode, 586+ gen_rtx_MEM (word_mode,
552 gen_rtx_PRE_DEC (Pmode, 587 gen_rtx_PRE_DEC (Pmode,
553 stack_pointer_rtx)), 588 stack_pointer_rtx)),
554 arg); 589 arg);
555@@ -8652,9 +8742,12 @@ gen_push (rtx arg) 590@@ -8664,9 +8754,12 @@ gen_push (rtx arg)
556 static rtx 591 static rtx
557 gen_pop (rtx arg) 592 gen_pop (rtx arg)
558 { 593 {
559+ if (REG_P (arg) && GET_MODE (arg) != word_mode) 594+ if (REG_P (arg) && GET_MODE (arg) != word_mode)
560+ arg = gen_rtx_REG (word_mode, REGNO (arg)); 595+ arg = gen_rtx_REG (word_mode, REGNO (arg));
564- gen_rtx_MEM (Pmode, 599- gen_rtx_MEM (Pmode,
565+ gen_rtx_MEM (word_mode, 600+ gen_rtx_MEM (word_mode,
566 gen_rtx_POST_INC (Pmode, 601 gen_rtx_POST_INC (Pmode,
567 stack_pointer_rtx))); 602 stack_pointer_rtx)));
568 } 603 }
569@@ -9121,7 +9214,7 @@ ix86_emit_save_regs (void) 604@@ -9141,7 +9234,7 @@ ix86_emit_save_regs (void)
570 for (regno = FIRST_PSEUDO_REGISTER - 1; regno-- > 0; ) 605 for (regno = FIRST_PSEUDO_REGISTER - 1; regno-- > 0; )
571 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) 606 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true))
572 { 607 {
573- insn = emit_insn (gen_push (gen_rtx_REG (Pmode, regno))); 608- insn = emit_insn (gen_push (gen_rtx_REG (Pmode, regno)));
574+ insn = emit_insn (gen_push (gen_rtx_REG (word_mode, regno))); 609+ insn = emit_insn (gen_push (gen_rtx_REG (word_mode, regno)));
575 RTX_FRAME_RELATED_P (insn) = 1; 610 RTX_FRAME_RELATED_P (insn) = 1;
576 } 611 }
577 } 612 }
578@@ -9201,7 +9294,7 @@ ix86_emit_save_regs_using_mov (HOST_WIDE_INT cfa_offset) 613@@ -9221,7 +9314,7 @@ ix86_emit_save_regs_using_mov (HOST_WIDE_INT cfa_offset)
579 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) 614 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
580 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true)) 615 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, true))
581 { 616 {
582- ix86_emit_save_reg_using_mov (Pmode, regno, cfa_offset); 617- ix86_emit_save_reg_using_mov (Pmode, regno, cfa_offset);
583+ ix86_emit_save_reg_using_mov (word_mode, regno, cfa_offset); 618+ ix86_emit_save_reg_using_mov (word_mode, regno, cfa_offset);
584 cfa_offset -= UNITS_PER_WORD; 619 cfa_offset -= UNITS_PER_WORD;
585 } 620 }
586 } 621 }
587@@ -9276,7 +9369,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, 622@@ -9296,7 +9389,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset,
588 rtx insn; 623 rtx insn;
589 bool add_frame_related_expr = false; 624 bool add_frame_related_expr = false;
590 625
591- if (! TARGET_64BIT) 626- if (! TARGET_64BIT)
592+ if (Pmode == SImode) 627+ if (Pmode == SImode)
593 insn = gen_pro_epilogue_adjust_stack_si_add (dest, src, offset); 628 insn = gen_pro_epilogue_adjust_stack_si_add (dest, src, offset);
594 else if (x86_64_immediate_operand (offset, DImode)) 629 else if (x86_64_immediate_operand (offset, DImode))
595 insn = gen_pro_epilogue_adjust_stack_di_add (dest, src, offset); 630 insn = gen_pro_epilogue_adjust_stack_di_add (dest, src, offset);
596@@ -10138,7 +10231,7 @@ ix86_expand_prologue (void) 631@@ -10159,7 +10252,7 @@ ix86_expand_prologue (void)
597 to implement macro RETURN_ADDR_RTX and intrinsic function 632 to implement macro RETURN_ADDR_RTX and intrinsic function
598 expand_builtin_return_addr etc. */ 633 expand_builtin_return_addr etc. */
599 t = plus_constant (crtl->drap_reg, -UNITS_PER_WORD); 634 t = plus_constant (crtl->drap_reg, -UNITS_PER_WORD);
600- t = gen_frame_mem (Pmode, t); 635- t = gen_frame_mem (Pmode, t);
601+ t = gen_frame_mem (word_mode, t); 636+ t = gen_frame_mem (word_mode, t);
602 insn = emit_insn (gen_push (t)); 637 insn = emit_insn (gen_push (t));
603 RTX_FRAME_RELATED_P (insn) = 1; 638 RTX_FRAME_RELATED_P (insn) = 1;
604 639
605@@ -10310,7 +10403,7 @@ ix86_expand_prologue (void) 640@@ -10364,7 +10457,7 @@ ix86_expand_prologue (void)
606 emit_insn (ix86_gen_allocate_stack_worker (eax, eax)); 641 emit_insn (ix86_gen_allocate_stack_worker (eax, eax));
607 642
608 /* Use the fact that AX still contains ALLOCATE. */ 643 /* Use the fact that AX still contains ALLOCATE. */
609- adjust_stack_insn = (TARGET_64BIT 644- adjust_stack_insn = (TARGET_64BIT
610+ adjust_stack_insn = (Pmode == DImode 645+ adjust_stack_insn = (Pmode == DImode
611 ? gen_pro_epilogue_adjust_stack_di_sub 646 ? gen_pro_epilogue_adjust_stack_di_sub
612 : gen_pro_epilogue_adjust_stack_si_sub); 647 : gen_pro_epilogue_adjust_stack_si_sub);
613 648
614@@ -10335,14 +10428,18 @@ ix86_expand_prologue (void) 649@@ -10389,14 +10482,18 @@ ix86_expand_prologue (void)
615 if (r10_live && eax_live) 650 if (r10_live && eax_live)
616 { 651 {
617 t = choose_baseaddr (m->fs.sp_offset - allocate); 652 t = choose_baseaddr (m->fs.sp_offset - allocate);
618- emit_move_insn (r10, gen_frame_mem (Pmode, t)); 653- emit_move_insn (r10, gen_frame_mem (Pmode, t));
619+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), 654+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG),
631+ (eax_live ? AX_REG : R10_REG)), 666+ (eax_live ? AX_REG : R10_REG)),
632+ gen_frame_mem (word_mode, t)); 667+ gen_frame_mem (word_mode, t));
633 } 668 }
634 } 669 }
635 gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset); 670 gcc_assert (m->fs.sp_offset == frame.stack_pointer_offset);
636@@ -10512,7 +10609,7 @@ ix86_emit_restore_regs_using_pop (void) 671@@ -10566,7 +10663,7 @@ ix86_emit_restore_regs_using_pop (void)
637 672
638 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) 673 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
639 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, false)) 674 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, false))
640- ix86_emit_restore_reg_using_pop (gen_rtx_REG (Pmode, regno)); 675- ix86_emit_restore_reg_using_pop (gen_rtx_REG (Pmode, regno));
641+ ix86_emit_restore_reg_using_pop (gen_rtx_REG (word_mode, regno)); 676+ ix86_emit_restore_reg_using_pop (gen_rtx_REG (word_mode, regno));
642 } 677 }
643 678
644 /* Emit code and notes for the LEAVE instruction. */ 679 /* Emit code and notes for the LEAVE instruction. */
645@@ -10555,11 +10652,11 @@ ix86_emit_restore_regs_using_mov (HOST_WIDE_INT cfa_offset, 680@@ -10609,11 +10706,11 @@ ix86_emit_restore_regs_using_mov (HOST_WIDE_INT cfa_offset,
646 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) 681 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
647 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, maybe_eh_return)) 682 if (!SSE_REGNO_P (regno) && ix86_save_reg (regno, maybe_eh_return))
648 { 683 {
649- rtx reg = gen_rtx_REG (Pmode, regno); 684- rtx reg = gen_rtx_REG (Pmode, regno);
650+ rtx reg = gen_rtx_REG (word_mode, regno); 685+ rtx reg = gen_rtx_REG (word_mode, regno);
654- mem = gen_frame_mem (Pmode, mem); 689- mem = gen_frame_mem (Pmode, mem);
655+ mem = gen_frame_mem (word_mode, mem); 690+ mem = gen_frame_mem (word_mode, mem);
656 insn = emit_move_insn (reg, mem); 691 insn = emit_move_insn (reg, mem);
657 692
658 if (m->fs.cfa_reg == crtl->drap_reg && regno == REGNO (crtl->drap_reg)) 693 if (m->fs.cfa_reg == crtl->drap_reg && regno == REGNO (crtl->drap_reg))
659@@ -11164,8 +11261,8 @@ ix86_expand_split_stack_prologue (void) 694@@ -11223,8 +11320,8 @@ ix86_expand_split_stack_prologue (void)
660 { 695 {
661 rtx rax; 696 rtx rax;
662 697
663- rax = gen_rtx_REG (Pmode, AX_REG); 698- rax = gen_rtx_REG (Pmode, AX_REG);
664- emit_move_insn (rax, reg10); 699- emit_move_insn (rax, reg10);
665+ rax = gen_rtx_REG (word_mode, AX_REG); 700+ rax = gen_rtx_REG (word_mode, AX_REG);
666+ emit_move_insn (rax, gen_rtx_REG (word_mode, R10_REG)); 701+ emit_move_insn (rax, gen_rtx_REG (word_mode, R10_REG));
667 use_reg (&call_fusage, rax); 702 use_reg (&call_fusage, rax);
668 } 703 }
669 704
670@@ -11244,8 +11341,8 @@ ix86_expand_split_stack_prologue (void) 705@@ -11303,8 +11400,8 @@ ix86_expand_split_stack_prologue (void)
671 /* If we are in 64-bit mode and this function uses a static chain, 706 /* If we are in 64-bit mode and this function uses a static chain,
672 we saved %r10 in %rax before calling _morestack. */ 707 we saved %r10 in %rax before calling _morestack. */
673 if (TARGET_64BIT && DECL_STATIC_CHAIN (cfun->decl)) 708 if (TARGET_64BIT && DECL_STATIC_CHAIN (cfun->decl))
674- emit_move_insn (gen_rtx_REG (Pmode, R10_REG), 709- emit_move_insn (gen_rtx_REG (Pmode, R10_REG),
675- gen_rtx_REG (Pmode, AX_REG)); 710- gen_rtx_REG (Pmode, AX_REG));
676+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG), 711+ emit_move_insn (gen_rtx_REG (word_mode, R10_REG),
677+ gen_rtx_REG (word_mode, AX_REG)); 712+ gen_rtx_REG (word_mode, AX_REG));
678 713
679 /* If this function calls va_start, we need to store a pointer to 714 /* If this function calls va_start, we need to store a pointer to
680 the arguments on the old stack, because they may not have been 715 the arguments on the old stack, because they may not have been
681@@ -11375,10 +11472,14 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
682 {
683 addr = XEXP (addr, 0);
684
685- /* Strip subreg. */
686+ /* Adjust SUBREGs. */
687 if (GET_CODE (addr) == SUBREG
688 && GET_MODE (SUBREG_REG (addr)) == SImode)
689 addr = SUBREG_REG (addr);
690+ else if (GET_MODE (addr) == DImode)
691+ addr = gen_rtx_SUBREG (SImode, addr, 0);
692+ else if (GET_MODE (addr) != VOIDmode)
693+ return 0;
694 }
695 }
696
697@@ -11434,6 +11535,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) 716@@ -11522,6 +11619,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
698 scale = 1 << scale; 717 scale = 1 << scale;
699 break; 718 break;
700 719
701+ case ZERO_EXTEND: 720+ case ZERO_EXTEND:
702+ op = XEXP (op, 0); 721+ op = XEXP (op, 0);
705+ /* FALLTHRU */ 724+ /* FALLTHRU */
706+ 725+
707 case UNSPEC: 726 case UNSPEC:
708 if (XINT (op, 1) == UNSPEC_TP 727 if (XINT (op, 1) == UNSPEC_TP
709 && TARGET_TLS_DIRECT_SEG_REFS 728 && TARGET_TLS_DIRECT_SEG_REFS
710@@ -11503,6 +11610,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) 729@@ -11604,6 +11707,12 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
711 return 0; 730 return 0;
712 } 731 }
713 732
714+/* Address override works only on the (%reg) part of %fs:(%reg). */ 733+/* Address override works only on the (%reg) part of %fs:(%reg). */
715+ if (seg != SEG_DEFAULT 734+ if (seg != SEG_DEFAULT
718+ return 0; 737+ return 0;
719+ 738+
720 /* Extract the integral value of scale. */ 739 /* Extract the integral value of scale. */
721 if (scale_rtx) 740 if (scale_rtx)
722 { 741 {
723@@ -12455,15 +12568,20 @@ legitimize_pic_address (rtx orig, rtx reg) 742@@ -12549,15 +12658,20 @@ legitimize_pic_address (rtx orig, rtx reg)
724 /* Load the thread pointer. If TO_REG is true, force it into a register. */ 743 /* Load the thread pointer. If TO_REG is true, force it into a register. */
725 744
726 static rtx 745 static rtx
727-get_thread_pointer (bool to_reg) 746-get_thread_pointer (bool to_reg)
728+get_thread_pointer (enum machine_mode tp_mode, bool to_reg) 747+get_thread_pointer (enum machine_mode tp_mode, bool to_reg)
743- tp = copy_addr_to_reg (tp); 762- tp = copy_addr_to_reg (tp);
744+ tp = copy_to_mode_reg (tp_mode, tp); 763+ tp = copy_to_mode_reg (tp_mode, tp);
745 764
746 return tp; 765 return tp;
747 } 766 }
748@@ -12515,6 +12633,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 767@@ -12609,6 +12723,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
749 { 768 {
750 rtx dest, base, off; 769 rtx dest, base, off;
751 rtx pic = NULL_RTX, tp = NULL_RTX; 770 rtx pic = NULL_RTX, tp = NULL_RTX;
752+ enum machine_mode tp_mode = Pmode; 771+ enum machine_mode tp_mode = Pmode;
753 int type; 772 int type;
754 773
755 switch (model) 774 switch (model)
756@@ -12540,7 +12659,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 775@@ -12634,7 +12749,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
757 else 776 else
758 emit_insn (gen_tls_dynamic_gnu2_32 (dest, x, pic)); 777 emit_insn (gen_tls_dynamic_gnu2_32 (dest, x, pic));
759 778
760- tp = get_thread_pointer (true); 779- tp = get_thread_pointer (true);
761+ tp = get_thread_pointer (Pmode, true); 780+ tp = get_thread_pointer (Pmode, true);
762 dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest)); 781 dest = force_reg (Pmode, gen_rtx_PLUS (Pmode, tp, dest));
763 782
764 set_unique_reg_note (get_last_insn (), REG_EQUAL, x); 783 set_unique_reg_note (get_last_insn (), REG_EQUAL, x);
765@@ -12554,7 +12673,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 784@@ -12648,7 +12763,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
766 rtx rax = gen_rtx_REG (Pmode, AX_REG), insns; 785 rtx rax = gen_rtx_REG (Pmode, AX_REG), insns;
767 786
768 start_sequence (); 787 start_sequence ();
769- emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr)); 788- emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr));
770+ emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x, 789+ emit_call_insn (ix86_gen_tls_global_dynamic_64 (rax, x,
771+ caddr)); 790+ caddr));
772 insns = get_insns (); 791 insns = get_insns ();
773 end_sequence (); 792 end_sequence ();
774 793
775@@ -12589,7 +12709,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 794@@ -12683,7 +12799,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
776 else 795 else
777 emit_insn (gen_tls_dynamic_gnu2_32 (base, tmp, pic)); 796 emit_insn (gen_tls_dynamic_gnu2_32 (base, tmp, pic));
778 797
779- tp = get_thread_pointer (true); 798- tp = get_thread_pointer (true);
780+ tp = get_thread_pointer (Pmode, true); 799+ tp = get_thread_pointer (Pmode, true);
781 set_unique_reg_note (get_last_insn (), REG_EQUAL, 800 set_unique_reg_note (get_last_insn (), REG_EQUAL,
782 gen_rtx_MINUS (Pmode, tmp, tp)); 801 gen_rtx_MINUS (Pmode, tmp, tp));
783 } 802 }
784@@ -12602,7 +12722,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 803@@ -12696,7 +12812,8 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
785 rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv; 804 rtx rax = gen_rtx_REG (Pmode, AX_REG), insns, eqv;
786 805
787 start_sequence (); 806 start_sequence ();
788- emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr)); 807- emit_call_insn (gen_tls_local_dynamic_base_64 (rax, caddr));
789+ emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax, 808+ emit_call_insn (ix86_gen_tls_local_dynamic_base_64 (rax,
790+ caddr)); 809+ caddr));
791 insns = get_insns (); 810 insns = get_insns ();
792 end_sequence (); 811 end_sequence ();
793 812
794@@ -12645,6 +12766,9 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 813@@ -12739,6 +12856,9 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
795 return dest; 814 return dest;
796 } 815 }
797 816
798+ /* Generate DImode references to avoid %fs:(%reg32) 817+ /* Generate DImode references to avoid %fs:(%reg32)
799+ problems and linker IE->LE relaxation bug. */ 818+ problems and linker IE->LE relaxation bug. */
800+ tp_mode = DImode; 819+ tp_mode = DImode;
801 pic = NULL; 820 pic = NULL;
802 type = UNSPEC_GOTNTPOFF; 821 type = UNSPEC_GOTNTPOFF;
803 } 822 }
804@@ -12667,22 +12791,23 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 823@@ -12761,22 +12881,23 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
805 type = UNSPEC_INDNTPOFF; 824 type = UNSPEC_INDNTPOFF;
806 } 825 }
807 826
808- off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), type); 827- off = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, x), type);
809- off = gen_rtx_CONST (Pmode, off); 828- off = gen_rtx_CONST (Pmode, off);
831- base = get_thread_pointer (true); 850- base = get_thread_pointer (true);
832+ base = get_thread_pointer (Pmode, true); 851+ base = get_thread_pointer (Pmode, true);
833 dest = gen_reg_rtx (Pmode); 852 dest = gen_reg_rtx (Pmode);
834 emit_insn (gen_subsi3 (dest, base, off)); 853 emit_insn (gen_subsi3 (dest, base, off));
835 } 854 }
836@@ -12696,12 +12821,13 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) 855@@ -12790,12 +12911,13 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
837 856
838 if (TARGET_64BIT || TARGET_ANY_GNU_TLS) 857 if (TARGET_64BIT || TARGET_ANY_GNU_TLS)
839 { 858 {
840- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS); 859- base = get_thread_pointer (for_mov || !TARGET_TLS_DIRECT_SEG_REFS);
841+ base = get_thread_pointer (Pmode, 860+ base = get_thread_pointer (Pmode,
847- base = get_thread_pointer (true); 866- base = get_thread_pointer (true);
848+ base = get_thread_pointer (Pmode, true); 867+ base = get_thread_pointer (Pmode, true);
849 dest = gen_reg_rtx (Pmode); 868 dest = gen_reg_rtx (Pmode);
850 emit_insn (gen_subsi3 (dest, base, off)); 869 emit_insn (gen_subsi3 (dest, base, off));
851 } 870 }
852@@ -13756,6 +13882,7 @@ get_some_local_dynamic_name (void)
853 Z -- likewise, with special suffixes for x87 instructions.
854 * -- print a star (in certain assembler syntax)
855 A -- print an absolute memory reference.
856+ E -- print address with DImode register names if TARGET_64BIT.
857 w -- print the operand as if it's a "word" (HImode) even if it isn't.
858 s -- print a shift double count, followed by the assemblers argument
859 delimiter.
860@@ -13780,6 +13907,7 @@ get_some_local_dynamic_name (void) 871@@ -13875,6 +13997,7 @@ get_some_local_dynamic_name (void)
861 ; -- print a semicolon (after prefixes due to bug in older gas). 872 ; -- print a semicolon (after prefixes due to bug in older gas).
862 ~ -- print "i" if TARGET_AVX2, "f" otherwise. 873 ~ -- print "i" if TARGET_AVX2, "f" otherwise.
863 @ -- print a segment register of thread base pointer load 874 @ -- print a segment register of thread base pointer load
864+ ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode 875+ ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
865 */ 876 */
866 877
867 void 878 void
868@@ -13831,7 +13959,14 @@ ix86_print_operand (FILE *file, rtx x, int code)
869 ix86_print_operand (file, x, 0);
870 return;
871
872+ case 'E':
873+ /* Wrap address in an UNSPEC to declare special handling. */
874+ if (TARGET_64BIT)
875+ x = gen_rtx_UNSPEC (DImode, gen_rtvec (1, x), UNSPEC_LEA_ADDR);
876
877+ output_address (x);
878+ return;
879+
880 case 'L':
881 if (ASSEMBLER_DIALECT == ASM_ATT)
882 putc ('l', file);
883@@ -14283,6 +14418,11 @@ ix86_print_operand (FILE *file, rtx x, int code) 879@@ -14385,6 +14508,11 @@ ix86_print_operand (FILE *file, rtx x, int code)
884 putc (TARGET_AVX2 ? 'i' : 'f', file); 880 putc (TARGET_AVX2 ? 'i' : 'f', file);
885 return; 881 return;
886 882
887+ case '^': 883+ case '^':
888+ if (TARGET_64BIT && Pmode != word_mode) 884+ if (TARGET_64BIT && Pmode != word_mode)
890+ return; 886+ return;
891+ 887+
892 default: 888 default:
893 output_operand_lossage ("invalid operand code '%c'", code); 889 output_operand_lossage ("invalid operand code '%c'", code);
894 } 890 }
895@@ -14422,8 +14562,8 @@ ix86_print_operand (FILE *file, rtx x, int code) 891@@ -14524,8 +14652,8 @@ ix86_print_operand (FILE *file, rtx x, int code)
896 static bool 892 static bool
897 ix86_print_operand_punct_valid_p (unsigned char code) 893 ix86_print_operand_punct_valid_p (unsigned char code)
898 { 894 {
899- return (code == '@' || code == '*' || code == '+' 895- return (code == '@' || code == '*' || code == '+'
900- || code == '&' || code == ';' || code == '~'); 896- || code == '&' || code == ';' || code == '~');
901+ return (code == '@' || code == '*' || code == '+' || code == '&' 897+ return (code == '@' || code == '*' || code == '+' || code == '&'
902+ || code == ';' || code == '~' || code == '^'); 898+ || code == ';' || code == '~' || code == '^');
903 } 899 }
904 900
905 /* Print a memory operand whose address is ADDR. */ 901 /* Print a memory operand whose address is ADDR. */
906@@ -14436,6 +14576,7 @@ ix86_print_operand_address (FILE *file, rtx addr)
907 int scale;
908 int ok;
909 bool vsib = false;
910+ int code = 0;
911
912 if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_VSIBADDR)
913 {
914@@ -14446,6 +14587,12 @@ ix86_print_operand_address (FILE *file, rtx addr)
915 addr = XVECEXP (addr, 0, 0);
916 vsib = true;
917 }
918+ else if (GET_CODE (addr) == UNSPEC && XINT (addr, 1) == UNSPEC_LEA_ADDR)
919+ {
920+ gcc_assert (TARGET_64BIT);
921+ ok = ix86_decompose_address (XVECEXP (addr, 0, 0), &parts);
922+ code = 'q';
923+ }
924 else
925 ok = ix86_decompose_address (addr, &parts);
926
927@@ -14516,15 +14663,15 @@ ix86_print_operand_address (FILE *file, rtx addr)
928 }
929 else
930 {
931- int code = 0;
932-
933- /* Print SImode registers for zero-extended addresses to force
934- addr32 prefix. Otherwise print DImode registers to avoid it. */
935- if (TARGET_64BIT)
936- code = ((GET_CODE (addr) == ZERO_EXTEND
937- || GET_CODE (addr) == AND)
938- ? 'l'
939- : 'q');
940+ /* Print SImode register names for zero-extended
941+ addresses to force addr32 prefix. */
942+ if (TARGET_64BIT
943+ && (GET_CODE (addr) == ZERO_EXTEND
944+ || GET_CODE (addr) == AND))
945+ {
946+ gcc_assert (!code);
947+ code = 'l';
948+ }
949
950 if (ASSEMBLER_DIALECT == ASM_ATT)
951 {
952@@ -20299,7 +20446,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) 902@@ -20428,7 +20556,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode)
953 gcc_assert (ok); 903 gcc_assert (ok);
954 904
955 operand = copy_rtx (operand); 905 operand = copy_rtx (operand);
956- PUT_MODE (operand, Pmode); 906- PUT_MODE (operand, Pmode);
957+ PUT_MODE (operand, word_mode); 907+ PUT_MODE (operand, word_mode);
958 parts[0] = parts[1] = parts[2] = parts[3] = operand; 908 parts[0] = parts[1] = parts[2] = parts[3] = operand;
959 return size; 909 return size;
960 } 910 }
961@@ -20452,7 +20599,7 @@ ix86_split_long_move (rtx operands[]) 911@@ -20581,7 +20709,7 @@ ix86_split_long_move (rtx operands[])
962 if (push_operand (operands[0], VOIDmode)) 912 if (push_operand (operands[0], VOIDmode))
963 { 913 {
964 operands[0] = copy_rtx (operands[0]); 914 operands[0] = copy_rtx (operands[0]);
965- PUT_MODE (operands[0], Pmode); 915- PUT_MODE (operands[0], Pmode);
966+ PUT_MODE (operands[0], word_mode); 916+ PUT_MODE (operands[0], word_mode);
967 } 917 }
968 else 918 else
969 operands[0] = gen_lowpart (DImode, operands[0]); 919 operands[0] = gen_lowpart (DImode, operands[0]);
970@@ -21007,14 +21154,9 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value) 920@@ -21136,14 +21264,9 @@ ix86_adjust_counter (rtx countreg, HOST_WIDE_INT value)
971 rtx 921 rtx
972 ix86_zero_extend_to_Pmode (rtx exp) 922 ix86_zero_extend_to_Pmode (rtx exp)
973 { 923 {
974- rtx r; 924- rtx r;
975- if (GET_MODE (exp) == VOIDmode) 925- if (GET_MODE (exp) == VOIDmode)
983+ exp = convert_to_mode (Pmode, exp, 1); 933+ exp = convert_to_mode (Pmode, exp, 1);
984+ return force_reg (Pmode, exp); 934+ return force_reg (Pmode, exp);
985 } 935 }
986 936
987 /* Divide COUNTREG by SCALE. */ 937 /* Divide COUNTREG by SCALE. */
988@@ -22042,11 +22184,11 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, 938@@ -22171,11 +22294,11 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp,
989 gcc_unreachable (); 939 gcc_unreachable ();
990 case loop: 940 case loop:
991 need_zero_guard = true; 941 need_zero_guard = true;
992- size_needed = GET_MODE_SIZE (Pmode); 942- size_needed = GET_MODE_SIZE (Pmode);
993+ size_needed = GET_MODE_SIZE (word_mode); 943+ size_needed = GET_MODE_SIZE (word_mode);
997- size_needed = GET_MODE_SIZE (Pmode) * (TARGET_64BIT ? 4 : 2); 947- size_needed = GET_MODE_SIZE (Pmode) * (TARGET_64BIT ? 4 : 2);
998+ size_needed = GET_MODE_SIZE (word_mode) * (TARGET_64BIT ? 4 : 2); 948+ size_needed = GET_MODE_SIZE (word_mode) * (TARGET_64BIT ? 4 : 2);
999 break; 949 break;
1000 case rep_prefix_8_byte: 950 case rep_prefix_8_byte:
1001 size_needed = 8; 951 size_needed = 8;
1002@@ -22212,13 +22354,13 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp, 952@@ -22341,13 +22464,13 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp,
1003 break; 953 break;
1004 case loop: 954 case loop:
1005 expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL, 955 expand_set_or_movmem_via_loop (dst, src, destreg, srcreg, NULL,
1006- count_exp, Pmode, 1, expected_size); 956- count_exp, Pmode, 1, expected_size);
1007+ count_exp, word_mode, 1, expected_size); 957+ count_exp, word_mode, 1, expected_size);
1013- count_exp, Pmode, TARGET_64BIT ? 4 : 2, 963- count_exp, Pmode, TARGET_64BIT ? 4 : 2,
1014+ count_exp, word_mode, TARGET_64BIT ? 4 : 2, 964+ count_exp, word_mode, TARGET_64BIT ? 4 : 2,
1015 expected_size); 965 expected_size);
1016 break; 966 break;
1017 case rep_prefix_8_byte: 967 case rep_prefix_8_byte:
1018@@ -22430,11 +22572,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, 968@@ -22559,11 +22682,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp,
1019 gcc_unreachable (); 969 gcc_unreachable ();
1020 case loop: 970 case loop:
1021 need_zero_guard = true; 971 need_zero_guard = true;
1022- size_needed = GET_MODE_SIZE (Pmode); 972- size_needed = GET_MODE_SIZE (Pmode);
1023+ size_needed = GET_MODE_SIZE (word_mode); 973+ size_needed = GET_MODE_SIZE (word_mode);
1027- size_needed = GET_MODE_SIZE (Pmode) * 4; 977- size_needed = GET_MODE_SIZE (Pmode) * 4;
1028+ size_needed = GET_MODE_SIZE (word_mode) * 4; 978+ size_needed = GET_MODE_SIZE (word_mode) * 4;
1029 break; 979 break;
1030 case rep_prefix_8_byte: 980 case rep_prefix_8_byte:
1031 size_needed = 8; 981 size_needed = 8;
1032@@ -22605,11 +22747,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp, 982@@ -22734,11 +22857,11 @@ ix86_expand_setmem (rtx dst, rtx count_exp, rtx val_exp, rtx align_exp,
1033 break; 983 break;
1034 case loop: 984 case loop:
1035 expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val, 985 expand_set_or_movmem_via_loop (dst, NULL, destreg, NULL, promoted_val,
1036- count_exp, Pmode, 1, expected_size); 986- count_exp, Pmode, 1, expected_size);
1037+ count_exp, word_mode, 1, expected_size); 987+ count_exp, word_mode, 1, expected_size);
1041- count_exp, Pmode, 4, expected_size); 991- count_exp, Pmode, 4, expected_size);
1042+ count_exp, word_mode, 4, expected_size); 992+ count_exp, word_mode, 4, expected_size);
1043 break; 993 break;
1044 case rep_prefix_8_byte: 994 case rep_prefix_8_byte:
1045 expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp, 995 expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp,
1046@@ -22972,13 +23114,13 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, 996@@ -23101,13 +23224,13 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
1047 && !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode)) 997 && !local_symbolic_operand (XEXP (fnaddr, 0), VOIDmode))
1048 fnaddr = gen_rtx_MEM (QImode, construct_plt_address (XEXP (fnaddr, 0))); 998 fnaddr = gen_rtx_MEM (QImode, construct_plt_address (XEXP (fnaddr, 0)));
1049 else if (sibcall 999 else if (sibcall
1050- ? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode) 1000- ? !sibcall_insn_operand (XEXP (fnaddr, 0), Pmode)
1051- : !call_insn_operand (XEXP (fnaddr, 0), Pmode)) 1001- : !call_insn_operand (XEXP (fnaddr, 0), Pmode))
1060+ fnaddr = convert_to_mode (word_mode, fnaddr, 1); 1010+ fnaddr = convert_to_mode (word_mode, fnaddr, 1);
1061+ fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr)); 1011+ fnaddr = gen_rtx_MEM (QImode, copy_to_mode_reg (word_mode, fnaddr));
1062 } 1012 }
1063 1013
1064 vec_len = 0; 1014 vec_len = 0;
1065@@ -24291,10 +24433,13 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) 1015@@ -24421,10 +24544,13 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
1066 /* Load the function address to r11. Try to load address using 1016 /* Load the function address to r11. Try to load address using
1067 the shorter movl instead of movabs. We may want to support 1017 the shorter movl instead of movabs. We may want to support
1068 movq for kernel mode, but kernel does not use trampolines at 1018 movq for kernel mode, but kernel does not use trampolines at
1069- the moment. */ 1019- the moment. */
1070- if (x86_64_zext_immediate_operand (fnaddr, VOIDmode)) 1020- if (x86_64_zext_immediate_operand (fnaddr, VOIDmode))
1077- fnaddr = copy_to_mode_reg (DImode, fnaddr); 1027- fnaddr = copy_to_mode_reg (DImode, fnaddr);
1078+ fnaddr = copy_to_mode_reg (Pmode, fnaddr); 1028+ fnaddr = copy_to_mode_reg (Pmode, fnaddr);
1079 1029
1080 mem = adjust_address (m_tramp, HImode, offset); 1030 mem = adjust_address (m_tramp, HImode, offset);
1081 emit_move_insn (mem, gen_int_mode (0xbb41, HImode)); 1031 emit_move_insn (mem, gen_int_mode (0xbb41, HImode));
1082@@ -24313,9 +24458,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value) 1032@@ -24443,9 +24569,9 @@ ix86_trampoline_init (rtx m_tramp, tree fndecl, rtx chain_value)
1083 offset += 10; 1033 offset += 10;
1084 } 1034 }
1085 1035
1086- /* Load static chain using movabs to r10. Use the 1036- /* Load static chain using movabs to r10. Use the
1087- shorter movl instead of movabs for x32. */ 1037- shorter movl instead of movabs for x32. */
1090+ instead of movabs when ptr_mode == SImode. */ 1040+ instead of movabs when ptr_mode == SImode. */
1091+ if (ptr_mode == SImode) 1041+ if (ptr_mode == SImode)
1092 { 1042 {
1093 opcode = 0xba41; 1043 opcode = 0xba41;
1094 size = 6; 1044 size = 6;
1095@@ -31952,7 +32097,7 @@ x86_this_parameter (tree function) 1045@@ -32082,7 +32208,7 @@ x86_this_parameter (tree function)
1096 parm_regs = x86_64_ms_abi_int_parameter_registers; 1046 parm_regs = x86_64_ms_abi_int_parameter_registers;
1097 else 1047 else
1098 parm_regs = x86_64_int_parameter_registers; 1048 parm_regs = x86_64_int_parameter_registers;
1099- return gen_rtx_REG (DImode, parm_regs[aggr]); 1049- return gen_rtx_REG (DImode, parm_regs[aggr]);
1100+ return gen_rtx_REG (Pmode, parm_regs[aggr]); 1050+ return gen_rtx_REG (Pmode, parm_regs[aggr]);
1119+#define TARGET_LP64 OPTION_ABI_64 1069+#define TARGET_LP64 OPTION_ABI_64
1120+#define TARGET_X32 OPTION_ABI_X32 1070+#define TARGET_X32 OPTION_ABI_X32
1121 1071
1122 /* SSE4.1 defines round instructions */ 1072 /* SSE4.1 defines round instructions */
1123 #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1 1073 #define OPTION_MASK_ISA_ROUND OPTION_MASK_ISA_SSE4_1
1074@@ -705,7 +705,7 @@ enum target_cpu_default
1075 #define MAIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
1076
1077 /* Minimum stack boundary. */
1078-#define MIN_STACK_BOUNDARY (TARGET_64BIT ? 128 : 32)
1079+#define MIN_STACK_BOUNDARY (TARGET_64BIT ? (TARGET_SSE ? 128 : 64) : 32)
1080
1081 /* Boundary (in *bits*) on which the stack pointer prefers to be
1082 aligned; the compiler cannot rely on having this alignment. */
1124@@ -1760,7 +1760,7 @@ do { \ 1083@@ -1774,7 +1774,7 @@ do { \
1125 /* Specify the machine mode that pointers have. 1084 /* Specify the machine mode that pointers have.
1126 After generation of rtl, the compiler makes no further distinction 1085 After generation of rtl, the compiler makes no further distinction
1127 between pointers and any other objects of this machine mode. */ 1086 between pointers and any other objects of this machine mode. */
1128-#define Pmode (TARGET_64BIT ? DImode : SImode) 1087-#define Pmode (TARGET_64BIT ? DImode : SImode)
1129+#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode) 1088+#define Pmode (ix86_pmode == PMODE_DI ? DImode : SImode)
1130 1089
1131 /* A C expression whose value is zero if pointers that need to be extended 1090 /* A C expression whose value is zero if pointers that need to be extended
1132 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and 1091 from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
1133--- a/gcc/config/i386/i386.md 1092--- a/gcc/config/i386/i386.md
1134+++ b/gcc/config/i386/i386.md 1093+++ b/gcc/config/i386/i386.md
1135@@ -38,6 +38,7 @@
1136 ;; Z -- likewise, with special suffixes for x87 instructions.
1137 ;; * -- print a star (in certain assembler syntax)
1138 ;; A -- print an absolute memory reference.
1139+;; E -- print address with DImode register names if TARGET_64BIT.
1140 ;; w -- print the operand as if it's a "word" (HImode) even if it isn't.
1141 ;; s -- print a shift double count, followed by the assemblers argument
1142 ;; delimiter.
1143@@ -60,7 +61,9 @@ 1094@@ -61,7 +61,9 @@
1144 ;; Y -- print condition for XOP pcom* instruction. 1095 ;; Y -- print condition for XOP pcom* instruction.
1145 ;; + -- print a branch hint as 'cs' or 'ds' prefix 1096 ;; + -- print a branch hint as 'cs' or 'ds' prefix
1146 ;; ; -- print a semicolon (after prefixes due to bug in older gas). 1097 ;; ; -- print a semicolon (after prefixes due to bug in older gas).
1147+;; ~ -- print "i" if TARGET_AVX2, "f" otherwise. 1098+;; ~ -- print "i" if TARGET_AVX2, "f" otherwise.
1148 ;; @ -- print a segment register of thread base pointer load 1099 ;; @ -- print a segment register of thread base pointer load
1149+;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode 1100+;; ^ -- print addr32 prefix if TARGET_64BIT and Pmode != word_mode
1150 1101
1151 (define_c_enum "unspec" [ 1102 (define_c_enum "unspec" [
1152 ;; Relocation specifiers 1103 ;; Relocation specifiers
1153@@ -109,6 +112,7 @@
1154 UNSPEC_MS_TO_SYSV_CALL
1155 UNSPEC_CALL_NEEDS_VZEROUPPER
1156 UNSPEC_PAUSE
1157+ UNSPEC_LEA_ADDR
1158
1159 ;; For SSE/MMX support:
1160 UNSPEC_FIX_NOTRUNC
1161@@ -892,6 +896,11 @@ 1104@@ -901,6 +903,11 @@
1162 ;; pointer-sized quantities. Exactly one of the two alternatives will match. 1105 ;; pointer-sized quantities. Exactly one of the two alternatives will match.
1163 (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) 1106 (define_mode_iterator P [(SI "Pmode == SImode") (DI "Pmode == DImode")])
1164 1107
1165+;; This mode iterator allows :W to be used for patterns that operate on 1108+;; This mode iterator allows :W to be used for patterns that operate on
1166+;; word_mode sized quantities. 1109+;; word_mode sized quantities.
1168+ [(SI "word_mode == SImode") (DI "word_mode == DImode")]) 1111+ [(SI "word_mode == SImode") (DI "word_mode == DImode")])
1169+ 1112+
1170 ;; This mode iterator allows :PTR to be used for patterns that operate on 1113 ;; This mode iterator allows :PTR to be used for patterns that operate on
1171 ;; ptr_mode sized quantities. 1114 ;; ptr_mode sized quantities.
1172 (define_mode_iterator PTR 1115 (define_mode_iterator PTR
1173@@ -1700,8 +1709,8 @@ 1116@@ -1709,8 +1716,8 @@
1174 (set_attr "mode" "SI")]) 1117 (set_attr "mode" "SI")])
1175 1118
1176 (define_insn "*push<mode>2_prologue" 1119 (define_insn "*push<mode>2_prologue"
1177- [(set (match_operand:P 0 "push_operand" "=<") 1120- [(set (match_operand:P 0 "push_operand" "=<")
1178- (match_operand:P 1 "general_no_elim_operand" "r<i>*m")) 1121- (match_operand:P 1 "general_no_elim_operand" "r<i>*m"))
1179+ [(set (match_operand:W 0 "push_operand" "=<") 1122+ [(set (match_operand:W 0 "push_operand" "=<")
1180+ (match_operand:W 1 "general_no_elim_operand" "r<i>*m")) 1123+ (match_operand:W 1 "general_no_elim_operand" "r<i>*m"))
1181 (clobber (mem:BLK (scratch)))] 1124 (clobber (mem:BLK (scratch)))]
1182 "" 1125 ""
1183 "push{<imodesuffix>}\t%1" 1126 "push{<imodesuffix>}\t%1"
1184@@ -1709,16 +1718,16 @@ 1127@@ -1718,16 +1725,16 @@
1185 (set_attr "mode" "<MODE>")]) 1128 (set_attr "mode" "<MODE>")])
1186 1129
1187 (define_insn "*pop<mode>1" 1130 (define_insn "*pop<mode>1"
1188- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m") 1131- [(set (match_operand:P 0 "nonimmediate_operand" "=r*m")
1189- (match_operand:P 1 "pop_operand" ">"))] 1132- (match_operand:P 1 "pop_operand" ">"))]
1200+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m") 1143+ [(set (match_operand:W 0 "nonimmediate_operand" "=r*m")
1201+ (match_operand:W 1 "pop_operand" ">")) 1144+ (match_operand:W 1 "pop_operand" ">"))
1202 (clobber (mem:BLK (scratch)))] 1145 (clobber (mem:BLK (scratch)))]
1203 "" 1146 ""
1204 "pop{<imodesuffix>}\t%0" 1147 "pop{<imodesuffix>}\t%0"
1205@@ -1958,7 +1967,7 @@
1206 return "#";
1207
1208 case TYPE_LEA:
1209- return "lea{q}\t{%a1, %0|%0, %a1}";
1210+ return "lea{q}\t{%E1, %0|%0, %E1}";
1211
1212 default:
1213 gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1]));
1214@@ -1967,7 +1976,7 @@
1215 else if (which_alternative == 2)
1216 return "movabs{q}\t{%1, %0|%0, %1}";
1217 else if (ix86_use_lea_for_mov (insn, operands))
1218- return "lea{q}\t{%a1, %0|%0, %a1}";
1219+ return "lea{q}\t{%E1, %0|%0, %E1}";
1220 else
1221 return "mov{q}\t{%1, %0|%0, %1}";
1222 }
1223@@ -2199,12 +2208,12 @@
1224 return "movd\t{%1, %0|%0, %1}";
1225
1226 case TYPE_LEA:
1227- return "lea{l}\t{%a1, %0|%0, %a1}";
1228+ return "lea{l}\t{%E1, %0|%0, %E1}";
1229
1230 default:
1231 gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1]));
1232 if (ix86_use_lea_for_mov (insn, operands))
1233- return "lea{l}\t{%a1, %0|%0, %a1}";
1234+ return "lea{l}\t{%E1, %0|%0, %E1}";
1235 else
1236 return "mov{l}\t{%1, %0|%0, %1}";
1237 }
1238@@ -3382,9 +3391,9 @@ 1148@@ -3399,9 +3406,9 @@
1239 }) 1149 })
1240 1150
1241 (define_insn "*zero_extendsidi2_rex64" 1151 (define_insn "*zero_extendsidi2_rex64"
1242- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*x") 1152- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*x")
1243+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r ,o,?*Ym,?*y,?*Yi,*x") 1153+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r ,o,?*Ym,?*y,?*Yi,*x")
1245- (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] 1155- (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))]
1246+ (match_operand:SI 1 "x86_64_zext_general_operand" "rmWz,0,r ,m ,r ,m")))] 1156+ (match_operand:SI 1 "x86_64_zext_general_operand" "rmWz,0,r ,m ,r ,m")))]
1247 "TARGET_64BIT" 1157 "TARGET_64BIT"
1248 "@ 1158 "@
1249 mov{l}\t{%1, %k0|%k0, %1} 1159 mov{l}\t{%1, %k0|%k0, %1}
1250@@ -5437,7 +5446,7 @@
1251 [(set (match_operand:SI 0 "register_operand" "=r")
1252 (subreg:SI (match_operand:DI 1 "lea_address_operand" "p") 0))]
1253 "TARGET_64BIT"
1254- "lea{l}\t{%a1, %0|%0, %a1}"
1255+ "lea{l}\t{%E1, %0|%0, %E1}"
1256 "&& reload_completed && ix86_avoid_lea_for_addr (insn, operands)"
1257 [(const_int 0)]
1258 {
1259@@ -5451,7 +5460,7 @@
1260 [(set (match_operand:SWI48 0 "register_operand" "=r")
1261 (match_operand:SWI48 1 "lea_address_operand" "p"))]
1262 ""
1263- "lea{<imodesuffix>}\t{%a1, %0|%0, %a1}"
1264+ "lea{<imodesuffix>}\t{%E1, %0|%0, %E1}"
1265 "reload_completed && ix86_avoid_lea_for_addr (insn, operands)"
1266 [(const_int 0)]
1267 {
1268@@ -5466,7 +5475,7 @@
1269 (zero_extend:DI
1270 (subreg:SI (match_operand:DI 1 "lea_address_operand" "j") 0)))]
1271 "TARGET_64BIT"
1272- "lea{l}\t{%a1, %k0|%k0, %a1}"
1273+ "lea{l}\t{%E1, %k0|%k0, %E1}"
1274 [(set_attr "type" "lea")
1275 (set_attr "mode" "SI")])
1276
1277@@ -5475,7 +5484,7 @@
1278 (zero_extend:DI
1279 (match_operand:SI 1 "lea_address_operand" "j")))]
1280 "TARGET_64BIT"
1281- "lea{l}\t{%a1, %k0|%k0, %a1}"
1282+ "lea{l}\t{%E1, %k0|%k0, %E1}"
1283 [(set_attr "type" "lea")
1284 (set_attr "mode" "SI")])
1285
1286@@ -5485,7 +5494,7 @@
1287 (subreg:DI (match_operand:SI 1 "lea_address_operand" "p") 0)
1288 (match_operand:DI 2 "const_32bit_mask" "n")))]
1289 "TARGET_64BIT"
1290- "lea{l}\t{%a1, %k0|%k0, %a1}"
1291+ "lea{l}\t{%E1, %k0|%k0, %E1}"
1292 [(set_attr "type" "lea")
1293 (set_attr "mode" "SI")])
1294
1295@@ -5495,7 +5504,7 @@
1296 (match_operand:DI 1 "lea_address_operand" "p")
1297 (match_operand:DI 2 "const_32bit_mask" "n")))]
1298 "TARGET_64BIT"
1299- "lea{l}\t{%a1, %k0|%k0, %a1}"
1300+ "lea{l}\t{%E1, %k0|%k0, %E1}"
1301 [(set_attr "type" "lea")
1302 (set_attr "mode" "SI")])
1303
1304@@ -11130,10 +11139,15 @@ 1160@@ -11126,10 +11133,15 @@
1305 (set_attr "modrm" "0")]) 1161 (set_attr "modrm" "0")])
1306 1162
1307 (define_expand "indirect_jump" 1163 (define_expand "indirect_jump"
1308- [(set (pc) (match_operand 0 "indirect_branch_operand" ""))]) 1164- [(set (pc) (match_operand 0 "indirect_branch_operand" ""))])
1309+ [(set (pc) (match_operand 0 "indirect_branch_operand" ""))] 1165+ [(set (pc) (match_operand 0 "indirect_branch_operand" ""))]
1317- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))] 1173- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))]
1318+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))] 1174+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))]
1319 "" 1175 ""
1320 "jmp\t%A0" 1176 "jmp\t%A0"
1321 [(set_attr "type" "ibr") 1177 [(set_attr "type" "ibr")
1322@@ -11175,12 +11189,13 @@ 1178@@ -11171,12 +11183,13 @@
1323 operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0, 1179 operands[0] = expand_simple_binop (Pmode, code, op0, op1, NULL_RTX, 0,
1324 OPTAB_DIRECT); 1180 OPTAB_DIRECT);
1325 } 1181 }
1326- else if (TARGET_X32) 1182- else if (TARGET_X32)
1327- operands[0] = convert_memory_address (Pmode, operands[0]); 1183- operands[0] = convert_memory_address (Pmode, operands[0]);
1334- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw")) 1190- [(set (pc) (match_operand:P 0 "indirect_branch_operand" "rw"))
1335+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw")) 1191+ [(set (pc) (match_operand:W 0 "indirect_branch_operand" "rw"))
1336 (use (label_ref (match_operand 1 "" "")))] 1192 (use (label_ref (match_operand 1 "" "")))]
1337 "" 1193 ""
1338 "jmp\t%A0" 1194 "jmp\t%A0"
1339@@ -11268,7 +11283,7 @@ 1195@@ -11264,7 +11277,7 @@
1340 }) 1196 })
1341 1197
1342 (define_insn_and_split "*call_vzeroupper" 1198 (define_insn_and_split "*call_vzeroupper"
1343- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw")) 1199- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw"))
1344+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw")) 1200+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw"))
1345 (match_operand 1 "" "")) 1201 (match_operand 1 "" ""))
1346 (unspec [(match_operand 2 "const_int_operand" "")] 1202 (unspec [(match_operand 2 "const_int_operand" "")]
1347 UNSPEC_CALL_NEEDS_VZEROUPPER)] 1203 UNSPEC_CALL_NEEDS_VZEROUPPER)]
1348@@ -11280,7 +11295,7 @@ 1204@@ -11276,7 +11289,7 @@
1349 [(set_attr "type" "call")]) 1205 [(set_attr "type" "call")])
1350 1206
1351 (define_insn "*call" 1207 (define_insn "*call"
1352- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw")) 1208- [(call (mem:QI (match_operand:P 0 "call_insn_operand" "<c>zw"))
1353+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw")) 1209+ [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw"))
1354 (match_operand 1 "" ""))] 1210 (match_operand 1 "" ""))]
1355 "!SIBLING_CALL_P (insn)" 1211 "!SIBLING_CALL_P (insn)"
1356 "* return ix86_output_call_insn (insn, operands[0]);" 1212 "* return ix86_output_call_insn (insn, operands[0]);"
1357@@ -11332,7 +11347,7 @@ 1213@@ -11328,7 +11341,7 @@
1358 [(set_attr "type" "call")]) 1214 [(set_attr "type" "call")])
1359 1215
1360 (define_insn_and_split "*sibcall_vzeroupper" 1216 (define_insn_and_split "*sibcall_vzeroupper"
1361- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) 1217- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz"))
1362+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) 1218+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz"))
1363 (match_operand 1 "" "")) 1219 (match_operand 1 "" ""))
1364 (unspec [(match_operand 2 "const_int_operand" "")] 1220 (unspec [(match_operand 2 "const_int_operand" "")]
1365 UNSPEC_CALL_NEEDS_VZEROUPPER)] 1221 UNSPEC_CALL_NEEDS_VZEROUPPER)]
1366@@ -11344,7 +11359,7 @@ 1222@@ -11340,7 +11353,7 @@
1367 [(set_attr "type" "call")]) 1223 [(set_attr "type" "call")])
1368 1224
1369 (define_insn "*sibcall" 1225 (define_insn "*sibcall"
1370- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz")) 1226- [(call (mem:QI (match_operand:P 0 "sibcall_insn_operand" "Uz"))
1371+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) 1227+ [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz"))
1372 (match_operand 1 "" ""))] 1228 (match_operand 1 "" ""))]
1373 "SIBLING_CALL_P (insn)" 1229 "SIBLING_CALL_P (insn)"
1374 "* return ix86_output_call_insn (insn, operands[0]);" 1230 "* return ix86_output_call_insn (insn, operands[0]);"
1375@@ -11441,7 +11456,7 @@ 1231@@ -11437,7 +11450,7 @@
1376 1232
1377 (define_insn_and_split "*call_value_vzeroupper" 1233 (define_insn_and_split "*call_value_vzeroupper"
1378 [(set (match_operand 0 "" "") 1234 [(set (match_operand 0 "" "")
1379- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw")) 1235- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw"))
1380+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw")) 1236+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw"))
1381 (match_operand 2 "" ""))) 1237 (match_operand 2 "" "")))
1382 (unspec [(match_operand 3 "const_int_operand" "")] 1238 (unspec [(match_operand 3 "const_int_operand" "")]
1383 UNSPEC_CALL_NEEDS_VZEROUPPER)] 1239 UNSPEC_CALL_NEEDS_VZEROUPPER)]
1384@@ -11454,7 +11469,7 @@ 1240@@ -11450,7 +11463,7 @@
1385 1241
1386 (define_insn "*call_value" 1242 (define_insn "*call_value"
1387 [(set (match_operand 0 "" "") 1243 [(set (match_operand 0 "" "")
1388- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw")) 1244- (call (mem:QI (match_operand:P 1 "call_insn_operand" "<c>zw"))
1389+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw")) 1245+ (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw"))
1390 (match_operand 2 "" "")))] 1246 (match_operand 2 "" "")))]
1391 "!SIBLING_CALL_P (insn)" 1247 "!SIBLING_CALL_P (insn)"
1392 "* return ix86_output_call_insn (insn, operands[1]);" 1248 "* return ix86_output_call_insn (insn, operands[1]);"
1393@@ -11462,7 +11477,7 @@ 1249@@ -11458,7 +11471,7 @@
1394 1250
1395 (define_insn_and_split "*sibcall_value_vzeroupper" 1251 (define_insn_and_split "*sibcall_value_vzeroupper"
1396 [(set (match_operand 0 "" "") 1252 [(set (match_operand 0 "" "")
1397- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) 1253- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz"))
1398+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) 1254+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz"))
1399 (match_operand 2 "" ""))) 1255 (match_operand 2 "" "")))
1400 (unspec [(match_operand 3 "const_int_operand" "")] 1256 (unspec [(match_operand 3 "const_int_operand" "")]
1401 UNSPEC_CALL_NEEDS_VZEROUPPER)] 1257 UNSPEC_CALL_NEEDS_VZEROUPPER)]
1402@@ -11475,7 +11490,7 @@ 1258@@ -11471,7 +11484,7 @@
1403 1259
1404 (define_insn "*sibcall_value" 1260 (define_insn "*sibcall_value"
1405 [(set (match_operand 0 "" "") 1261 [(set (match_operand 0 "" "")
1406- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz")) 1262- (call (mem:QI (match_operand:P 1 "sibcall_insn_operand" "Uz"))
1407+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) 1263+ (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz"))
1408 (match_operand 2 "" "")))] 1264 (match_operand 2 "" "")))]
1409 "SIBLING_CALL_P (insn)" 1265 "SIBLING_CALL_P (insn)"
1410 "* return ix86_output_call_insn (insn, operands[1]);" 1266 "* return ix86_output_call_insn (insn, operands[1]);"
1411@@ -12580,7 +12595,7 @@ 1267@@ -12576,7 +12589,7 @@
1412 [(set (match_operand:SI 0 "register_operand" "=a") 1268 [(set (match_operand:SI 0 "register_operand" "=a")
1413 (unspec:SI 1269 (unspec:SI
1414 [(match_operand:SI 1 "register_operand" "b") 1270 [(match_operand:SI 1 "register_operand" "b")
1415- (match_operand:SI 2 "tls_symbolic_operand" "") 1271- (match_operand:SI 2 "tls_symbolic_operand" "")
1416+ (match_operand 2 "tls_symbolic_operand" "") 1272+ (match_operand 2 "tls_symbolic_operand" "")
1417 (match_operand:SI 3 "constant_call_address_operand" "z")] 1273 (match_operand:SI 3 "constant_call_address_operand" "z")]
1418 UNSPEC_TLS_GD)) 1274 UNSPEC_TLS_GD))
1419 (clobber (match_scratch:SI 4 "=d")) 1275 (clobber (match_scratch:SI 4 "=d"))
1420@@ -12589,7 +12604,7 @@
1421 "!TARGET_64BIT && TARGET_GNU_TLS"
1422 {
1423 output_asm_insn
1424- ("lea{l}\t{%a2@tlsgd(,%1,1), %0|%0, %a2@tlsgd[%1*1]}", operands);
1425+ ("lea{l}\t{%E2@tlsgd(,%1,1), %0|%0, %E2@tlsgd[%1*1]}", operands);
1426 if (TARGET_SUN_TLS)
1427 #ifdef HAVE_AS_IX86_TLSGDPLT
1428 return "call\t%a2@tlsgdplt";
1429@@ -12605,26 +12620,26 @@ 1276@@ -12601,20 +12614,20 @@
1430 [(parallel 1277 [(parallel
1431 [(set (match_operand:SI 0 "register_operand" "") 1278 [(set (match_operand:SI 0 "register_operand" "")
1432 (unspec:SI [(match_operand:SI 2 "register_operand" "") 1279 (unspec:SI [(match_operand:SI 2 "register_operand" "")
1433- (match_operand:SI 1 "tls_symbolic_operand" "") 1280- (match_operand:SI 1 "tls_symbolic_operand" "")
1434+ (match_operand 1 "tls_symbolic_operand" "") 1281+ (match_operand 1 "tls_symbolic_operand" "")
1453+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] 1300+ (unspec:P [(match_operand 1 "tls_symbolic_operand" "")]
1454+ UNSPEC_TLS_GD)] 1301+ UNSPEC_TLS_GD)]
1455 "TARGET_64BIT" 1302 "TARGET_64BIT"
1456 { 1303 {
1457 if (!TARGET_X32) 1304 if (!TARGET_X32)
1458 fputs (ASM_BYTE "0x66\n", asm_out_file);
1459 output_asm_insn
1460- ("lea{q}\t{%a1@tlsgd(%%rip), %%rdi|rdi, %a1@tlsgd[rip]}", operands);
1461+ ("lea{q}\t{%E1@tlsgd(%%rip), %%rdi|rdi, %E1@tlsgd[rip]}", operands);
1462 fputs (ASM_SHORT "0x6666\n", asm_out_file);
1463 fputs ("\trex64\n", asm_out_file);
1464 if (TARGET_SUN_TLS)
1465@@ -12635,14 +12650,15 @@ 1305@@ -12631,14 +12644,15 @@
1466 (set (attr "length") 1306 (set (attr "length")
1467 (symbol_ref "TARGET_X32 ? 15 : 16"))]) 1307 (symbol_ref "TARGET_X32 ? 15 : 16"))])
1468 1308
1469-(define_expand "tls_global_dynamic_64" 1309-(define_expand "tls_global_dynamic_64"
1470+(define_expand "tls_global_dynamic_64_<mode>" 1310+(define_expand "tls_global_dynamic_64_<mode>"
1482+ UNSPEC_TLS_GD)])] 1322+ UNSPEC_TLS_GD)])]
1483+ "TARGET_64BIT") 1323+ "TARGET_64BIT")
1484 1324
1485 (define_insn "*tls_local_dynamic_base_32_gnu" 1325 (define_insn "*tls_local_dynamic_base_32_gnu"
1486 [(set (match_operand:SI 0 "register_operand" "=a") 1326 [(set (match_operand:SI 0 "register_operand" "=a")
1487@@ -12679,12 +12695,12 @@ 1327@@ -12675,12 +12689,12 @@
1488 (clobber (match_scratch:SI 4 "")) 1328 (clobber (match_scratch:SI 4 ""))
1489 (clobber (reg:CC FLAGS_REG))])]) 1329 (clobber (reg:CC FLAGS_REG))])])
1490 1330
1491-(define_insn "*tls_local_dynamic_base_64" 1331-(define_insn "*tls_local_dynamic_base_64"
1492- [(set (match_operand:DI 0 "register_operand" "=a") 1332- [(set (match_operand:DI 0 "register_operand" "=a")
1501+ (match_operand:P 2 "" ""))) 1341+ (match_operand:P 2 "" "")))
1502+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)] 1342+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)]
1503 "TARGET_64BIT" 1343 "TARGET_64BIT"
1504 { 1344 {
1505 output_asm_insn 1345 output_asm_insn
1506@@ -12696,13 +12712,14 @@ 1346@@ -12692,13 +12706,14 @@
1507 [(set_attr "type" "multi") 1347 [(set_attr "type" "multi")
1508 (set_attr "length" "12")]) 1348 (set_attr "length" "12")])
1509 1349
1510-(define_expand "tls_local_dynamic_base_64" 1350-(define_expand "tls_local_dynamic_base_64"
1511+(define_expand "tls_local_dynamic_base_64_<mode>" 1351+(define_expand "tls_local_dynamic_base_64_<mode>"
1521+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])] 1361+ (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])]
1522+ "TARGET_64BIT") 1362+ "TARGET_64BIT")
1523 1363
1524 ;; Local dynamic of a single variable is a lose. Show combine how 1364 ;; Local dynamic of a single variable is a lose. Show combine how
1525 ;; to convert that back to global dynamic. 1365 ;; to convert that back to global dynamic.
1526@@ -12714,7 +12731,7 @@ 1366@@ -12710,7 +12725,7 @@
1527 (match_operand:SI 2 "constant_call_address_operand" "z")] 1367 (match_operand:SI 2 "constant_call_address_operand" "z")]
1528 UNSPEC_TLS_LD_BASE) 1368 UNSPEC_TLS_LD_BASE)
1529 (const:SI (unspec:SI 1369 (const:SI (unspec:SI
1530- [(match_operand:SI 3 "tls_symbolic_operand" "")] 1370- [(match_operand:SI 3 "tls_symbolic_operand" "")]
1531+ [(match_operand 3 "tls_symbolic_operand" "")] 1371+ [(match_operand 3 "tls_symbolic_operand" "")]
1532 UNSPEC_DTPOFF)))) 1372 UNSPEC_DTPOFF))))
1533 (clobber (match_scratch:SI 4 "=d")) 1373 (clobber (match_scratch:SI 4 "=d"))
1534 (clobber (match_scratch:SI 5 "=c")) 1374 (clobber (match_scratch:SI 5 "=c"))
1535@@ -12812,7 +12829,7 @@ 1375@@ -12808,7 +12823,7 @@
1536 (define_insn "tls_initial_exec_64_sun" 1376 (define_insn "tls_initial_exec_64_sun"
1537 [(set (match_operand:DI 0 "register_operand" "=a") 1377 [(set (match_operand:DI 0 "register_operand" "=a")
1538 (unspec:DI 1378 (unspec:DI
1539- [(match_operand:DI 1 "tls_symbolic_operand" "")] 1379- [(match_operand:DI 1 "tls_symbolic_operand" "")]
1540+ [(match_operand 1 "tls_symbolic_operand" "")] 1380+ [(match_operand 1 "tls_symbolic_operand" "")]
1541 UNSPEC_TLS_IE_SUN)) 1381 UNSPEC_TLS_IE_SUN))
1542 (clobber (reg:CC FLAGS_REG))] 1382 (clobber (reg:CC FLAGS_REG))]
1543 "TARGET_64BIT && TARGET_SUN_TLS" 1383 "TARGET_64BIT && TARGET_SUN_TLS"
1544@@ -12829,7 +12846,7 @@ 1384@@ -12825,7 +12840,7 @@
1545 [(set (match_dup 3) 1385 [(set (match_dup 3)
1546 (plus:SI (match_operand:SI 2 "register_operand" "") 1386 (plus:SI (match_operand:SI 2 "register_operand" "")
1547 (const:SI 1387 (const:SI
1548- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")] 1388- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")]
1549+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "")] 1389+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "")]
1550 UNSPEC_TLSDESC)))) 1390 UNSPEC_TLSDESC))))
1551 (parallel 1391 (parallel
1552 [(set (match_operand:SI 0 "register_operand" "") 1392 [(set (match_operand:SI 0 "register_operand" "")
1553@@ -12847,10 +12864,10 @@ 1393@@ -12843,7 +12858,7 @@
1554 [(set (match_operand:SI 0 "register_operand" "=r") 1394 [(set (match_operand:SI 0 "register_operand" "=r")
1555 (plus:SI (match_operand:SI 1 "register_operand" "b") 1395 (plus:SI (match_operand:SI 1 "register_operand" "b")
1556 (const:SI 1396 (const:SI
1557- (unspec:SI [(match_operand:SI 2 "tls_symbolic_operand" "")] 1397- (unspec:SI [(match_operand:SI 2 "tls_symbolic_operand" "")]
1558+ (unspec:SI [(match_operand 2 "tls_symbolic_operand" "")] 1398+ (unspec:SI [(match_operand 2 "tls_symbolic_operand" "")]
1559 UNSPEC_TLSDESC))))] 1399 UNSPEC_TLSDESC))))]
1560 "!TARGET_64BIT && TARGET_GNU2_TLS" 1400 "!TARGET_64BIT && TARGET_GNU2_TLS"
1561- "lea{l}\t{%a2@TLSDESC(%1), %0|%0, %a2@TLSDESC[%1]}"
1562+ "lea{l}\t{%E2@TLSDESC(%1), %0|%0, %E2@TLSDESC[%1]}" 1401 "lea{l}\t{%E2@TLSDESC(%1), %0|%0, %E2@TLSDESC[%1]}"
1563 [(set_attr "type" "lea")
1564 (set_attr "mode" "SI")
1565 (set_attr "length" "6")
1566@@ -12858,7 +12875,7 @@ 1402@@ -12854,7 +12869,7 @@
1567 1403
1568 (define_insn "*tls_dynamic_gnu2_call_32" 1404 (define_insn "*tls_dynamic_gnu2_call_32"
1569 [(set (match_operand:SI 0 "register_operand" "=a") 1405 [(set (match_operand:SI 0 "register_operand" "=a")
1570- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "") 1406- (unspec:SI [(match_operand:SI 1 "tls_symbolic_operand" "")
1571+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "") 1407+ (unspec:SI [(match_operand 1 "tls_symbolic_operand" "")
1572 (match_operand:SI 2 "register_operand" "0") 1408 (match_operand:SI 2 "register_operand" "0")
1573 ;; we have to make sure %ebx still points to the GOT 1409 ;; we have to make sure %ebx still points to the GOT
1574 (match_operand:SI 3 "register_operand" "b") 1410 (match_operand:SI 3 "register_operand" "b")
1575@@ -12874,13 +12891,13 @@ 1411@@ -12870,13 +12885,13 @@
1576 (define_insn_and_split "*tls_dynamic_gnu2_combine_32" 1412 (define_insn_and_split "*tls_dynamic_gnu2_combine_32"
1577 [(set (match_operand:SI 0 "register_operand" "=&a") 1413 [(set (match_operand:SI 0 "register_operand" "=&a")
1578 (plus:SI 1414 (plus:SI
1579- (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "") 1415- (unspec:SI [(match_operand:SI 3 "tls_modbase_operand" "")
1580+ (unspec:SI [(match_operand 3 "tls_modbase_operand" "") 1416+ (unspec:SI [(match_operand 3 "tls_modbase_operand" "")
1586- [(match_operand:SI 1 "tls_symbolic_operand" "")] 1422- [(match_operand:SI 1 "tls_symbolic_operand" "")]
1587+ [(match_operand 1 "tls_symbolic_operand" "")] 1423+ [(match_operand 1 "tls_symbolic_operand" "")]
1588 UNSPEC_DTPOFF)))) 1424 UNSPEC_DTPOFF))))
1589 (clobber (reg:CC FLAGS_REG))] 1425 (clobber (reg:CC FLAGS_REG))]
1590 "!TARGET_64BIT && TARGET_GNU2_TLS" 1426 "!TARGET_64BIT && TARGET_GNU2_TLS"
1591@@ -12912,7 +12929,7 @@
1592 (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")]
1593 UNSPEC_TLSDESC))]
1594 "TARGET_64BIT && TARGET_GNU2_TLS"
1595- "lea{q}\t{%a1@TLSDESC(%%rip), %0|%0, %a1@TLSDESC[rip]}"
1596+ "lea{q}\t{%E1@TLSDESC(%%rip), %0|%0, %E1@TLSDESC[rip]}"
1597 [(set_attr "type" "lea")
1598 (set_attr "mode" "DI")
1599 (set_attr "length" "7")
1600@@ -12934,7 +12951,7 @@ 1427@@ -12930,7 +12945,7 @@
1601 (define_insn_and_split "*tls_dynamic_gnu2_combine_64" 1428 (define_insn_and_split "*tls_dynamic_gnu2_combine_64"
1602 [(set (match_operand:DI 0 "register_operand" "=&a") 1429 [(set (match_operand:DI 0 "register_operand" "=&a")
1603 (plus:DI 1430 (plus:DI
1604- (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "") 1431- (unspec:DI [(match_operand:DI 2 "tls_modbase_operand" "")
1605+ (unspec:DI [(match_operand 2 "tls_modbase_operand" "") 1432+ (unspec:DI [(match_operand 2 "tls_modbase_operand" "")
1606 (match_operand:DI 3 "" "") 1433 (match_operand:DI 3 "" "")
1607 (reg:DI SP_REG)] 1434 (reg:DI SP_REG)]
1608 UNSPEC_TLSDESC) 1435 UNSPEC_TLSDESC)
1609@@ -15733,17 +15750,17 @@ 1436@@ -15729,17 +15744,17 @@
1610 "ix86_current_function_needs_cld = 1;") 1437 "ix86_current_function_needs_cld = 1;")
1611 1438
1612 (define_insn "*strmovdi_rex_1" 1439 (define_insn "*strmovdi_rex_1"
1613- [(set (mem:DI (match_operand:DI 2 "register_operand" "0")) 1440- [(set (mem:DI (match_operand:DI 2 "register_operand" "0"))
1614- (mem:DI (match_operand:DI 3 "register_operand" "1"))) 1441- (mem:DI (match_operand:DI 3 "register_operand" "1")))
1631- "movsq" 1458- "movsq"
1632+ "%^movsq" 1459+ "%^movsq"
1633 [(set_attr "type" "str") 1460 [(set_attr "type" "str")
1634 (set_attr "memory" "both") 1461 (set_attr "memory" "both")
1635 (set_attr "mode" "DI")]) 1462 (set_attr "mode" "DI")])
1636@@ -15758,7 +15775,7 @@ 1463@@ -15754,7 +15769,7 @@
1637 (plus:P (match_dup 3) 1464 (plus:P (match_dup 3)
1638 (const_int 4)))] 1465 (const_int 4)))]
1639 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1466 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1640- "movs{l|d}" 1467- "movs{l|d}"
1641+ "%^movs{l|d}" 1468+ "%^movs{l|d}"
1642 [(set_attr "type" "str") 1469 [(set_attr "type" "str")
1643 (set_attr "memory" "both") 1470 (set_attr "memory" "both")
1644 (set_attr "mode" "SI")]) 1471 (set_attr "mode" "SI")])
1645@@ -15773,7 +15790,7 @@ 1472@@ -15769,7 +15784,7 @@
1646 (plus:P (match_dup 3) 1473 (plus:P (match_dup 3)
1647 (const_int 2)))] 1474 (const_int 2)))]
1648 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1475 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1649- "movsw" 1476- "movsw"
1650+ "%^movsw" 1477+ "%^movsw"
1651 [(set_attr "type" "str") 1478 [(set_attr "type" "str")
1652 (set_attr "memory" "both") 1479 (set_attr "memory" "both")
1653 (set_attr "mode" "HI")]) 1480 (set_attr "mode" "HI")])
1654@@ -15788,7 +15805,7 @@ 1481@@ -15784,7 +15799,7 @@
1655 (plus:P (match_dup 3) 1482 (plus:P (match_dup 3)
1656 (const_int 1)))] 1483 (const_int 1)))]
1657 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1484 "!(fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1658- "movsb" 1485- "movsb"
1659+ "%^movsb" 1486+ "%^movsb"
1660 [(set_attr "type" "str") 1487 [(set_attr "type" "str")
1661 (set_attr "memory" "both") 1488 (set_attr "memory" "both")
1662 (set (attr "prefix_rex") 1489 (set (attr "prefix_rex")
1663@@ -15811,20 +15828,20 @@ 1490@@ -15807,20 +15822,20 @@
1664 "ix86_current_function_needs_cld = 1;") 1491 "ix86_current_function_needs_cld = 1;")
1665 1492
1666 (define_insn "*rep_movdi_rex64" 1493 (define_insn "*rep_movdi_rex64"
1667- [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0)) 1494- [(set (match_operand:DI 2 "register_operand" "=c") (const_int 0))
1668- (set (match_operand:DI 0 "register_operand" "=D") 1495- (set (match_operand:DI 0 "register_operand" "=D")
1688- "rep{%;} movsq" 1515- "rep{%;} movsq"
1689+ "%^rep{%;} movsq" 1516+ "%^rep{%;} movsq"
1690 [(set_attr "type" "str") 1517 [(set_attr "type" "str")
1691 (set_attr "prefix_rep" "1") 1518 (set_attr "prefix_rep" "1")
1692 (set_attr "memory" "both") 1519 (set_attr "memory" "both")
1693@@ -15843,7 +15860,7 @@ 1520@@ -15839,7 +15854,7 @@
1694 (mem:BLK (match_dup 4))) 1521 (mem:BLK (match_dup 4)))
1695 (use (match_dup 5))] 1522 (use (match_dup 5))]
1696 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1523 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1697- "rep{%;} movs{l|d}" 1524- "rep{%;} movs{l|d}"
1698+ "%^rep{%;} movs{l|d}" 1525+ "%^rep{%;} movs{l|d}"
1699 [(set_attr "type" "str") 1526 [(set_attr "type" "str")
1700 (set_attr "prefix_rep" "1") 1527 (set_attr "prefix_rep" "1")
1701 (set_attr "memory" "both") 1528 (set_attr "memory" "both")
1702@@ -15860,7 +15877,7 @@ 1529@@ -15856,7 +15871,7 @@
1703 (mem:BLK (match_dup 4))) 1530 (mem:BLK (match_dup 4)))
1704 (use (match_dup 5))] 1531 (use (match_dup 5))]
1705 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1532 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1706- "rep{%;} movsb" 1533- "rep{%;} movsb"
1707+ "%^rep{%;} movsb" 1534+ "%^rep{%;} movsb"
1708 [(set_attr "type" "str") 1535 [(set_attr "type" "str")
1709 (set_attr "prefix_rep" "1") 1536 (set_attr "prefix_rep" "1")
1710 (set_attr "memory" "both") 1537 (set_attr "memory" "both")
1711@@ -15921,14 +15938,14 @@ 1538@@ -15917,14 +15932,14 @@
1712 "ix86_current_function_needs_cld = 1;") 1539 "ix86_current_function_needs_cld = 1;")
1713 1540
1714 (define_insn "*strsetdi_rex_1" 1541 (define_insn "*strsetdi_rex_1"
1715- [(set (mem:DI (match_operand:DI 1 "register_operand" "0")) 1542- [(set (mem:DI (match_operand:DI 1 "register_operand" "0"))
1716+ [(set (mem:DI (match_operand:P 1 "register_operand" "0")) 1543+ [(set (mem:DI (match_operand:P 1 "register_operand" "0"))
1726- "stosq" 1553- "stosq"
1727+ "%^stosq" 1554+ "%^stosq"
1728 [(set_attr "type" "str") 1555 [(set_attr "type" "str")
1729 (set_attr "memory" "store") 1556 (set_attr "memory" "store")
1730 (set_attr "mode" "DI")]) 1557 (set_attr "mode" "DI")])
1731@@ -15940,7 +15957,7 @@ 1558@@ -15936,7 +15951,7 @@
1732 (plus:P (match_dup 1) 1559 (plus:P (match_dup 1)
1733 (const_int 4)))] 1560 (const_int 4)))]
1734 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" 1561 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
1735- "stos{l|d}" 1562- "stos{l|d}"
1736+ "%^stos{l|d}" 1563+ "%^stos{l|d}"
1737 [(set_attr "type" "str") 1564 [(set_attr "type" "str")
1738 (set_attr "memory" "store") 1565 (set_attr "memory" "store")
1739 (set_attr "mode" "SI")]) 1566 (set_attr "mode" "SI")])
1740@@ -15952,7 +15969,7 @@ 1567@@ -15948,7 +15963,7 @@
1741 (plus:P (match_dup 1) 1568 (plus:P (match_dup 1)
1742 (const_int 2)))] 1569 (const_int 2)))]
1743 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" 1570 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
1744- "stosw" 1571- "stosw"
1745+ "%^stosw" 1572+ "%^stosw"
1746 [(set_attr "type" "str") 1573 [(set_attr "type" "str")
1747 (set_attr "memory" "store") 1574 (set_attr "memory" "store")
1748 (set_attr "mode" "HI")]) 1575 (set_attr "mode" "HI")])
1749@@ -15964,7 +15981,7 @@ 1576@@ -15960,7 +15975,7 @@
1750 (plus:P (match_dup 1) 1577 (plus:P (match_dup 1)
1751 (const_int 1)))] 1578 (const_int 1)))]
1752 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])" 1579 "!(fixed_regs[AX_REG] || fixed_regs[DI_REG])"
1753- "stosb" 1580- "stosb"
1754+ "%^stosb" 1581+ "%^stosb"
1755 [(set_attr "type" "str") 1582 [(set_attr "type" "str")
1756 (set_attr "memory" "store") 1583 (set_attr "memory" "store")
1757 (set (attr "prefix_rex") 1584 (set (attr "prefix_rex")
1758@@ -15985,18 +16002,18 @@ 1585@@ -15981,18 +15996,18 @@
1759 "ix86_current_function_needs_cld = 1;") 1586 "ix86_current_function_needs_cld = 1;")
1760 1587
1761 (define_insn "*rep_stosdi_rex64" 1588 (define_insn "*rep_stosdi_rex64"
1762- [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0)) 1589- [(set (match_operand:DI 1 "register_operand" "=c") (const_int 0))
1763- (set (match_operand:DI 0 "register_operand" "=D") 1590- (set (match_operand:DI 0 "register_operand" "=D")
1778- "rep{%;} stosq" 1605- "rep{%;} stosq"
1779+ "%^rep{%;} stosq" 1606+ "%^rep{%;} stosq"
1780 [(set_attr "type" "str") 1607 [(set_attr "type" "str")
1781 (set_attr "prefix_rep" "1") 1608 (set_attr "prefix_rep" "1")
1782 (set_attr "memory" "store") 1609 (set_attr "memory" "store")
1783@@ -16013,7 +16030,7 @@ 1610@@ -16009,7 +16024,7 @@
1784 (use (match_operand:SI 2 "register_operand" "a")) 1611 (use (match_operand:SI 2 "register_operand" "a"))
1785 (use (match_dup 4))] 1612 (use (match_dup 4))]
1786 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" 1613 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
1787- "rep{%;} stos{l|d}" 1614- "rep{%;} stos{l|d}"
1788+ "%^rep{%;} stos{l|d}" 1615+ "%^rep{%;} stos{l|d}"
1789 [(set_attr "type" "str") 1616 [(set_attr "type" "str")
1790 (set_attr "prefix_rep" "1") 1617 (set_attr "prefix_rep" "1")
1791 (set_attr "memory" "store") 1618 (set_attr "memory" "store")
1792@@ -16029,7 +16046,7 @@ 1619@@ -16025,7 +16040,7 @@
1793 (use (match_operand:QI 2 "register_operand" "a")) 1620 (use (match_operand:QI 2 "register_operand" "a"))
1794 (use (match_dup 4))] 1621 (use (match_dup 4))]
1795 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" 1622 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
1796- "rep{%;} stosb" 1623- "rep{%;} stosb"
1797+ "%^rep{%;} stosb" 1624+ "%^rep{%;} stosb"
1798 [(set_attr "type" "str") 1625 [(set_attr "type" "str")
1799 (set_attr "prefix_rep" "1") 1626 (set_attr "prefix_rep" "1")
1800 (set_attr "memory" "store") 1627 (set_attr "memory" "store")
1801@@ -16150,7 +16167,7 @@ 1628@@ -16146,7 +16161,7 @@
1802 (clobber (match_operand:P 1 "register_operand" "=D")) 1629 (clobber (match_operand:P 1 "register_operand" "=D"))
1803 (clobber (match_operand:P 2 "register_operand" "=c"))] 1630 (clobber (match_operand:P 2 "register_operand" "=c"))]
1804 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1631 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1805- "repz{%;} cmpsb" 1632- "repz{%;} cmpsb"
1806+ "%^repz{%;} cmpsb" 1633+ "%^repz{%;} cmpsb"
1807 [(set_attr "type" "str") 1634 [(set_attr "type" "str")
1808 (set_attr "mode" "QI") 1635 (set_attr "mode" "QI")
1809 (set (attr "prefix_rex") 1636 (set (attr "prefix_rex")
1810@@ -16190,7 +16207,7 @@ 1637@@ -16186,7 +16201,7 @@
1811 (clobber (match_operand:P 1 "register_operand" "=D")) 1638 (clobber (match_operand:P 1 "register_operand" "=D"))
1812 (clobber (match_operand:P 2 "register_operand" "=c"))] 1639 (clobber (match_operand:P 2 "register_operand" "=c"))]
1813 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])" 1640 "!(fixed_regs[CX_REG] || fixed_regs[SI_REG] || fixed_regs[DI_REG])"
1814- "repz{%;} cmpsb" 1641- "repz{%;} cmpsb"
1815+ "%^repz{%;} cmpsb" 1642+ "%^repz{%;} cmpsb"
1816 [(set_attr "type" "str") 1643 [(set_attr "type" "str")
1817 (set_attr "mode" "QI") 1644 (set_attr "mode" "QI")
1818 (set (attr "prefix_rex") 1645 (set (attr "prefix_rex")
1819@@ -16231,7 +16248,7 @@ 1646@@ -16227,7 +16242,7 @@
1820 (clobber (match_operand:P 1 "register_operand" "=D")) 1647 (clobber (match_operand:P 1 "register_operand" "=D"))
1821 (clobber (reg:CC FLAGS_REG))] 1648 (clobber (reg:CC FLAGS_REG))]
1822 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])" 1649 "!(fixed_regs[AX_REG] || fixed_regs[CX_REG] || fixed_regs[DI_REG])"
1823- "repnz{%;} scasb" 1650- "repnz{%;} scasb"
1824+ "%^repnz{%;} scasb" 1651+ "%^repnz{%;} scasb"
1825 [(set_attr "type" "str") 1652 [(set_attr "type" "str")
1826 (set_attr "mode" "QI") 1653 (set_attr "mode" "QI")
1827 (set (attr "prefix_rex") 1654 (set (attr "prefix_rex")
1828@@ -16663,7 +16680,7 @@
1829
1830 default:
1831 operands[2] = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
1832- return "lea{<imodesuffix>}\t{%a2, %0|%0, %a2}";
1833+ return "lea{<imodesuffix>}\t{%E2, %0|%0, %E2}";
1834 }
1835 }
1836 [(set (attr "type")
1837@@ -17391,131 +17408,131 @@ 1655@@ -17372,131 +17387,131 @@
1838 ;; alternative when no register is available later. 1656 ;; alternative when no register is available later.
1839 1657
1840 (define_peephole2 1658 (define_peephole2
1841- [(match_scratch:P 1 "r") 1659- [(match_scratch:P 1 "r")
1842+ [(match_scratch:W 1 "r") 1660+ [(match_scratch:W 1 "r")
2002+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG)))) 1820+ [(set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))
2003+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))]) 1821+ (set (match_dup 1) (mem:W (post_inc:P (reg:P SP_REG))))])
2004 1822
2005 ;; Convert compares with 1 to shorter inc/dec operations when CF is not 1823 ;; Convert compares with 1 to shorter inc/dec operations when CF is not
2006 ;; required and register dies. Similarly for 128 to -128. 1824 ;; required and register dies. Similarly for 128 to -128.
2007@@ -17626,7 +17643,7 @@ 1825@@ -17607,7 +17622,7 @@
2008 ;; leal (%edx,%eax,4), %eax 1826 ;; leal (%edx,%eax,4), %eax
2009 1827
2010 (define_peephole2 1828 (define_peephole2
2011- [(match_scratch:P 5 "r") 1829- [(match_scratch:P 5 "r")
2012+ [(match_scratch:W 5 "r") 1830+ [(match_scratch:W 5 "r")
2013 (parallel [(set (match_operand 0 "register_operand" "") 1831 (parallel [(set (match_operand 0 "register_operand" "")
2014 (ashift (match_operand 1 "register_operand" "") 1832 (ashift (match_operand 1 "register_operand" "")
2015 (match_operand 2 "const_int_operand" ""))) 1833 (match_operand 2 "const_int_operand" "")))
2016@@ -17652,16 +17669,16 @@ 1834@@ -17633,16 +17648,16 @@
2017 enum machine_mode op1mode = GET_MODE (operands[1]); 1835 enum machine_mode op1mode = GET_MODE (operands[1]);
2018 enum machine_mode mode = op1mode == DImode ? DImode : SImode; 1836 enum machine_mode mode = op1mode == DImode ? DImode : SImode;
2019 int scale = 1 << INTVAL (operands[2]); 1837 int scale = 1 << INTVAL (operands[2]);
2020- rtx index = gen_lowpart (Pmode, operands[1]); 1838- rtx index = gen_lowpart (Pmode, operands[1]);
2021- rtx base = gen_lowpart (Pmode, operands[5]); 1839- rtx base = gen_lowpart (Pmode, operands[5]);
2034- if (op1mode != Pmode) 1852- if (op1mode != Pmode)
2035+ if (op1mode != word_mode) 1853+ if (op1mode != word_mode)
2036 operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0); 1854 operands[5] = gen_rtx_SUBREG (op1mode, operands[5], 0);
2037 operands[0] = dest; 1855 operands[0] = dest;
2038 }) 1856 })
2039@@ -18052,7 +18069,7 @@ 1857@@ -18033,7 +18048,7 @@
2040 { 1858 {
2041 rtx (*insn)(rtx); 1859 rtx (*insn)(rtx);
2042 1860
2043- insn = (TARGET_64BIT 1861- insn = (TARGET_64BIT
2044+ insn = (Pmode == DImode 1862+ insn = (Pmode == DImode
2105 Do not support SSE4.1 and SSE4.2 built-in functions and code generation 1923 Do not support SSE4.1 and SSE4.2 built-in functions and code generation
2106 1924
2107 msse5 1925 msse5
2108--- a/gcc/config/i386/predicates.md 1926--- a/gcc/config/i386/predicates.md
2109+++ b/gcc/config/i386/predicates.md 1927+++ b/gcc/config/i386/predicates.md
2110@@ -1,5 +1,5 @@
2111 ;; Predicate definitions for IA-32 and x86-64.
2112-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
2113+;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
2114 ;; Free Software Foundation, Inc.
2115 ;;
2116 ;; This file is part of GCC.
2117@@ -341,6 +341,16 @@ 1928@@ -341,6 +341,16 @@
2118 (match_operand 0 "general_operand"))) 1929 (match_operand 0 "general_operand")))
2119 1930
2120 ;; Return true if OP is general operand representable on x86_64 1931 ;; Return true if OP is general operand representable on x86_64
2121+;; as zero extended constant. This predicate is used in zero-extending 1932+;; as zero extended constant. This predicate is used in zero-extending
2176 (match_operand 0 "register_no_elim_operand"))) 1987 (match_operand 0 "register_no_elim_operand")))
2177 1988
2178 ;; Match exactly zero. 1989 ;; Match exactly zero.
2179--- a/gcc/config/i386/sse.md 1990--- a/gcc/config/i386/sse.md
2180+++ b/gcc/config/i386/sse.md 1991+++ b/gcc/config/i386/sse.md
2181@@ -8126,8 +8126,8 @@ 1992@@ -8054,8 +8054,8 @@
2182 "monitor\t%0, %1, %2" 1993 "monitor\t%0, %1, %2"
2183 [(set_attr "length" "3")]) 1994 [(set_attr "length" "3")])
2184 1995
2185-(define_insn "sse3_monitor64" 1996-(define_insn "sse3_monitor64"
2186- [(unspec_volatile [(match_operand:DI 0 "register_operand" "a") 1997- [(unspec_volatile [(match_operand:DI 0 "register_operand" "a")
2307 Generate GFLOAT double precision code 2118 Generate GFLOAT double precision code
2308 2119
2309 mgnu 2120 mgnu
2310--- a/gcc/configure 2121--- a/gcc/configure
2311+++ b/gcc/configure 2122+++ b/gcc/configure
2312@@ -13756,7 +13756,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 2123@@ -13796,7 +13796,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2313 LD="${LD-ld} -m elf_i386_fbsd" 2124 LD="${LD-ld} -m elf_i386_fbsd"
2314 ;; 2125 ;;
2315 x86_64-*linux*) 2126 x86_64-*linux*)
2316- LD="${LD-ld} -m elf_i386" 2127- LD="${LD-ld} -m elf_i386"
2317+ case `/usr/bin/file conftest.o` in 2128+ case `/usr/bin/file conftest.o` in
2325 ;; 2136 ;;
2326 ppc64-*linux*|powerpc64-*linux*) 2137 ppc64-*linux*|powerpc64-*linux*)
2327 LD="${LD-ld} -m elf32ppclinux" 2138 LD="${LD-ld} -m elf32ppclinux"
2328--- a/gcc/doc/invoke.texi 2139--- a/gcc/doc/invoke.texi
2329+++ b/gcc/doc/invoke.texi 2140+++ b/gcc/doc/invoke.texi
2330@@ -636,7 +636,7 @@ Objective-C and Objective-C++ Dialects}. 2141@@ -637,7 +637,7 @@ Objective-C and Objective-C++ Dialects}.
2331 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol 2142 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
2332 -mpc32 -mpc64 -mpc80 -mstackrealign @gol 2143 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
2333 -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol 2144 -momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol
2334--mcmodel=@var{code-model} -mabi=@var{name} @gol 2145--mcmodel=@var{code-model} -mabi=@var{name} @gol
2335+-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol 2146+-mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
2336 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol 2147 -m32 -m64 -mx32 -mlarge-data-threshold=@var{num} @gol
2337 -msse2avx -mfentry -m8bit-idiv @gol 2148 -msse2avx -mfentry -m8bit-idiv @gol
2338 -mavx256-split-unaligned-load -mavx256-split-unaligned-store} 2149 -mavx256-split-unaligned-load -mavx256-split-unaligned-store}
2150@@ -13548,6 +13548,12 @@ Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
2151 byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
2152 the default is 4 (16 bytes or 128 bits).
2153
2154+@strong{Warning:} When generating code for the x86-64 architecture with
2155+SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
2156+used to keep the stack boundary aligned to 8 byte boundary. You must
2157+build all modules with @option{-mpreferred-stack-boundary=3}, including
2158+any libraries. This includes the system libraries and startup modules.
2159+
2160 @item -mincoming-stack-boundary=@var{num}
2161 @opindex mincoming-stack-boundary
2162 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
2339@@ -13763,6 +13763,18 @@ be statically or dynamically linked. 2163@@ -13941,6 +13947,18 @@ be statically or dynamically linked.
2340 @opindex mcmodel=large 2164 @opindex mcmodel=large
2341 Generate code for the large model: This model makes no assumptions 2165 Generate code for the large model: This model makes no assumptions
2342 about addresses and sizes of sections. 2166 about addresses and sizes of sections.
2343+ 2167+
2344+@item -maddress-mode=long 2168+@item -maddress-mode=long
2382 @item Enum(@var{name}) 2206 @item Enum(@var{name})
2383 The option's argument is a string from the set of strings associated 2207 The option's argument is a string from the set of strings associated
2384 with the corresponding @samp{Enum} record. The string is checked and 2208 with the corresponding @samp{Enum} record. The string is checked and
2385--- a/gcc/dwarf2out.c 2209--- a/gcc/dwarf2out.c
2386+++ b/gcc/dwarf2out.c 2210+++ b/gcc/dwarf2out.c
2387@@ -10178,7 +10178,9 @@ dbx_reg_number (const_rtx rtl) 2211@@ -10181,7 +10181,9 @@ dbx_reg_number (const_rtx rtl)
2388 } 2212 }
2389 #endif 2213 #endif
2390 2214
2391- return DBX_REGISTER_NUMBER (regno); 2215- return DBX_REGISTER_NUMBER (regno);
2392+ regno = DBX_REGISTER_NUMBER (regno); 2216+ regno = DBX_REGISTER_NUMBER (regno);
2393+ gcc_assert (regno != INVALID_REGNUM); 2217+ gcc_assert (regno != INVALID_REGNUM);
2394+ return regno; 2218+ return regno;
2395 } 2219 }
2396 2220
2397 /* Optionally add a DW_OP_piece term to a location description expression. 2221 /* Optionally add a DW_OP_piece term to a location description expression.
2222@@ -11669,6 +11671,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
2223 case REG:
2224 if (GET_MODE_CLASS (mode) != MODE_INT
2225 || (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE
2226+ && rtl != arg_pointer_rtx
2227+ && rtl != frame_pointer_rtx
2228 #ifdef POINTERS_EXTEND_UNSIGNED
2229 && (mode != Pmode || mem_mode == VOIDmode)
2230 #endif
2231@@ -11941,7 +11945,9 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
2232 case PLUS:
2233 plus:
2234 if (is_based_loc (rtl)
2235- && GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE
2236+ && (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE
2237+ || XEXP (rtl, 0) == arg_pointer_rtx
2238+ || XEXP (rtl, 0) == frame_pointer_rtx)
2239 && GET_MODE_CLASS (mode) == MODE_INT)
2240 mem_loc_result = based_loc_descr (XEXP (rtl, 0),
2241 INTVAL (XEXP (rtl, 1)),
2398--- a/gcc/emit-rtl.c 2242--- a/gcc/emit-rtl.c
2399+++ b/gcc/emit-rtl.c 2243+++ b/gcc/emit-rtl.c
2400@@ -964,6 +964,22 @@ void 2244@@ -964,6 +964,22 @@ void
2401 set_reg_attrs_from_value (rtx reg, rtx x) 2245 set_reg_attrs_from_value (rtx reg, rtx x)
2402 { 2246 {
2569 } 2413 }
2570 2414
2571-/* { dg-final { scan-assembler-not "-18874240" } } */ 2415-/* { dg-final { scan-assembler-not "-18874240" } } */
2572+/* { dg-final { scan-assembler-not "\[,\\t \]+-18874240" } } */ 2416+/* { dg-final { scan-assembler-not "\[,\\t \]+-18874240" } } */
2573--- /dev/null 2417--- /dev/null
2418+++ b/gcc/testsuite/gcc.target/i386/pr52857-1.c
2419@@ -0,0 +1,10 @@
2420+/* { dg-do compile { target { ! { ia32 } } } } */
2421+/* { dg-options "-g -O -mx32 -maddress-mode=long" } */
2422+
2423+extern void get_BID128 (int *);
2424+void
2425+__bid128_div (void)
2426+{
2427+ int res;
2428+ get_BID128 (&res);
2429+}
2430--- /dev/null
2431+++ b/gcc/testsuite/gcc.target/i386/pr52857-2.c
2432@@ -0,0 +1,8 @@
2433+/* { dg-do compile { target { ! { ia32 } } } } */
2434+/* { dg-options "-g -O -mx32 -maddress-mode=long" } */
2435+
2436+void uw_init_context_1 (void *);
2437+void _Unwind_ForcedUnwind (void)
2438+{
2439+ uw_init_context_1 (__builtin_dwarf_cfa ());
2440+}
2441--- /dev/null
2574+++ b/gcc/testsuite/gcc.target/i386/pr52876.c 2442+++ b/gcc/testsuite/gcc.target/i386/pr52876.c
2575@@ -0,0 +1,25 @@ 2443@@ -0,0 +1,25 @@
2576+/* { dg-do run { target { x32 } } } */ 2444+/* { dg-do run { target { x32 } } } */
2577+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */ 2445+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */
2578+ 2446+
2646+ m = l * a; 2514+ m = l * a;
2647+ h[0] = m <= i; 2515+ h[0] = m <= i;
2648+ } else 2516+ } else
2649+ i = g[c]; 2517+ i = g[c];
2650+} 2518+}
2519--- a/gcc/testsuite/gcc.target/i386/pr54157.c
2520+++ b/gcc/testsuite/gcc.target/i386/pr54157.c
2521@@ -1,5 +1,5 @@
2522 /* { dg-do compile { target { ! { ia32 } } } } */
2523-/* { dg-options "-O2 -mx32 -ftree-vectorize" } */
2524+/* { dg-options "-O2 -mx32 -maddress-mode=long -ftree-vectorize" } */
2525
2526 struct s2{
2527 int n[24 -1][24 -1][24 -1];
2651--- a/libffi/configure 2528--- a/libffi/configure
2652+++ b/libffi/configure 2529+++ b/libffi/configure
2653@@ -6282,7 +6282,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 2530@@ -6282,7 +6282,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2654 LD="${LD-ld} -m elf_i386_fbsd" 2531 LD="${LD-ld} -m elf_i386_fbsd"
2655 ;; 2532 ;;
2700 /* We don't have to do anything in asm for the return. */ 2577 /* We don't have to do anything in asm for the return. */
2701 ret = FFI_TYPE_VOID; 2578 ret = FFI_TYPE_VOID;
2702 } 2579 }
2703--- a/libffi/src/x86/ffitarget.h 2580--- a/libffi/src/x86/ffitarget.h
2704+++ b/libffi/src/x86/ffitarget.h 2581+++ b/libffi/src/x86/ffitarget.h
2705@@ -53,9 +53,15 @@ typedef unsigned long long ffi_arg; 2582@@ -53,9 +53,16 @@ typedef unsigned long long ffi_arg;
2706 typedef long long ffi_sarg; 2583 typedef long long ffi_sarg;
2707 #endif 2584 #endif
2708 #else 2585 #else
2709+#if defined __x86_64__ && !defined __LP64__ 2586+#if defined __x86_64__ && defined __ILP32__
2710+#define FFI_SIZEOF_ARG 8 2587+#define FFI_SIZEOF_ARG 8
2588+#define FFI_SIZEOF_JAVA_RAW 4
2711+typedef unsigned long long ffi_arg; 2589+typedef unsigned long long ffi_arg;
2712+typedef long long ffi_sarg; 2590+typedef long long ffi_sarg;
2713+#else 2591+#else
2714 typedef unsigned long ffi_arg; 2592 typedef unsigned long ffi_arg;
2715 typedef signed long ffi_sarg; 2593 typedef signed long ffi_sarg;
2840+ ;; 2718+ ;;
2841+ esac 2719+ esac
2842 ;; 2720 ;;
2843 ppc64-*linux*|powerpc64-*linux*) 2721 ppc64-*linux*|powerpc64-*linux*)
2844 LD="${LD-ld} -m elf32ppclinux" 2722 LD="${LD-ld} -m elf32ppclinux"
2723--- a/libjava/include/x86_64-signal.h
2724+++ b/libjava/include/x86_64-signal.h
2725@@ -47,6 +47,10 @@ do \
2726 \
2727 bool _is_64_bit = false; \
2728 \
2729+ /* Skip 67h address size prefix. */ \
2730+ if (_rip[0] == 0x67) \
2731+ _rip++; \
2732+ \
2733 if ((_rip[0] & 0xf0) == 0x40) /* REX byte present. */ \
2734 { \
2735 unsigned char _rex = _rip[0] & 0x0f; \
2736@@ -64,10 +68,10 @@ do \
2737 { \
2738 if (_is_64_bit) \
2739 _min_value_dividend = \
2740- _gregs[REG_RAX] == (greg_t)0x8000000000000000UL; \
2741+ _gregs[REG_RAX] == (greg_t)0x8000000000000000ULL; \
2742 else \
2743 _min_value_dividend = \
2744- (_gregs[REG_RAX] & 0xffffffff) == (greg_t)0x80000000UL; \
2745+ (_gregs[REG_RAX] & 0xffffffff) == (greg_t)0x80000000ULL; \
2746 } \
2747 \
2748 if (_min_value_dividend) \
2845--- a/libmudflap/configure 2749--- a/libmudflap/configure
2846+++ b/libmudflap/configure 2750+++ b/libmudflap/configure
2847@@ -6393,7 +6393,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 2751@@ -6393,7 +6393,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2848 LD="${LD-ld} -m elf_i386_fbsd" 2752 LD="${LD-ld} -m elf_i386_fbsd"
2849 ;; 2753 ;;
2914 ;; 2818 ;;
2915 ppc64-*linux*|powerpc64-*linux*) 2819 ppc64-*linux*|powerpc64-*linux*)
2916 LD="${LD-ld} -m elf32ppclinux" 2820 LD="${LD-ld} -m elf32ppclinux"
2917--- a/libstdc++-v3/configure 2821--- a/libstdc++-v3/configure
2918+++ b/libstdc++-v3/configure 2822+++ b/libstdc++-v3/configure
2823@@ -3025,8 +3025,7 @@ test -n "$target_alias" &&
2824 target_alias=${target_alias-$host_alias}
2825
2826 # Handy for debugging:
2827-{ $as_echo "$as_me:${as_lineno-$LINENO}: $build / $host / $target / $host_alias / $target_alias" >&5
2828-$as_echo "$as_me: $build / $host / $target / $host_alias / $target_alias" >&6;}; sleep 5
2829+#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
2830
2831 if test "$build" != "$host"; then
2832 # We are being configured with some form of cross compiler.
2919@@ -7120,7 +7119,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) 2833@@ -7120,7 +7119,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
2920 LD="${LD-ld} -m elf_i386_fbsd" 2834 LD="${LD-ld} -m elf_i386_fbsd"
2921 ;; 2835 ;;
2922 x86_64-*linux*) 2836 x86_64-*linux*)
2923- LD="${LD-ld} -m elf_i386" 2837- LD="${LD-ld} -m elf_i386"

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20