Commit Graph

956 Commits

Author SHA1 Message Date
H.J. Lu 1984fccf0b i386: Align stack frame if argument is passed on stack
When a function call is removed, it may become a leaf function.  But if
argument may be passed on stack, we need to align the stack frame when
there is no tail call.

Tested on Linux/i686 and Linux/x86-64.

gcc/

	Backport from mainline
	PR target/83330
	* config/i386/i386.c (ix86_function_arg_advance): Set
	outgoing_args_on_stack to true if there are outgoing arguments
	on stack.
	(ix86_function_arg): Likewise.
	(ix86_compute_frame_layout): Align stack frame if argument is
	passed on stack.
	* config/i386/i386.h (machine_function): Add
	outgoing_args_on_stack.

gcc/testsuite/

	Backport from mainline
	PR target/83330
	* gcc.target/i386/pr83330.c: New test.

From-SVN: r256703
2018-01-15 08:13:23 -08:00
H.J. Lu 37d3afcae7 i386: Move struct ix86_frame to machine_function
Make ix86_frame available to i386 code generation.  This is needed to
backport the patch set of -mindirect-branch= to mitigate variant #2 of
the speculative execution vulnerabilities on x86 processors identified
by CVE-2017-5715, aka Spectre.

	Backport from mainline
	* config/i386/i386.c (ix86_frame): Moved to ...
	* config/i386/i386.h (ix86_frame): Here.
	(machine_function): Add frame.
	* config/i386/i386.c (ix86_compute_frame_layout): Repace the
	frame argument with &cfun->machine->frame.
	(ix86_can_use_return_insn_p): Don't pass &frame to
	ix86_compute_frame_layout.  Copy frame from cfun->machine->frame.
	(ix86_can_eliminate): Likewise.
	(ix86_expand_prologue): Likewise.
	(ix86_expand_epilogue): Likewise.
	(ix86_expand_split_stack_prologue): Likewise.

From-SVN: r256691
2018-01-15 03:27:24 -08:00
Sebastian Peryt 2df7463a7a Fix PR82941 and PR82942 by adding proper vzeroupper generation on SKX.
Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
be inserted before a transfer of control flow out of the function.  It is
turned on by default unless we are tuning for KNL.  Users can always use
-mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.

2017-12-04  Sebastian Peryt  <sebastian.peryt@intel.com>
	H.J. Lu  <hongjiu.lu@intel.com>

gcc/
	Bakcported from trunk
	PR target/82941
	PR target/82942
	PR target/82990
	* config/i386/i386.c (pass_insert_vzeroupper): Remove
	TARGET_AVX512F check from gate condition.
	(ix86_check_avx256_register): Changed to ...
	(ix86_check_avx_upper_register): ... this. Add extra check for
	VALID_AVX512F_REG_OR_XI_MODE.
	(ix86_avx_u128_mode_needed): Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_check_avx256_stores): Changed to ...
	(ix86_check_avx_upper_stores): ... this. Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_avx_u128_mode_after): Changed
	avx_reg256_found to avx_upper_reg_found. Changed
	ix86_check_avx256_stores to ix86_check_avx_upper_stores.
	(ix86_avx_u128_mode_entry): Changed
	ix86_check_avx256_register to ix86_check_avx_upper_register.
	(ix86_avx_u128_mode_exit): Ditto.
	(ix86_option_override_internal): Set MASK_VZEROUPPER if
	neither -mzeroupper nor -mno-zeroupper is used and
	TARGET_EMIT_VZEROUPPER is set.
	* config/i386/i386.h: (host_detect_local_cpu): New define.
	(TARGET_EMIT_VZEROUPPER): New.
	* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.

2017-12-04  Sebastian Peryt  <sebastian.peryt@intel.com>
	H.J. Lu  <hongjiu.lu@intel.com>

gcc/testsuite/
	Backported from trunk
	PR target/82941
	PR target/82942
	PR target/82990
	* gcc.target/i386/pr82941-1.c: New test.
	* gcc.target/i386/pr82941-2.c: Likewise.
	* gcc.target/i386/pr82942-1.c: Likewise.
	* gcc.target/i386/pr82942-2.c: Likewise.
	* gcc.target/i386/pr82990-1.c: Likewise.
	* gcc.target/i386/pr82990-2.c: Likewise.
	* gcc.target/i386/pr82990-3.c: Likewise.
	* gcc.target/i386/pr82990-4.c: Likewise.
	* gcc.target/i386/pr82990-5.c: Likewise.
	* gcc.target/i386/pr82990-6.c: Likewise.
	* gcc.target/i386/pr82990-7.c: Likewise.

Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com>

From-SVN: r255378
2017-12-04 12:03:37 +01:00
Julia Koval 1d516992d1 i386-common.c (OPTION_MASK_ISA_RDPID_SET): New.
* common/config/i386/i386-common.c (OPTION_MASK_ISA_RDPID_SET): New.
	(OPTION_MASK_ISA_PKU_UNSET): New.
	(ix86_handle_option): Handle -mrdpid.
	* config/i386/cpuid.h (bit_RDPID): New.
	* config/i386/driver-i386.c (host_detect_local_cpu):
	Detect RDPID feature.
	* config/i386/i386-builtin.def (__builtin_ia32_rdpid): New.
	* config/i386/i386-c.c (ix86_target_macros_internal):
	Handle RDPID flag.
	* config/i386/i386.c (ix86_target_string): Add -mrdpid to isa2_opts.
	(ix86_valid_target_attribute_inner_p): Add "rdpid".
	(ix86_expand_builtin): Handle IX86_BUILTIN_RDPID.
	* config/i386/i386.h (TARGET_RDPID, TARGET_RDPID_P): New.
	* config/i386/i386.md (define_insn "rdpid"): New.
	* config/i386/i386.opt Add -mrdpid.
	* config/i386/immintrin.h (_rdpid_u32): New.

testsuite/ChangeLog:

	* gcc.target/i386/rdpid.c New test.
	* gcc.target/i386/sse-12.c: Add -mrdpid.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.

From-SVN: r245540
2017-02-17 19:11:28 +01:00
Jakub Jelinek cae67b80b7 i386.h (REG_CLASS_NAMES): Add , in between "MOD4_SSE_REGS" and "ALL_REGS".
* config/i386/i386.h (REG_CLASS_NAMES): Add , in between
	"MOD4_SSE_REGS" and "ALL_REGS".

From-SVN: r245405
2017-02-13 20:59:28 +01:00
Richard Biener a4cf4b647c re PR tree-optimization/79256 (FAIL: gcc.dg/vect/pr25413a.c execution test)
2017-02-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79256
	PR middle-end/79278
	* builtins.c (get_object_alignment_2): Use min_align_of_type
	to extract alignment for MEM_REFs to honor BIGGEST_FIELD_ALIGNMENT
	and ADJUST_FIELD_ALIGN.

	* doc/tm.texi.in (ADJUST_FIELD_ALIGN): Adjust to take additional
	type parameter.
	* doc/tm.texi: Regenerate.
	* stor-layout.c (layout_decl): Adjust.
	(update_alignment_for_field): Likewise.
	(place_field): Likewise.
	(min_align_of_type): Likewise.
	* config/arc/arc.h (ADJUST_FIELD_ALIGN): Adjust.
	* config/epiphany/epiphany.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/epiphany/epiphany.c (epiphany_adjust_field_align): Likewise.
	* config/frv/frv.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/frv/frv.c (frv_adjust_field_align): Likewise.
	* config/i386/i386.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/i386/i386.c (x86_field_alignment): Likewise.
	* config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Likewise.
	* config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p):
	 Likewise.

	go/
	* go-backend.c (go_field_alignment): Adjust.

	libobjc/
	* encoding.c (objc_layout_structure_next_member): Adjust
	ADJUST_FIELD_ALIGN usage.

	Revert
	2017-01-30  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/79256
	* targhooks.c (default_builtin_vector_alignment_reachable): Honor
	BIGGEST_FIELD_ALIGNMENT and ADJUST_FIELD_ALIGN to fix up bogus
	alignment on TYPE.

From-SVN: r245245
2017-02-07 11:29:06 +00:00
Uros Bizjak 4ed04e93c2 i386.h (MASK_CLASS_P): New define.
* config/i386/i386.h (MASK_CLASS_P): New define.
	* config/i386/i386.c (inline_secondary_memory_needed): Ensure that
	there are no registers from different register sets also when
	mask registers are used.  Update function comment.
	* config/i386/i386.md (*movsi_internal): Split (*k/*krm) alternative
	to (*k/*r) and (*k/*km) alternatives.

From-SVN: r244548
2017-01-17 20:44:53 +01:00
Uros Bizjak af995bf019 i386.h (LIMIT_RELOAD_CLASS): Remove.
* config/i386/i386.h (LIMIT_RELOAD_CLASS): Remove.

From-SVN: r244508
2017-01-17 00:18:30 +01:00
Uros Bizjak a60c335103 i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and QImode fixups to general and mask registers only.
* config/i386/i386.h (HARD_REGNO_CALLER_SAVE_MODE): Apply HImode and
	QImode fixups to general and mask registers only.

From-SVN: r244504
2017-01-16 20:58:59 +01:00
Julia Koval 73e32c4743 i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New.
* common/config/i386/i386-common.c (OPTION_MASK_ISA_SGX_UNSET): New.
	(OPTION_MASK_ISA_SGX_SET): New.
	(ix86_handle_option): Handle OPT_msgx.
	* config.gcc: Added sgxintrin.h.
	* config/i386/driver-i386.c (host_detect_local_cpu): Detect sgx.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define __SGX__.
	* config/i386/i386.c (ix86_target_string): Add -msgx.
	(PTA_SGX): New.
	(ix86_option_override_internal): Handle new options.
	(ix86_valid_target_attribute_inner_p): Add sgx.
	* config/i386/i386.h (TARGET_SGX, TARGET_SGX_P): New.
	* config/i386/i386.opt: Add msgx.
	* config/i386/sgxintrin.h: New file.
	* config/i386/x86intrin.h: Add sgxintrin.h.

testsuite/ChangeLog:

	* gcc.target/i386/sgx.c New test.
	* gcc.target/i386/sse-12.c: Add -msgx.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.


Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>

From-SVN: r244339
2017-01-11 22:41:13 +01:00
Andrew Senkevich 79fc8ffe6c Enable AVX-512 VPOPCNTD/VPOPCNTQ instructions.
gcc/
	* common/config/i386/i386-common.c (OPTION_MASK_ISA_AVX512VPOPCNTDQ_SET,
	OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET): New.
	* config.gcc: Add avx512vpopcntdqintrin.h.
	* config/i386/avx512vpopcntdqintrin.h: New.
	* config/i386/cpuid.h (bit_AVX512VPOPCNTDQ): New.
	* config/i386/i386-builtin-types.def: Add new types.
	* config/i386/i386-builtin.def (__builtin_ia32_vpopcountd_v16si,
	__builtin_ia32_vpopcountd_v16si_mask, __builtin_ia32_vpopcountq_v8di,
	__builtin_ia32_vpopcountq_v8di_mask): New.
	* config/i386/i386-c.c (ix86_target_macros_internal): Define
	__AVX512VPOPCNTDQ__.
	* config/i386/i386.c (ix86_target_string): Add -mavx512vpopcntdq.
	(PTA_AVX512VPOPCNTDQ): Define.
	* config/i386/i386.h (TARGET_AVX512VPOPCNTDQ,
	TARGET_AVX512VPOPCNTDQ_P): Define.
	* config/i386/i386.opt: Add mavx512vpopcntdq.
	* config/i386/immintrin.h: Include avx512vpopcntdqintrin.h.
	* config/i386/sse.md (define_insn "vpopcount<mode><mask_name>"): New.

libgcc/
	* config/i386/cpuinfo.h (processor_features): Add
	FEATURE_AVX512VPOPCNTDQ.
	* config/i386/cpuinfo.c (get_available_features): Habdle new
	feature.

gcc/testsuite/
	* g++.dg/other/i386-2.C: Add -mavx512vpopcntdq.
	* g++.dg/other/i386-3.C: Ditto.
	* gcc.target/i386/sse-12.c: Ditto.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* gcc.target/i386/builtin_target.c: Handle new option.
	* gcc.target/i386/funcspec-56.inc: Test new attributes.
	* gcc.target/i386/avx512vpopcntdq-vpopcntd.c: New test.
	* gcc.target/i386/avx512vpopcntdq-vpopcntq.c: Ditto.

From-SVN: r244263
2017-01-10 12:55:41 +00:00
Jakub Jelinek cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jakub Jelinek 8000827901 re PR target/78791 (ACATS cxf2001 failure)
PR target/78791
	* config/i386/i386.h (enum ix86_stack_slot): Add SLOT_STV_TEMP.
	* config/i386/i386.c (dimode_scalar_chain::make_vector_copies,
	dimode_scalar_chain::convert_reg): Use SLOT_STV_TEMP instead of
	SLOT_TEMP.

	* gcc.c-torture/execute/pr78791.c: New test.
	* gcc.target/i386/pr78791.c: New test.

From-SVN: r243671
2016-12-14 22:39:51 +01:00
Uros Bizjak b8cab8a549 re PR target/78738 (ICE in extract_insn, at recog.c:2311)
PR target/78738
	* config/i386/i386.h (X87_ENABLE_ARITH): Also enable for
	flag_unsafe_math_optimizations.
	(X87_ENABLE_FLOAT): Ditto.

testsuite/ChangeLog:

	PR target/78738
	* gcc.target/i386/pr78738.c: New test.

From-SVN: r243559
2016-12-12 17:02:28 +01:00
Uros Bizjak 7bf65250f1 i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
* gcc.target/i386/i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
	(HARD_REGNO_NREGS_HAS_PADDING): Ditto.  Simplify macro.

From-SVN: r243455
2016-12-08 20:15:45 +01:00
James Greenhalgh 8f23c89a5f [Patch 7/17] Delete TARGET_FLT_EVAL_METHOD and poison it.
gcc/

	* config/s390/s390.h (TARGET_FLT_EVAL_METHOD): Delete.
	* config/m68k/m68k.h (TARGET_FLT_EVAL_METHOD): Delete.
	* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Delete.
	* defaults.h (TARGET_FLT_EVAL_METHOD): Delete.
	* doc/tm.texi.in (TARGET_FLT_EVAL_METHOD): Delete.
	* doc/tm.texi: Regenerate.
	* system.h (TARGET_FLT_EVAL_METHOD): Poison.

From-SVN: r242777
2016-11-23 17:24:28 +00:00
Kirill Yukhin 5fbb13a720 Enable AVX512_4FMAPS and AVX512_4VNNIW instructions
This requires additional patch for register allocator from Vladimir
Makarov.

gcc/

2016-11-17  Kirill Yukhin  <kirill.yukhin@gmail.com>
	    Andrew Senkevich <andrew.senkevich@intel.com>

	* common/config/i386/i386-common.c
	(OPTION_MASK_ISA_AVX5124FMAPS_SET,
	OPTION_MASK_ISA_AVX5124FMAPS_UNSET,
	OPTION_MASK_ISA_AVX5124VNNIW_SET,
	OPTION_MASK_ISA_AVX5124VNNIW_UNSET): New.
	(ix86_handle_option): Handle OPT_mavx5124fmaps,
	OPT_mavx5124vnniw.
	* config.gcc: Add avx5124fmapsintrin.h, avx5124vnniwintrin.h.
	* config/i386/avx5124fmapsintrin.h: New file.
	* config/i386/avx5124vnniwintrin.h: Ditto.
	* config/i386/constraints.md (h): New constraint.
	* config/i386/cpuid.h: (bit_AVX5124VNNIW,
	bit_AVX5124FMAPS): New.
	* config/i386/driver-i386.c (host_detect_local_cpu):
	Detect avx5124fmaps, avx5124vnniw.
	* config/i386/i386-builtin-types.def: Add types
	V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF_V16SF_UHI,
	V16SF_FTYPE_V16SF_V16SF_V16SF_V16SF_V16SF_PCV4SF,
	V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF,
	V4SF_FTYPE_V4SF_V4SF_V4SF_V4SF_V4SF_PCV4SF_V4SF_UQI,
	V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI,
	V16SI_FTYPE_V16SI_V16SI_V16SI_V16SI_V16SI_PCV4SI_V16SI_UHI.
	* config/i386/i386-builtin.def (__builtin_ia32_4fmaddps_mask,
	__builtin_ia32_4fmaddps, __builtin_ia32_4fmaddss,
	__builtin_ia32_4fmaddss_mask, __builtin_ia32_4fnmaddps_mask,
	__builtin_ia32_4fnmaddps, __builtin_ia32_4fnmaddss,
	__builtin_ia32_4fnmaddss_mask, __builtin_ia32_vp4dpwssd,
	__builtin_ia32_vp4dpwssd_mask, __builtin_ia32_vp4dpwssds,
	__builtin_ia32_vp4dpwssds_mask): New.
	* config/i386/i386-c.c (ix86_target_macros_internal):
	Define __AVX5124FMAPS__, __AVX5124VNNIW__.
	* config/i386/i386-modes.def: Fixed comment typos, added new
	modes (VECTOR_MODES (FLOAT, 256), VECTOR_MODE (INT, SI, 64)).
	* config/i386/i386.c (ix86_target_string): Add -mavx5124fmaps,
	-mavx5124vnniw.
	(PTA_AVX5124FMAPS, PTA_AVX5124VNNIW): Define.
	(ix86_option_override_internal): Handle new options.
	(ix86_valid_target_attribute_inner_p): Add avx5124fmaps,
	avx5124vnniw.
	(ix86_expand_builtin): Handle new builtins.
	(ix86_additional_allocno_class_p): New.
	* config/i386/i386.h (TARGET_AVX5124FMAPS,
	TARGET_AVX5124FMAPS_P,
	TARGET_AVX5124VNNIW,
	TARGET_AVX5124VNNIW_P): Define.
	(reg_class): Add MOD4_SSE_REGS.
	(MOD4_SSE_REG_P, MOD4_SSE_REGNO_P): New.
	* config/i386/i386.opt: Add mavx5124fmaps, mavx5124vnniw.
	* config/i386/immintrin.h: Include avx5124fmapsintrin.h,
	avx5124vnniwintrin.h.
	* config/i386/sse.md (unspec): Add UNSPEC_VP4FMADD,
	UNSPEC_VP4FNMADD,
	UNSPEC_VP4DPWSSD, UNSPEC_VP4DPWSSDS.
	(define_mode_iterator IMOD4): New.
	(define_mode_attr imod4_narrow): Ditto.
	(define_insn "mov<mode>"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddps"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddps_mask"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddps_maskz"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddss"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddss_mask"): Ditto.
	(define_insn "avx5124fmaddps_4fmaddss_maskz"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddps"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddps_mask"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddps_maskz"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddss"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddss_mask"): Ditto.
	(define_insn "avx5124fmaddps_4fnmaddss_maskz"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssd"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssd_mask"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssd_maskz"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssds"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssds_mask"): Ditto.
	(define_insn "avx5124vnniw_vp4dpwssds_maskz"): Ditto.
	* init-regs.c (initialize_uninitialized_regs): Add emit_clobber call.
	* genmodes.c (mode_size_inline): Extend return type.
	* machmode.h (mode_size, mode_base_align): Extend type.

gcc/testsuite/

2016-11-17  Kirill Yukhin  <kirill.yukhin@gmail.com>
	    Andrew Senkevich <andrew.senkevich@intel.com>

	* gcc.target/i386/avx5124fmadd-v4fmaddps-1.c: New test.
	* gcc.target/i386/avx5124fmadd-v4fmaddps-2.c: Ditto.
	* gcc.target/i386/avx5124fmadd-v4fmaddss-1.c: Ditto.
	* gcc.target/i386/avx5124fmadd-v4fnmaddps-1.c: Ditto.
	* gcc.target/i386/avx5124fmadd-v4fnmaddps-2.c: Ditto.
	* gcc.target/i386/avx5124fmadd-v4fnmaddss-1.c: Ditto.
	* gcc.target/i386/avx5124fmaps-check.h: Ditto.
	* gcc.target/i386/avx5124vnniw-check.h: Ditto.
	* gcc.target/i386/avx5124vnniw-vp4dpwssd-1.c: Ditto.
	* gcc.target/i386/avx5124vnniw-vp4dpwssd-2.c: Ditto.
	* gcc.target/i386/avx5124vnniw-vp4dpwssds-1.c: Ditto.
	* gcc.target/i386/avx5124vnniw-vp4dpwssds-2.c: Ditto.
	* gcc.target/i386/avx512f-helper.h: Add avx5124fmaps-check.h,
	avx5124vnniw-check.h.
	* gcc.target/i386/i386.exp (check_effective_target_avx5124fmaps,
	check_effective_target_avx5124vnniw): New.
	* gcc.target/i386/m128-check.h (ESP_FLOAT, ESP_DOUBLE):
	Set under ifndef.
	* gcc.target/i386/sse-12.c: Add -mavx5124fmaps, -mavx5124vnniw.
	* gcc.target/i386/sse-13.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.
	* g++.dg/other/i386-3.C: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.

From-SVN: r242569
2016-11-17 14:11:21 -08:00
Richard Sandiford 240930c41f Fix instances of gen_rtx_REG (VOIDmode, ...)
Several definitions of INCOMING_RETURN_ADDR_RTX used
gen_rtx_REG (VOIDmode, ...), which with later patches
would trip an assert.  This patch converts them to use
Pmode instead.

gcc/
2016-11-15  Richard Sandiford  <richard.sandiford@arm.com>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

	* config/i386/i386.h (INCOMING_RETURN_ADDR_RTX): Use Pmode instead
	of VOIDmode.
	* config/ia64/ia64.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/iq2000/iq2000.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/m68k/m68k.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/microblaze/microblaze.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/mips/mips.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/mn10300/mn10300.h (INCOMING_RETURN_ADDR_RTX): Likewise.
	* config/nios2/nios2.h (INCOMING_RETURN_ADDR_RTX): Likewise.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242447
2016-11-15 18:30:31 +00:00
Eric Botcazou 86f980870a i386.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Move to...
* config/i386/i386.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Move to...
	* config/i386/i386.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): ...here.
	* config/ia64/ia64.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Move to...
	* config/ia64/ia64.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): ...here.
	* config/rs6000/rs6000.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Move to.
	* config/rs6000/rs6000.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): ...here.
	(rs6000_option_override_internal): Clear it if ABI_AIX.
	* config/sparc/sparc.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Move to...
	* config/sparc/sparc.c (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): ... here.

From-SVN: r241285
2016-10-17 22:34:53 +00:00
Eric Botcazou 4c640e2606 re PR ada/37139 (DEP prevents using Ada tasking)
PR ada/37139
	PR ada/67205
	* common.opt (-ftrampolines): New option.
	* doc/invoke.texi (Code Gen Options): Document it.
	* doc/tm.texi.in (Trampolines): Add TARGET_CUSTOM_FUNCTION_DESCRIPTORS.
	* doc/tm.texi: Regenerate.
	* builtins.def: Add init_descriptor and adjust_descriptor.
	* builtins.c (expand_builtin_init_trampoline): Do not issue a warning
	on platforms with descriptors.
	(expand_builtin_init_descriptor): New function.
	(expand_builtin_adjust_descriptor): Likewise.
	(expand_builtin) <BUILT_IN_INIT_DESCRIPTOR>: New case.
	<BUILT_IN_ADJUST_DESCRIPTOR>: Likewise.
	* calls.c (prepare_call_address): Remove SIBCALLP parameter and add
	FLAGS parameter.  Deal with indirect calls by descriptor and adjust.
	Set STATIC_CHAIN_REG_P on the static chain register, if any.
	(call_expr_flags): Set ECF_BY_DESCRIPTOR for calls by descriptor.
	(expand_call): Likewise.  Move around call to prepare_call_address
	and pass all flags to it.
	* cfgexpand.c (expand_call_stmt): Reinstate CALL_EXPR_BY_DESCRIPTOR.
	* gimple.h (enum gf_mask): New GF_CALL_BY_DESCRIPTOR value.
	(gimple_call_set_by_descriptor): New setter.
	(gimple_call_by_descriptor_p): New getter.
	* gimple.c (gimple_build_call_from_tree): SetCALL_EXPR_BY_DESCRIPTOR.
	(gimple_call_flags): Deal with GF_CALL_BY_DESCRIPTOR.
	* langhooks.h (struct lang_hooks): Add custom_function_descriptors.
	* langhooks-def.h (LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS): Define.
	(LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS.
	* rtl.h (STATIC_CHAIN_REG_P): New macro.
	* rtlanal.c (find_first_parameter_load): Skip static chain registers.
	* target.def (custom_function_descriptors): New POD hook.
	* tree.h (FUNC_ADDR_BY_DESCRIPTOR): New flag on ADDR_EXPR.
	(CALL_EXPR_BY_DESCRIPTOR): New flag on CALL_EXPR.
	* tree-core.h (ECF_BY_DESCRIPTOR): New mask.
	Document FUNC_ADDR_BY_DESCRIPTOR and CALL_EXPR_BY_DESCRIPTOR.
	* tree.c (make_node_stat) <tcc_declaration>: Use FUNCTION_ALIGNMENT.
	(build_common_builtin_nodes): Initialize init_descriptor and
	adjust_descriptor.
	* tree-nested.c: Include target.h.
	(struct nesting_info): Add 'any_descr_created' field.
	(get_descriptor_type): New function.
	(lookup_element_for_decl): New function extracted from...
	(create_field_for_decl): Likewise.
	(lookup_tramp_for_decl): ...here.  Adjust.
	(lookup_descr_for_decl): New function.
	(convert_tramp_reference_op): Deal with descriptors.
	(build_init_call_stmt): New function extracted from...
	(finalize_nesting_tree_1): ...here.  Adjust and deal withdescriptors.
	* defaults.h (FUNCTION_ALIGNMENT): Define.
	(TRAMPOLINE_ALIGNMENT): Set to above instead of FUNCTION_BOUNDARY.
	* config/i386/i386.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Define.
	* config/ia64/ia64.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Likewise.
	* config/rs6000/rs6000.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS):Likewise.
	* config/sparc/sparc.h (TARGET_CUSTOM_FUNCTION_DESCRIPTORS): Likewise.
ada/
	* gcc-interface/misc.c (LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS):Define.
	* gcc-interface/trans.c (Attribute_to_gnu) <Attr_Access>: Deal with
	a zero TARGET_CUSTOM_FUNCTION_DESCRIPTORS specially for Code_Address.
	Otherwise, if TARGET_CUSTOM_FUNCTION_DESCRIPTORS is positive, set
	FUNC_ADDR_BY_DESCRIPTOR for 'Access/'Unrestricted_Access of nested
	subprograms if the type can use an internal representation.
	(call_to_gnu): Likewise, but set CALL_EXPR_BY_DESCRIPTOR on indirect
	calls if the type can use an internal representation.

From-SVN: r241222
2016-10-16 20:13:32 +00:00
Andrew Senkevich eee8f0b07f Delete x86 deprecated pcommit instruction support
Delete x86 pcommit instruction support, which has been deprecated:

https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction

gcc/

	* common/config/i386/i386-common.c (OPTION_MASK_ISA_PCOMMIT_UNSET,
	OPTION_MASK_ISA_PCOMMIT_SET): Deleted definitions.
	(ix86_handle_option): Deleted handle of OPT_mpcommit.
	* config.gcc: Deleted pcommitintrin.h
	* config/i386/pcommitintrin.h: Deleted file.
	* config/i386/cpuid.h (bit_PCOMMIT): Deleted.
	* config/i386/driver-i386.c (host_detect_local_cpu): Deleted pcommit
	detection.
	* config/i386/i386-c.c (ix86_target_macros_internal): Deleted define
	__PCOMMIT__.
	* config/i386/i386.c (ix86_target_string): Deleted -mpcommit.
	(PTA_PCOMMIT): Deleted define.
	(ix86_option_override_internal): Deleted handle of option.
	(ix86_valid_target_attribute_inner_p): Deleted pcommit.
	* config/i386/i386-builtin.def (IX86_BUILTIN_PCOMMIT,
	__builtin_ia32_pcommit): Deleted.
	* config/i386/i386.h (TARGET_PCOMMIT, TARGET_PCOMMIT_P): Deleted.
	* config/i386/i386.md (unspecv): Deleted UNSPECV_PCOMMIT.
	(pcommit): Deleted instruction.
	* config/i386/i386.opt: Mention -mpcommit deprecation.
	* config/i386/x86intrin.h: Deleted inclusion of pcommitintrin.h.

gcc/testsuite/

	* gcc.target/i386/pcommit-1.c: Deleted.
	* gcc.target/i386/sse-12.c: Deleted -pcommit option.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-14.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-23.c: Ditto.
	* g++.dg/other/i386-2.C: Ditto.

From-SVN: r240816
2016-10-05 15:08:48 -07:00
Uros Bizjak 9f06db14fa x86-tune.def (X86_TUNE_VECTORIZE_DOUBLE): Remove.
* config/i386/x86-tune.def (X86_TUNE_VECTORIZE_DOUBLE): Remove.
	* config/i386/i386.h (TARGET_VECTORIZE_DOUBLE): Remove.
	* config/i386/i386.c (ix86_add_stmt_cost): Use TARGET_BONNEL instead
	of !TARGET_VECTORIZE_DOUBLE when penalizing DFmode vector ops.

From-SVN: r240748
2016-10-04 16:50:35 +02:00
H.J. Lu df7ec09f12 Use TImode for piecewise move in 64-bit mode
Use TImode for piecewise move in 64-bit mode.  We should use TImode in
32-bit mode and use OImode or XImode if they are available.  But since
by_pieces_ninsns determines the widest mode with MAX_FIXED_MODE_SIZE,
we can only use TImode in 64-bit mode.

gcc/

	* config/i386/i386.h (MOVE_MAX_PIECES): Use TImode in 64-bit
	mode if unaligned SSE load and store are optimal.

gcc/testsuite/

	* gcc.target/i386/pieces-memcpy-1.c: New test.
	* gcc.target/i386/pieces-memcpy-2.c: Likewise.
	* gcc.target/i386/pieces-memcpy-3.c: Likewise.
	* gcc.target/i386/pieces-memcpy-4.c: Likewise.
	* gcc.target/i386/pieces-memcpy-5.c: Likewise.
	* gcc.target/i386/pieces-memcpy-6.c: Likewise.

From-SVN: r239378
2016-08-11 08:51:01 -07:00
H.J. Lu de86ff8f97 Call tls_get_addr via GOT for GNU TLS if possible
There are extensions to x86-64 psABI:

https://groups.google.com/forum/#!topic/x86-64-abi/de5_KnLHxtI

and i386 psABI:

https://groups.google.com/forum/#!topic/ia32-abi/awsRSvJOJfs

to call tls_get_addr via GOT.  X86 assembler and linker in binutils 2.27
implemented

call *__tls_get_addr@GOTPCREL(%rip)

in 64-bit and

call *___tls_get_addr@GOT(%reg)

in 32-bit to access global and local thread loal variables in shared
library.  We check if 32-bit x86 assembler and linker work with

call *___tls_get_addr@GOT(%reg)

as 32-bit and 64-bit assembler and linker are enabled togther.

In 32-bit, since any integer register except EAX, which is used to pass
parameter to ___tls_get_addr, and ESP, can be used as GOT base, a new
register class, TLS_GOTBASE_REGS, along with a new constraint, Yb, are
added.  They are used to improve register allocation for 32-bit dynamic
TLS patterns.

gcc/

	* configure.ac (calling ___tls_get_addr via GOT): New
	assembler/linker check.
	(HAVE_AS_IX86_TLS_GET_ADDR_GOT): New.  Defined to 1 if 32-bit
	assembler and linker supports calling ___tls_get_addr via GOT.
	Otherise, defined to 0.
	* config.in: Regenerated.
	* configure: Likewise.
	* config/i386/constraints.md (Yb): New constraint.
	* config/i386/i386.h (reg_class): Add TLS_GOTBASE_REGS.
	(REG_CLASS_NAMES): Likewise.
	(REG_CLASS_CONTENTS): Likewise.
	* config/i386/i386.md (*tls_global_dynamic_32_gnu): Replace
	the b constraint with the Yb constraint.  Call ___tls_get_addr
	via GOT for GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT
	is 1.
	(*tls_local_dynamic_base_32_gnu): Likewise.
	(*tls_global_dynamic_64_<mode>): Call _tls_get_addr via GOT for
	GNU TLS with -fno-plt if HAVE_AS_IX86_TLS_GET_ADDR_GOT is 1.
	(*tls_local_dynamic_base_64_<mode>): Likewise.

gcc/testsuite/

	* gcc.target/i386/noplt-gd-1.c: New test.
	* gcc.target/i386/noplt-gd-2.c: Likewise.
	* gcc.target/i386/noplt-gd-3.c: Likewise.
	* gcc.target/i386/noplt-ld-1.c: Likewise.
	* gcc.target/i386/noplt-ld-2.c: Likewise.
	* gcc.target/i386/noplt-ld-3.c: Likewise.
	* lib/target-supports.exp
	(check_effective_target_tls_get_addr_via_got): New.

From-SVN: r237765
2016-06-24 10:32:52 -07:00
Uros Bizjak c7ca8ef875 i386.h (enum ix86_enitity): Add X86_DIRFLAG.
* config/i386/i386.h (enum ix86_enitity): Add X86_DIRFLAG.
	(enum x86_dirflag_state): New enum.
	(NUM_MODES_FOR_MODE_SWITCHING): Add X86_DIRFLAG_ANY.
	(machine_function): Remove needs_cld.
	(ix86_current_function_needs_cld): Remove.
	* config/i386/i386.c (ix86_set_func_type): Set
	ix86_optimize_mode_switching[X86_DIRFLAG] to 1.
	(ix86_expand_prologue): Do not emit CLD here.
	(ix86_dirflag_mode_needed): New function.
	(ix86_dirflag_mode_entry): Ditto.
	(ix86_mode_needed): Handle X86_DIRFLAG entity.
	(ix86_mode_after): Ditto.
	(ix86_mode_entry): Ditto.
	(ix86_mode_exit): Ditto.
	(ix86_emit_mode_set): Ditto.
	* config/i386/i386.md (strmov_singleop): Set
	ix86_optimize_mode_switching[X86_DIRFLAG] to 1 for TARGET_CLD.
	Do not set ix86_current_function_needs_cld.
	(rep_mov): Ditto.
	(strset_singleop): Ditto.
	(rep_stos): Ditto.
	(cmpstrnqi_nz_1): Ditto.
	(cmpstrnqi_1): Ditto.
	(strlenqi_1): Ditto.

From-SVN: r237156
2016-06-07 00:35:18 +02:00
H.J. Lu f8071c0566 Implement x86 interrupt attribute
The interrupt and exception handlers are called by x86 processors.  X86
hardware pushes information onto stack and calls the handler.  The
requirements are

1. Both interrupt and exception handlers must use the 'IRET' instruction,
instead of the 'RET' instruction, to return from the handlers.
2. All registers are callee-saved in interrupt and exception handlers.
3. The difference between interrupt and exception handlers is the
exception handler must pop 'ERROR_CODE' off the stack before the 'IRET'
instruction.

The design goals of interrupt and exception handlers for x86 processors
are:

1. Support both 32-bit and 64-bit modes.
2. Flexible for compilers to optimize.
3. Easy to use by programmers.

To implement interrupt and exception handlers for x86 processors, a
compiler should support:

'interrupt' attribute

Use this attribute to indicate that the specified function with
mandatory arguments is an interrupt or exception handler.  The compiler
generates function entry and exit sequences suitable for use in an
interrupt handler when this attribute is present.  The 'IRET' instruction,
instead of the 'RET' instruction, is used to return from interrupt or
exception handlers.  All registers, except for the EFLAGS register which
is restored by the 'IRET' instruction, are preserved by the compiler.
Since GCC doesn't preserve MPX, SSE, MMX nor x87 states, the GCC option,
-mgeneral-regs-only, should be used to compile interrupt and exception
handlers.

Note for compiler implementers: If the compiler generates MPX, SSE, MMX
or x87 instructions in an interrupt or exception handler, or functions
called from an interrupt or exception handler may contain MPX, SSE, MMX
or x87 instructions, the compiler must save and restore the corresponding
state.

Since the direction flag in the FLAGS register in interrupt (exception)
handlers is undetermined, cld instruction must be emitted in function
prologue if rep string instructions are used in interrupt (exception)
handler or interrupt (exception) handler isn't a leaf function.

Any interruptible-without-stack-switch code must be compiled with
-mno-red-zone since interrupt handlers can and will, because of the
hardware design, touch the red zone.

1. interrupt handler must be declared with a mandatory pointer argument:

struct interrupt_frame;

__attribute__ ((interrupt))
void
f (struct interrupt_frame *frame)
{
...
}

and user must properly define the structure the pointer pointing to.

2. exception handler:

The exception handler is very similar to the interrupt handler with
a different mandatory function signature:

typedef unsigned int uword_t __attribute__ ((mode (__word__)));

struct interrupt_frame;

__attribute__ ((interrupt))
void
f (struct interrupt_frame *frame, uword_t error_code)
{
...
}

and compiler pops the error code off stack before the 'IRET' instruction.

The exception handler should only be used for exceptions which push an
error code and all other exceptions must use the interrupt handler.
The system will crash if the wrong handler is used.

'no_caller_saved_registers' attribute

Use this attribute to indicate that the specified function has no
caller-saved registers.  That is, all registers are callee-saved.
The compiler generates proper function entry and exit sequences to
save and restore any modified registers, except for the EFLAGS register.
Since GCC doesn't preserve MPX, SSE, MMX nor x87 states, the GCC option,
-mgeneral-regs-only, should be used to compile functions with
'no_caller_saved_registers'attribute.

Note for compiler implementers: If the compiler generates MPX, SSE,
MMX or x87 instructions in a function with 'no_caller_saved_registers'
attribute or functions called from a function with
'no_caller_saved_registers' attribute may contain MPX, SSE, MMX or x87
instructions, the compiler must save and restore the corresponding state.

The user can call functions specified with 'no_caller_saved_registers'
attribute from an interrupt handler without saving and restoring all
call clobbered registers.

On x86, interrupt handlers are only called by processors which push
interrupt data onto stack at the address where the normal return address
is.  Interrupt handlers must access interrupt data via pointers so that
they can update interrupt data.

gcc/

	PR target/66960
	PR target/67630
	PR target/67634
	PR target/67841
	PR target/68037
	PR target/68618
	PR target/68661
	PR target/69575
	PR target/69596
	PR target/69734
	* config/i386/i386-protos.h (ix86_epilogue_uses): New prototype.
	* config/i386/i386.c (ix86_conditional_register_usage): Preserve
	all registers, except for function return registers if there are
	no caller-saved registers.
	(ix86_set_func_type): New function.
	(ix86_set_current_function): Call ix86_set_func_type to set
	no_caller_saved_registers and func_type.  Call reinit_regs if
	caller-saved registers are changed.  Don't allow MPX, SSE, MMX
	nor x87 instructions in interrupt handler nor function with
	no_caller_saved_registers attribute.
	(ix86_function_ok_for_sibcall): Return false if there are no
	caller-saved registers.
	(type_natural_mode): Don't warn ABI change for MMX in interrupt
	handler.
	(ix86_function_arg_advance): Skip for callee in interrupt
	handler.
	(ix86_function_arg): Return special arguments in interrupt
	handler.
	(ix86_promote_function_mode): Promote pointer to word_mode only
	for normal functions.
	(ix86_can_use_return_insn_p): Don't use `ret' instruction in
	interrupt handler.
	(ix86_epilogue_uses): New function.
	(ix86_hard_regno_scratch_ok): Likewise.
	(ix86_save_reg): Preserve all registers in interrupt handler
	after reload.  Preserve all registers, except for function
	return registers, if there are no caller-saved registers after
	reload.
	(find_drap_reg): Always use callee-saved register if there are
	no caller-saved registers.
	(ix86_minimum_incoming_stack_boundary): Return MIN_STACK_BOUNDARY
	for interrupt handler.
	(ix86_expand_prologue): Don't allow DRAP in interrupt handler.
	Emit cld instruction if stringops are used in interrupt handler
	or interrupt handler isn't a leaf function.
	(ix86_expand_epilogue): Generate interrupt return for interrupt
	handler and pop the 'ERROR_CODE' off the stack before interrupt
	return in exception handler.
	(ix86_expand_call): Disallow calling interrupt handler directly.
	If there are no caller-saved registers, mark all registers that
	are clobbered by the call which returns as clobbered.
	(ix86_handle_no_caller_saved_registers_attribute): New function.
	(ix86_handle_interrupt_attribute): Likewise.
	(ix86_attribute_table): Add interrupt and no_caller_saved_registers
	attributes.
	(TARGET_HARD_REGNO_SCRATCH_OK): Likewise.
	* config/i386/i386.h (ACCUMULATE_OUTGOING_ARGS): Use argument
	accumulation in interrupt function if stack may be realigned to
	avoid DRAP.
	(EPILOGUE_USES): New.
	(function_type): New enum.
	(machine_function): Add func_type and no_caller_saved_registers.
	* config/i386/i386.md (UNSPEC_INTERRUPT_RETURN): New.
	(interrupt_return): New pattern.
	* doc/extend.texi: Document x86 interrupt and
	no_caller_saved_registers attributes.

gcc/testsuite/

	PR target/66960
	PR target/67630
	PR target/67634
	PR target/67841
	PR target/68037
	PR target/68618
	PR target/68661
	PR target/69575
	PR target/69596
	PR target/69734
	* gcc.dg/guality/pr68037-1.c: New test.
	* gcc.dg/guality/pr68037-2.c: Likewise.
	* gcc.dg/guality/pr68037-3.c: Likewise.
	* gcc.dg/torture/pr68037-1.c: Likewise.
	* gcc.dg/torture/pr68037-2.c: Likewise.
	* gcc.dg/torture/pr68037-3.c: Likewise.
	* gcc.dg/torture/pr68661-1a.c: Likewise.
	* gcc.dg/torture/pr68661-1b.c: Likewise.
	* gcc.target/i386/interrupt-1.c: Likewise.
	* gcc.target/i386/interrupt-2.c: Likewise.
	* gcc.target/i386/interrupt-3.c: Likewise.
	* gcc.target/i386/interrupt-4.c: Likewise.
	* gcc.target/i386/interrupt-5.c: Likewise.
	* gcc.target/i386/interrupt-6.c: Likewise.
	* gcc.target/i386/interrupt-7.c: Likewise.
	* gcc.target/i386/interrupt-8.c: Likewise.
	* gcc.target/i386/interrupt-9.c: Likewise.
	* gcc.target/i386/interrupt-10.c: Likewise.
	* gcc.target/i386/interrupt-11.c: Likewise.
	* gcc.target/i386/interrupt-12.c: Likewise.
	* gcc.target/i386/interrupt-13.c: Likewise.
	* gcc.target/i386/interrupt-14.c: Likewise.
	* gcc.target/i386/interrupt-15.c: Likewise.
	* gcc.target/i386/interrupt-16.c: Likewise.
	* gcc.target/i386/interrupt-17.c: Likewise.
	* gcc.target/i386/interrupt-18.c: Likewise.
	* gcc.target/i386/interrupt-19.c: Likewise.
	* gcc.target/i386/interrupt-20.c: Likewise.
	* gcc.target/i386/interrupt-21.c: Likewise.
	* gcc.target/i386/interrupt-22.c: Likewise.
	* gcc.target/i386/interrupt-23.c: Likewise.
	* gcc.target/i386/interrupt-24.c: Likewise.
	* gcc.target/i386/interrupt-25.c: Likewise.
	* gcc.target/i386/interrupt-26.c: Likewise.
	* gcc.target/i386/interrupt-27.c: Likewise.
	* gcc.target/i386/interrupt-28.c: Likewise.
	* gcc.target/i386/interrupt-387-err-1.c: Likewise.
	* gcc.target/i386/interrupt-387-err-2.c: Likewise.
	* gcc.target/i386/interrupt-bnd-err-1.c: Likewise.
	* gcc.target/i386/interrupt-bnd-err-2.c: Likewise.
	* gcc.target/i386/interrupt-iamcu.c: Likewise.
	* gcc.target/i386/interrupt-mmx-err-1.c: Likewise.
	* gcc.target/i386/interrupt-mmx-err-2.c: Likewise.
	* gcc.target/i386/interrupt-redzone-1.c: Likewise.
	* gcc.target/i386/interrupt-redzone-2.c: Likewise.
	* gcc.target/i386/interrupt-sibcall-1.c: Likewise.
	* gcc.target/i386/interrupt-sibcall-2.c: Likewise.
	* gcc.target/i386/interrupt-switch-abi.c: Likewise.

Co-Authored-By: Julia Koval <julia.koval@intel.com>

From-SVN: r237073
2016-06-03 08:08:00 -07:00
Jakub Jelinek 8e0dc0549a i386.h (TARGET_AVOID_4BYTE_PREFIXES): Define.
* config/i386/i386.h (TARGET_AVOID_4BYTE_PREFIXES): Define.
	* config/i386/constraints.md (Yr): Test TARGET_AVOID_4BYTE_PREFIXES
	rather than X86_TUNE_AVOID_4BYTE_PREFIXES.

From-SVN: r236662
2016-05-24 21:12:42 +02:00
Uros Bizjak f48b428431 i386.h (IS_STACK_MODE): Enable for TARGET_MIX_SSE_I387.
* config/i386/i386.h (IS_STACK_MODE): Enable for
	TARGET_MIX_SSE_I387.  Rewrite using X87_FLOAT_MODE_P and
	SSE_FLOAT_MODE_P macros.
	* config/i386/i386.c (ix86_preferred_reload_class): Use
	IS_STACK_MODE, INTEGER_CLASS_P and FLOAT_CLASS_P macros.  Cleanup
	regclass processing for CONST_DOUBLE_P.
	(ix86_preferred_output_reload_class): Use IS_STACK_MODE macro.
	(ix86_rtx_costs): Remove redundant TARGET_80387 check
	with IS_STACK_MODE macro.
	* config/i386/i386.md: Replace SSE_FLOAT_MODE_P (DFmode)
	with TARGET_SSE2.
	(*movdf_internal): Use IS_STACK_MODE macro.
	(*movsf_internal): Ditto.

From-SVN: r236607
2016-05-23 20:59:38 +02:00
Jakub Jelinek 40bd4bf95e constraints.md (Yv): New constraint.
* config/i386/constraints.md (Yv): New constraint.
	* config/i386/i386.h (VALID_AVX512VL_128_REG_MODE): Allow
	TFmode and V1TImode in xmm16+ registers for TARGET_AVX512VL.
	* config/i386/i386.md (avx512fvecmode): New mode attr.
	(*pushtf): Use v constraint instead of x.
	(*movtf_internal): Likewise.  For TARGET_AVX512VL and
	xmm16+ registers, use vmovdqu64 or vmovdqa64 instructions.
	(*absneg<mode>2): Use Yv constraint instead of x constraint.
	(*absnegtf2_sse): Likewise.
	(copysign<mode>3_const, copysign<mode>3_var): Likewise.
	* config/i386/sse.md (*andnot<mode>3): Add avx512vl and
	avx512f alternatives.
	(*andnottf3, *<code><mode>3, *<code>tf3): Likewise.

	* gcc.target/i386/avx512dq-abs-copysign-1.c: New test.
	* gcc.target/i386/avx512vl-abs-copysign-1.c: New test.
	* gcc.target/i386/avx512vl-abs-copysign-2.c: New test.

From-SVN: r236161
2016-05-12 10:30:25 +02:00
Mike Stump ff734e26c2 re PR target/63890 (Compiling trivial program with -O -p leads to misaligned stack)
PR target/63890
	* config/i386/i386.h (ACCUMULATE_OUTGOING_ARGS): Use when profiling
	and TARGET_MACHO.

	* tree-vrp.c (register_edge_assert_for_2): For NAME != CST1

From-SVN: r234545
2016-03-29 21:57:30 -06:00
Jakub Jelinek 56aae4b7c0 ipa-polymorphic-call.c (walk_ssa_copies): Fix spelling - becuase -> because.
* ipa-polymorphic-call.c (walk_ssa_copies): Fix spelling
	- becuase -> because.
	* ipa-reference.c (ignore_module_statics): Likewise.
	* cgraph.c (cgraph_node::get_body): Likewise.
	* ipa-inline.c (early_inliner): Likewise.
	* ipa-devirt.c (types_same_for_odr): Likewise.
	* tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise.
	* config/i386/i386.h (ACCUMULATE_OUTGOING_ARGS): Likewise.
cp/
	* decl.c (duplicate_decls): Fix spelling - becuase -> because.
lto/
	* lto-symtab.h (lto_symtab_prevail_decl): Fix spelling
	- becuase -> because.

From-SVN: r234061
2016-03-08 18:49:34 +01:00
Uros Bizjak 1e4490dc27 re PR target/70064 (Wrong code with custom flags and quite big testcase @ i686)
PR target/70064
	* config/i386/i386.h (machine_function): Add
	pc_thunk_call_expanded flag.
	(ix86_pc_thunk_call_expanded): New define.
	* config/i386/i386.md (set_got, set_got_labelled): New expanders.
	(*set_got): Rename insn pattern from set_got.
	(*set_got_labelled): Rename inst pattern from set_got_labelled.
	* config/i386/i386.c (ix86_compute_frame_layout): Use
	ix86_pc_thunk_call_expanded to prevent red-zone.

From-SVN: r234050
2016-03-07 20:54:02 +01:00
Uros Bizjak 6235f59c57 i386.h (TARGET_FLT_EVAL_METHOD): Return -1 for TARGET_SSE_MATH without TARGET_SSE2.
* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Return -1 for
	TARGET_SSE_MATH without TARGET_SSE2.  Rewrite.

From-SVN: r232328
2016-01-13 17:41:46 +01:00
H.J. Lu cf4de6af25 Set FLT_EVAL_METHOD to 2 only if 387 FPU is used
When 387 FPU isn't used, there is no excess precision.  We should set
FLT_EVAL_METHOD to 2 only if 387 FPU is used.

gcc/

	PR target/69225
	* config/i386/i386.h (TARGET_FLT_EVAL_METHOD): Set to 2 only if
	TARGET_80387 is true.

gcc/testsuite

	PR target/69225
	* gcc.target/i386/pr69225-1.c: New test.
	* gcc.target/i386/pr69225-2.c: Likewise.
	* gcc.target/i386/pr69225-3.c: Likewise.
	* gcc.target/i386/pr69225-4.c: Likewise.
	* gcc.target/i386/pr69225-5.c: Likewise.
	* gcc.target/i386/pr69225-6.c: Likewise.

From-SVN: r232249
2016-01-11 16:30:30 -08:00
Yuri Rumyantsev ca90b1ed9a re PR rtl-optimization/68920 (Undesirable if-conversion for a rarely taken branch)
gcc/

2016-01-11  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR rtl-optimization/68920
	* config/i386/i386.c (ix86_option_override_internal): Restrict number
	of conditional moves for  RTL if-conversion to 1 for
	TARGET_ONE_IF_CONV_INSN.
	* config/i386/i386.h (TARGET_ONE_IF_CONV_INSN): New macros.
	* config/i386/x86-tune.def (X86_TUNE_ONE_IF_CONV_INSN): New macros.
	* params.def (PARAM_MAX_RTL_IF_CONVERSION_INSNS) : Introduce new
	parameter to restirct number of conditional moves for
	RTL if-conversion.
	* doc/invoke.texi (max-rtl-if-conversion-insns): Document it.
	* ifcvt.c (bb_ok_for_noce_convert_multiple_sets): Limit number of
	conditionl moves.

gcc/testsuite/

2016-01-11  Yuri Rumyantsev  <ysrumyan@gmail.com>

	PR rtl-optimization/68920
	* gcc.dg/ifcvt-4.c: Add "--param max-rtl-if-conversion-insns=3" option
	for ix86 targets.
	* gcc.dg/ifcvt-5.c: New test.

From-SVN: r232220
2016-01-11 12:07:31 +00:00
Jakub Jelinek 818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Kirill Yukhin 41a4ef2243 Introduce support for PKU instructions.
gcc/
	* common/config/i386/i386-common.c (OPTION_MASK_ISA_PKU_SET): New.
	(OPTION_MASK_ISA_PKU_UNSET): Ditto.
	(ix86_handle_option): Handle OPT_mpku.
	* config.gcc: Add pkuintrin.h to i[34567]86-*-* and x86_64-*-*
	targets.
	* config/i386/cpuid.h (host_detect_local_cpu): Detect PKU feature.
	* config/i386/i386-c.c (ix86_target_macros_internal): Handle PKU ISA
	flag.
	* config/i386/i386.c (ix86_target_string): Add "-mpku" to
	ix86_target_opts.
	(ix86_option_override_internal): Define PTA_PKU, mention new key
	in skylake-avx512. Handle new ISA bits.
	(ix86_valid_target_attribute_inner_p): Add "pku".
	(enum ix86_builtins): Add IX86_BUILTIN_RDPKRU and IX86_BUILTIN_WRPKRU.
	(builtin_description bdesc_special_args[]): Add new built-ins.
	* config/i386/i386.h (define TARGET_PKU): New.
	(define TARGET_PKU_P): Ditto.
	* config/i386/i386.md (define_c_enum "unspecv"): Add UNSPEC_PKU.
	(define_expand "rdpkru"): New.
	(define_insn "*rdpkru"): Ditto.
	(define_expand "wrpkru"): Ditto.
	(define_insn "*wrpkru"): Ditto.
	* config/i386/i386.opt (mpku): Ditto.
	* config/i386/pkuintrin.h: New file.
	* config/i386/x86intrin.h: Include pkuintrin.h
	* doc/extend.texi: Describe new built-ins.
	* doc/invoke.texi: Describe new switches.
gcc/testsuite/
	* g++.dg/other/i386-2.C: Add -mpku.
	* g++.dg/other/i386-3.C: Ditto.
	* gcc.target/i386/rdpku-1.c: New test.
	* gcc.target/i386/sse-12.c: Add -mpku.
	* gcc.target/i386/sse-13.c: Ditto.
	* gcc.target/i386/sse-22.c: Ditto.
	* gcc.target/i386/sse-33.c: Ditto.
	* gcc.target/i386/wrpku-1.c: New test.

From-SVN: r231944
2015-12-24 11:05:34 +00:00
Ilya Enkovich d0470103a9 re PR target/68416 ([MPX] GCC emits a lot of redundant bndmov instructions)
gcc/

2015-11-26  Vladimir Makarov  <vmakarov@redhat.com>

	PR target/68416
	* config/i386/i386.h (enum reg_class): Add
	bounds registers to ALL_REGS.

gcc/testsuite/

2015-11-26  Ilya Enkovich  <enkovich.gnu@gmail.com>

	PR target/68416
	* gcc.target/i386/mpx/pr68416.c: New test.

From-SVN: r230938
2015-11-26 11:49:20 +00:00
Uros Bizjak 0076c82f76 re PR target/68263 (Vector "*mov<mode>_internal" fails to handle misaligned load/store from reload)
PR target/68263
	* config/i386/i386.h (BIGGEST_ALIGNMENT): Always define
	to 32 for IAMCU.
	* config/i386/sse.md (*mov<mode>_internal): Always enable
	AVX and SSE unaligned moves for IAMCU.

From-SVN: r230456
2015-11-17 10:45:35 +01:00
Trevor Saunders ab7b56730b always define TARGET_PECOFF
gcc/ChangeLog:

2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/i386/i386.h (TARGET_PECOFF): Remove define.
	* defaults.h (TARGET_PECOFF): New default definition.
	* varasm.c (handle_vtv_comdat_section): Adjust.

gcc/cp/ChangeLog:

2015-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* vtable-class-hierarchy.c (vtv_generate_init_routine): Adjust.

From-SVN: r230391
2015-11-15 00:17:56 +00:00
Richard Henderson 00402c9415 i386: Add address spaces for fs/gs segments and tls
* config/i386/i386-c.c (ix86_target_macros): Define __SEG_FS,
        __SEG_GS, __SEG_TLS.
        (ix86_register_pragmas): Register address spaces __seg_fs,
        __seg_gs, __seg_tls.
        * config/i386/i386-protos.h (enum ix86_address_seg): Remove.
        (ADDR_SPACE_SEG_FS, ADDR_SPACE_SEG_GS, ADDR_SPACE_SEG_TLS): New.
        (struct ix86_address): Use addr_space_t instead of ix86_address_seg.
        * config/i386/i386.c (ix86_decompose_address): Likewise.
        (ix86_legitimate_address_p): Likewise.
        (memory_address_length): Likewise.  Check mem address space too.
        (ix86_print_operand): Use ix86_print_operand_address_as.
        (ix86_print_operand_address_as): Rename from
        ix86_print_operand_address, add new addr_space_t parameter.
        Validate that either the parameter or the ix86_address segment
        is default address space.  Handle ADDR_SPACE_SEG_TLS.
        (ix86_print_operand_address): New.
        (ix86_addr_space_subset_p, TARGET_ADDR_SPACE_SUBSET_P): New.
        (ix86_addr_space_convert, TARGET_ADDR_SPACE_CONVERT): New.
        (ix86_addr_space_debug, TARGET_ADDR_SPACE_DEBUG): New.
        (ix86_addr_space_zero_address_valid): New.
        (TARGET_ADDR_SPACE_ZERO_ADDRESS_VALID): New.
        * config/i386/i386.h (DEFAULT_TLS_SEG_REG): Use addr_space_t constants.
        * config/i386/rdos.h (DEFAULT_TLS_SEG_REG): Likewise.
        * config/i386/predicates.md (address_no_seg_operand): Likewise.
        (vsib_address_operand): Likewise.
        (address_mpx_no_base_operand): Likewise.
        (address_mpx_no_index_operand): Likewise.
        * doc/extend.texi (x86 Named Address Spaces): New section.

        * gcc.target/i386/addr-space-1.c: New test.
        * gcc.target/i386/addr-space-2.c: New test.
        * gcc.target/i386/addr-space-3.c: New test.

From-SVN: r230003
2015-11-09 01:20:21 -08:00
H.J. Lu c207fd9958 Properly handle -miamcu and -march=lakemont
-miamcu specifies how parameters are passed to functions and how value
is returned from a function.  Inside function,  we can use instructions
supported by -march=XXX.  -miamcu -march=haswell can generate x87, SSE
and AVX instructions as long as the IA MCU psABI is followed.  But since
Lakemont processor doesn't support x87 instructions, we shouldn't
generate x87 instructions with -march=lakemont.  This patch separates
code generation from -miamcu and makes -march=lakemont not to generate
x87 instructions.

gcc/

	PR target/67963
	PR target/67985
	* common/config/i386/i386-common.c (ix86_handle_option): Remove
	OPT_miamcu handling.
	* config/i386/i386.c (PTA_NO_80387): New macro.
	(processor_alias_table): Add PTA_NO_80387 to lakemont.
	(ix86_option_override_internal): Update MASK_80387 from
	PTA_NO_80387.  Don't warn x87/MMX/SSE/AVX for -miamcu.  Warn
	SSE math only if 80387 is supported.  Don't change
	MASK_FLOAT_RETURNS.
	(ix86_valid_target_attribute_tree): Enable FPMATH_387 only if
	80387 is supported.
	* config/i386/i386.h (TARGET_FLOAT_RETURNS_IN_80387): True only
	if TARGET_80387 is true and TARGET_IAMCU is false.
	(TARGET_FLOAT_RETURNS_IN_80387_P): True only if TARGET_80387_P
	is true and TARGET_IAMCU_P is false.

gcc/testsuite/

	PR target/67963
	PR target/67985
	* gcc.target/i386/pr67963-1.c: New test.
	* gcc.target/i386/pr67963-2.c: Likewise.
	* gcc.target/i386/pr67963-3.c: Likewise.
	* gcc.target/i386/pr67985-1.c: Likewise.
	* gcc.target/i386/pr67985-2.c: Likewise.
	* gcc.target/i386/pr67985-3.c: Likewise.

From-SVN: r229082
2015-10-20 08:12:37 -07:00
Uros Bizjak 1a6e82b8c0 i386.c (classify_argument): Use CEIL where applicable.
* config/i386/i386.c (classify_argument): Use CEIL where applicable.
	(ix86_function_arg_advance): Ditto.
	(ix86_function_arg): Ditto.
	(ix86_gimplify_va_arg): Ditto.
	(ix86_class_max_nregs): Ditto.
	(inline_memory_move_cost): Ditto.
	(ix86_set_reg_reg_cost): Ditto.
	* config/i386/i386.h (HARD_REGNO_NREGS): Ditto.

From-SVN: r228776
2015-10-13 20:56:48 +02:00
Uros Bizjak cba9c78977 re PR target/66697 (Feature request: -mstackrealign and force_align_arg_pointer for x86_64)
PR target/66697
	* config/i386/i386.c (ix86_option_override_internal): Always use
	8-byte minimum stack boundary in 64-bit mode.
	(ix86_compute_frame_layout): Remove assert on INCOMING_STACK_BOUNDARY.
	(ix86_emit_save_reg_using_mov): Support unaligned SSE store.
	Add a REG_CFA_EXPRESSION note if needed.
	(ix86_emit_restore_sse_regs_using_mov): Support unaligned SSE load.
	(ix86_handle_force_align_arg_pointer_attribute): New.
	(ix86_minimum_incoming_stack_boundary): Remove TARGET_64BIT check.
	(ix86_attribute_table): Set ix86_force_align_arg_pointer_string
	with ix86_handle_force_align_arg_pointer_attribute.
	* config/i386/i386.h (MIN_STACK_BOUNDARY): Set to BITS_PER_WORD.

testsuite/ChangeLog:

	PR target/66697
	* gcc.target/i386/20060512-1.c: Remove ia32 requirement.
	(PUSH, POP): New defines.
	(sse2_test): Use PUSH and POP to misalign runtime stack.
	* gcc.target/i386/20060512-2.c: Remove ia32 requirement.

From-SVN: r228577
2015-10-07 19:42:09 +02:00
H.J. Lu 1f3ccbc8e5 Define x86 CALL_USED_REGISTERS_MASK
Define x86 CALL_USED_REGISTERS_MASK used on x86 CALL_USED_REGISTERS.

	* config/i386/i386.c (ix86_conditional_register_usage): Use
	CALL_USED_REGISTERS_MASK.
	* config/i386/i386.h (CALL_USED_REGISTERS_MASK): New macro.

From-SVN: r228568
2015-10-07 06:47:12 -07:00
Venkataramanan Kumar 9ce29eb05d AMD znver1 enablement.
2015-10-06  Venkataramanan Kumar  <Venkataramanan.kumar@amd.com>
	
	AMD znver1 enablement. 
	* config.gcc (i[34567]86-*-linux* | ...): Add znver1.
	(case ${target}): Add znver1.
	* config/i386/cpuid.h(bit_CLZERO):  Define.
	* config/i386/driver-i386.c: (host_detect_local_cpu): Let
	-march=native recognize znver1 processors. 
	* config/i386/i386-c.c (ix86_target_macros_internal): Add
	znver1, clzero def_and_undef. 
	* config/i386/i386.c (struct processor_costs znver1_cost): New.
	(m_znver1): New definition.
	(m_AMD_MULTIPLE): Includes m_znver1.
	(processor_target_table): Add znver1 entry.
	(ix86_target_string) : Add clzero entry.
	(static const char *const cpu_names): Add znver1 entry.
	(ix86_option_override_internal): Add znver1 instruction sets.
	(PTA_CLZERO) :  New definition.
	(ix86_option_override_internal): Handle new clzerooption.
	(ix86_issue_rate): Add znver1.
	(ix86_adjust_cost): Add znver1.                
	(ia32_multipass_dfa_lookahead): Add znver1.
	(has_dispatch): Add znver1.       
	* config/i386/i386.h (TARGET_znver1): New definition. 
	(TARGET_CLZERO): Define.
	(TARGET_CLZERO_P): Define.
	(struct ix86_size_cost): Add TARGET_ZNVER1.
	(enum processor_type): Add PROCESSOR_znver1.
	* config/i386/i386.md (define_attr "cpu"): Add znver1.
	(set_attr znver1_decode): New definitions for znver1.
	* config/i386/i386.opt (flag_dispatch_scheduler): Add znver1.
	(mclzero): New.
	* config/i386/mmx.md (set_attr znver1_decode): New definitions
	for znver1.
	* config/i386/sse.md (set_attr znver1_decode): Likewise.
	* config/i386/x86-tune.def:  Add znver1 tunings.
	* config/i386/znver1.md: Introduce znver1 cpu and include new md file.
	* gcc/doc/invoke.texi: Add details about znver1

From-SVN: r228520
2015-10-06 12:48:41 +00:00
Uros Bizjak 54070b5155 system.h (ROUND_UP): New macro definition.
* system.h (ROUND_UP): New macro definition.
	(ROUND_DOWN): Ditto.
	* ggc-page.c (ROUND_UP): Remove local macro definition.
	(PAGE_ALIGN): Implement using ROUND_UP macro.

	* config/i386/i386.h (PUSH_ROUNDING): Implement using ROUND_UP macro.
	* config/i386/i386.c (function_arg_advance_64): Use ROUND_UP macro
	to align values.
	(ix86_compute_frame_layout): Ditto.
	(ix86_expand_prologue): Ditto.
	(ix86_adjust_stack_and_probe): Use ROUND_DOWN macro
	to round down values.
	(expand_set_or_movmem_via_rep): Ditto.

From-SVN: r228410
2015-10-02 20:08:59 +02:00
H.J. Lu 2d6b2e2831 Rename IA MCU processor lakemount to lakemont
IA MCU processor name is lakemont, not lakemount.

gcc/

	* config.gcc (x86_archs): Replace lakemount with lakemont.
	(with_cpu): Likewise.
	(with_arch): Likewise.
	* config/i386/i386-c.c (ix86_target_macros_internal): Replace
	PROCESSOR_LAKEMOUNT with PROCESSOR_LAKEMONT.  Replace
	__tune_lakemount__ with __tune_lakemont__.
	* config/i386/i386.c (lakemount_cost): Renamed to ...
	(lakemont_cost): This.
	(m_LAKEMOUNT): Renamed to ...
	(m_LAKEMONT): This.
	(initial_ix86_arch_features): Replace m_LAKEMOUNT with m_LAKEMONT.
	(processor_target_table): Replace "lakemount" with "lakemont".
	(processor_alias_table): Likewise.
	(ix86_issue_rate): Replace PROCESSOR_LAKEMOUNT with
	PROCESSOR_LAKEMONT.
	(ix86_adjust_cost): Likewise.
	(ia32_multipass_dfa_lookahead): Likewise.
	* config/i386/i386.h (processor_type): Likewise.
	* config/i386/x86-tune.def: Replace m_LAKEMOUNT with m_LAKEMONT.
	* doc/invoke.texi: Replace lakemount with lakemont.  Replace
	Lakemount with Lakemont.

gcc/testsuite/

	* gcc.target/i386/pr66749.c (dg-options): Replace
	-mtune=lakemount with -mtune=lakemont.
	* gcc.target/i386/pr66821.c (dg-options): Likewise.
	* gcc.target/i386/pr67329.c (dg-options): Likewise.

From-SVN: r228115
2015-09-25 04:24:07 -07:00
H.J. Lu 89e5941d8c Change IA MCU processor from iamcu to lakemount
The first IA MCU processor will be Lakemount.  This patch changes IA MCU
processor name from iamcu to lakemount.

gcc/

	* config.gcc (x86_archs): Replace iamcu with lakemount.
	(with_cpu): Likewise.
	(with_arch): Likewise.
	* doc/invoke.texi: Likewise.
	* config/i386/i386-c.c (ix86_target_macros_internal): Replace
	PROCESSOR_IAMCU with PROCESSOR_LAKEMOUNT.  Replace
	__tune_iamcu__ with __tune_lakemount__.
	* config/i386/i386.c (iamcu_cost): Renamed to ...
	(lakemount_cost): This.
	(m_IAMCU): Renamed to ...
	(m_LAKEMOUNT): This.
	(initial_ix86_arch_features): Replace m_IAMCU with m_LAKEMOUNT.
	(processor_target_table): Replace "iamcu" with "lakemount".
	(processor_alias_table): Likewise.
	(ix86_issue_rate): Replace PROCESSOR_IAMCU with
	PROCESSOR_LAKEMOUNT.
	(ix86_adjust_cost): Likewise.
	(ia32_multipass_dfa_lookahead): Likewise.
	* config/i386/i386.h (processor_type): Likewise.
	* config/i386/x86-tune.def: Replace m_IAMCU with m_LAKEMOUNT.

gcc/testsuite/

	* gcc.target/i386/pr66749.c (dg-options): Replace -mtune=iamcu
	with -mtune=lakemount.
	* gcc.target/i386/pr66821.c (dg-options): Likewise.
	* gcc.target/i386/pr67329.c (dg-options): Likewise.

From-SVN: r228109
2015-09-24 17:18:21 -07:00
Kirill Yukhin 06caf59d7f AVX-512. Introduce SKylake server CPU.
gcc/
	* config.gcc: Support "skylake-avx512".
        * config/i386/i386-c.c (ix86_target_macros_internal): Handle
        PROCESSOR_SKYLAKE_AVX512.
        * config/i386/i386.c (m_SKYLAKE_AVX512): Define.
        (processor_target_table): Add "skylake-avx512".
        (PTA_SKYLAKE_AVX512): Define.
	(ix86_option_override_internal): Add "skylake_avx512".
        (fold_builtin_cpu): Handle "skylake_avx512", add F_AVX512VL
	F_AVX512BW, F_AVX512DQ, F_AVX512ER, F_AVX512PF, F_AVX512CD.
        * config/i386/i386.h (TARGET_SKYLAKE_AVX512): Define.
        (processor_type): Add PROCESSOR_SKYLAKE_AVX512.
	* doc/invoke.texi (skylake-avx512): New.

libgcc/
	* libgcc/config/i386/cpuinfo.c (enum processor_features): Add
	FEATURE_AVX512VL, FEATURE_AVX512BW, FEATURE_AVX512DQ,
	FEATURE_AVX512CD, FEATURE_AVX512ER, FEATURE_AVX512PF.
	(get_available_features): Habdle new features.

gcc/testsuite/
        * gcc.target/i386/funcspec-5.c: Test avx512vl, avx512bw,
	avx512dq, avx512cd, avx512er, avx512pf and skylake-avx512.
	* gcc.target/i386/builtin_target.c: Test  avx512vl, avx512bw,
	avx512dq, avx512cd, avx512er and avx512pf.

From-SVN: r228009
2015-09-22 11:10:21 +00:00