summaryrefslogtreecommitdiff
path: root/gcc/config/i386
Commit message (Collapse)AuthorAgeFilesLines
* Add round_nimm_scalar_predicate and use xBmhjl/pr69171/masterH.J. Lu2016-01-072-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add round_nimm_scalar_predicate for scalar SSE integer to floating point conversions since round_nimm_predicate is for vector operand. round_constraint can't be used on vector SSE patterns since it is mapped to "vm". The "xBm" constraint must be used in this case. gcc/ PR target/69171 * config/i386/sse.md (<sse>_sqrt<mode>2<mask_name><round_name>): Use the "xBm" constraint. (float<sseintvecmodelower><mode>2<mask_name><round_name): Likewise. (sse_cvtsi2ss<round_name>): Use round_nimm_scalar_predicate. (sse_cvtsi2ssq<round_name>): Likewise. (sse_cvtss2si<round_name>): Likewise. (sse_cvtss2siq<round_name>): Likewise. (sse2_cvtsi2sdq<round_name>): Likewise. (sse2_cvtsd2si<round_name>): Likewise. (sse2_cvtsd2siq<round_name>): Likewise. * config/i386/subst.md (round_nimm_scalar_predicate): New predicate. gcc/testsuite/ PR target/69171 * gcc.target/i386/pr69171-1.c: New test. * gcc.target/i386/pr69171-2.c: Likewise. * gcc.target/i386/pr69171-3.c: Likewise. * gcc.target/i386/pr69171-4.c: Likewise. * gcc.target/i386/pr69171-5.c: Likewise. * gcc.target/i386/pr69171-6.c: Likewise.
* Use vector_operand on SSE with 16b memory operandhjl2016-01-054-245/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add vector_operand, which is vector_memory_operand or register_operand, and use it, instead of nonimmediate_operand, in SSE patterns with 16-byte memory operand. gcc/ PR target/68991 * config/i386/i386.c (ix86_expand_vector_logical_operator): Replace nonimmediate_operand with vector_operand. * config/i386/predicates.md (vector_operand): New predicate. (general_vector_operand): Replace nonimmediate_operand with vector_operand. * config/i386/sse.md: Replace nonimmediate_operand with vector_operand and m constraint with Bm constraint on SSE patterns with 16-byte memory operand. * config/i386/subst.md (round_nimm_predicate): Replace nonimmediate_operand with vector_operand. (round_saeonly_nimm_predicate): Likewise. (round_saeonly_nimm_scalar_predicate): New. gcc/testsuite/ PR target/68991 * gcc.target/i386/pr68991.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232088 138bc75d-0d04-0410-961f-82ee72b054a4
* Add vector_memory_operand and "Bm" constrainthjl2016-01-053-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | SSE vector arithmetic and logic instructions only accept aligned memory operand. This patch adds vector_memory_operand and "Bm" constraint for aligned SSE memory operand. They are applied to SSE plusminus and any_logic patterns. gcc/ PR target/68991 * config/i386/constraints.md (Bm): New constraint. * config/i386/predicates.md (vector_memory_operand): New predicate. * config/i386/sse.md: Replace xm with xBm in plusminus and any_logic patterns. gcc/testsuite/ PR target/68991 * g++.dg/pr68991-1.C: New test. * g++.dg/pr68991-2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232087 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/66655nickc2016-01-051-0/+5
| | | | | | | | * config/i386/cygming.h (MAKE_DECL_ONE_ONLY): Define to use weak decls if weak support is available. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232071 138bc75d-0d04-0410-961f-82ee72b054a4
* Update copyright years.jakub2016-01-04171-172/+171
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232055 138bc75d-0d04-0410-961f-82ee72b054a4
* Add missing intrinsic file.kyukhin2015-12-241-0/+56
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231945 138bc75d-0d04-0410-961f-82ee72b054a4
* Introduce support for PKU instructions.kyukhin2015-12-248-4/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231944 138bc75d-0d04-0410-961f-82ee72b054a4
* [PATCH] Allow indirect call via GOT for 64-bit Pmode x32uros2015-12-232-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: H.J. Lu <hongjiu.lu@intel.com> Since Pmode is 64-bit with -maddress-mode=long for x32, indirect call via GOT slot doesn't need zero_extend. This patch enables indirect call via GOT for x32 with 64-bit Pmode. gcc/ PR target/66232 * config/i386/constraints.md (Bs): Allow GOT slot for x32 with 64-bit Pmode. (Bw): Likewise. (Bz): Likewise. * config/i386/predicates.md (call_insn_operand): Likewise. (sibcall_insn_operand): Likewise. gcc/testsuite/ PR target/66232 * gcc.target/i386/pr66232-10.c: New test. * gcc.target/i386/pr66232-11.c: Likewise. * gcc.target/i386/pr66232-12.c: Likewise. * gcc.target/i386/pr66232-13.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231923 138bc75d-0d04-0410-961f-82ee72b054a4
* [PATCH] Use call-clobbered register for sibcall via GOTuros2015-12-223-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: H.J. Lu <hongjiu.lu@intel.com> Since sibcall never returns, we can only use call-clobbered register as GOT base. Otherwise, callee-saved register used as GOT base won't be properly restored. sibcall_memory_operand is changed to allow 32-bit GOT slot only with pseudo register as GOT base for RTL expansion. 2 new patterns, *sibcall_GOT_32 and *sibcall_value_GOT_32, are added to expose GOT base register to register allocator so that call-clobbered register will be used for GOT base. gcc/ PR target/68937 * config/i386/i386.c (ix86_function_ok_for_sibcall): Count call to global function via GOT slot as indirect call. * config/i386/i386.md (*sibcall_GOT_32): New pattern. (*sibcall_value_GOT_32): Likewise. * config/i386/predicates.md (sibcall_memory_operand): Rewrite. Allow 32-bit GOT slot only with pseudo register as GOT base. (GOT32_symbol_operand): New predicate. gcc/testsuite/ PR target/68937 * gcc.target/i386/pr68937-1.c: New test. * gcc.target/i386/pr68937-2.c: Likewise. * gcc.target/i386/pr68937-3.c: Likewise. * gcc.target/i386/pr68937-4.c: Likewise. * gcc.target/i386/pr68937-5.c: Likewise. * gcc.target/i386/pr68937-6.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231903 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/64910law2015-12-211-1/+1
| | | | | | | | | * config/i386/i386.md (testqi_ext_3): Allow HImode. PR tree-optimization/64910 * gcc.target/i386/bittest.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231871 138bc75d-0d04-0410-961f-82ee72b054a4
* Update typedefs for integer types in config/i386/djgpp-stdint.handris2015-12-181-11/+11
| | | | | | | * config/i386/djgpp-stdint.h: update typedefs for integer types git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231804 138bc75d-0d04-0410-961f-82ee72b054a4
* Only support -gstabs on Mac OS X if assember supports it (PR target/67973)ro2015-12-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc: PR target/67973 * configure.ac (gcc_cv_as_stabs_directive): New test. * configure: Regenerate. * config.in: Regenerate. * config/darwin.h (DBX_DEBUGGING_INFO): Wrap in HAVE_AS_STABS_DIRECTIVE. (PREFERRED_DEBUGGING_TYPE): Likewise. * config/i386/darwin.h (PREFERRED_DEBUGGING_TYPE): Only include DBX_DEBUG if HAVE_AS_STABS_DIRECTIVE. * doc/sourcebuild.texi (Effective-Target Keywords, Environment attributes): Document stabs. gcc/testsuite: PR target/67973 * lib/target-supports.exp (check_effective_target_stabs): New proc. * g++.dg/cpp0x/alias-decl-debug-0.C: Restrict to stabs targets. * g++.dg/other/PR23205.C: Likewise. * g++.dg/other/pr23205-2.C: Likewise. * gcc.dg/20040813-1.c: Likewise. * gcc.dg/darwin-20040809-2.c: Likewise. * objc.dg/stabs-1.m: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231747 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/kyukhin2015-12-161-2/+0
| | | | | | | | * config/i386/i386-c.c (ix86_target_macros_internal): Remove duplicate check (__CLZERO__). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231688 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix PR target/67484marxin2015-12-111-2/+3
| | | | | | | | | | | | Uros Bizjak <ubizjak@gmail.com> PR target/67484 * config/i386/i386.c (ix86_valid_target_attribute_tree): Use ggc_strdup to copy option_strings to opts->x_ix86_arch_string and opts->x_ix86_tune_string. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231556 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/ienkovich2015-12-111-1/+2
| | | | | | | | | | | | * config/i386/i386.c (ix86_get_mask_mode): Use scalar modes for 32 and 16 byte boolean vectors when possible. gcc/testsuite/ * gcc.dg/vect/vect-32-chars.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231553 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/68701uros2015-12-081-0/+11
| | | | | | | | | | | | | | | | * config/i386/i386.c (ix86_option_override_internal): Enable -maccumulate-outgoing-args when %ebp is fixed due to stack realignment requirements. testsuite/ChangeLog: PR target/68701 * testsuite/gcc.target/i386/pr68701-1.c: New test. * testsuite/gcc.target/i386/pr68701-2.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231419 138bc75d-0d04-0410-961f-82ee72b054a4
* AVX-512. Fix assembler section for broadcast pattern.kyukhin2015-12-081-2/+3
| | | | | | | | | gcc/ * config/i386/sse.md (define_insn "<avx512>_vec_dup<mode>_1"): Fix assembler to make source always 128bit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231410 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/i386/i386.c (ix86_emit_swsqrtsf): Cleanupuros2015-12-081-9/+4
| | | | | | | | infinity filterning code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231397 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/68627kyukhin2015-12-071-4/+5
| | | | | | | | | | | gcc/ * config/i386/sse.md: Make 'v' alternative work on 'avx512f' ISA only. Force destination to 512 bits register. gcc/testsuite/ * gfortran.dg/pr68627.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231361 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/68633kyukhin2015-12-071-3/+3
| | | | | | | | | | | | | gcc/ * config/i386/sse.md (define_insn "kunpckhi"): Fix operands order. (define_insn "kunpcksi"): Ditto. (define_insn "kunpckdi"): Ditto. gcc/testsuite * gcc.target/i386/pr68633.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231359 138bc75d-0d04-0410-961f-82ee72b054a4
* support for AMD clzero isa.vekumar2015-12-066-4/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc/ChangeLog 2015-12-06 Victoria Stepanyan <victoria.stepanyan@amd.com> * common/config/i386/i386-common.c (OPTION_MASK_ISA_CLZERO_SET): New. (ix86_handle_option): Handle clzero. * config.gcc (i[34567]86-*-*): Add clzerointrin.h, (x86_64-*-*): Likewise. * config/i386/clzerointrin.h: New header. * config/i386/cpuid.h (bit_CLZERO): Define. * config/i386/driver-i386.c (host_detect_local_cpu): Detect CLZERO support. * config/i386/i386.opt (clzero): New. * config/i386/i386-c.c: Define __CLZERO__ if needed. * config/i386/i386.c (ix86_target_string): Define -mclzero option. (PTA_CLZERO): New. (ix86_option_override_internal): Handle new option. (processor_alias_table): Added PTA_CLZERO. (ix86_valid_target_attribute_inner_p): Add OPT_mclzero. (ix86_builtins): Add IX86_BUILTIN_CLZERO, IX86_BUILTIN_CLZERO. (ix86_expand_builtin): Handle IX86_BUILTIN_CLZERO and IX86_BUILTIN_CLZERO built-ins. * config/i386/i386.h (TARGET_CLZERO): New. * config/i386/i386.md (unspecv): Add UNSPEC_CLZERO. (clzero): New pattern. (clzero_<mode>): New pattern. * config/i386/x86intrin.h: Include clzerointrin.h. * doc/extend.texi: Document clzero builtins. * doc/invoke.texi: Document -mclzero option. gcc/testsuite/ChangeLog 2015-12-06 Victoria Stepanyan <victoria.stepanyan@amd.com> * gcc.target/i386/clzero.c: New. * gcc.target/i386/sse-12.c: Add -mclzero. * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231340 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/ienkovich2015-12-041-1/+1
| | | | | | | | * config/i386/sse.md (<avx512>_store<mode>_mask): Fix operand checked for alignment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231269 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/68655jakub2015-12-041-17/+86
| | | | | | | | | | | | | | | | * config/i386/i386.c (canonicalize_vector_int_perm): New function. (expand_vec_perm_1): Use it and recurse if everything else failed. Use nd.perm instead of perm2. (expand_vec_perm_even_odd_1): If testing_p, use gen_raw_REG instead of gen_lowpart for the target. (ix86_expand_vec_perm_const_1): Use canonicalize_vector_int_perm and recurse if everything else failed. * gcc.dg/torture/vshuf-4.inc (TESTS): Add one extra test. * gcc.dg/torture/vshuf-4.inc (TESTS): Add two extra tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231247 138bc75d-0d04-0410-961f-82ee72b054a4
* Add an rsqrt_optab and IFN_RSQRT internal functionrsandifo2015-12-031-53/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All current uses of builtin_reciprocal convert 1.0/sqrt into rsqrt. This patch adds an rsqrt optab and associated internal function for that instead. We can then pick up the vector forms of rsqrt automatically, fixing an AArch64 regression from my internal_fn patches. With that change, builtin_reciprocal only needs to handle target-specific built-in functions. I've restricted the hook to those since, if we need a reciprocal of another standard function later, I think there should be a strong preference for adding a new optab and internal function for it, rather than hiding the code in a backend. Three targets implement builtin_reciprocal: aarch64, i386 and rs6000. i386 and rs6000 already used the obvious rsqrt<mode>2 pattern names for the instructions, so they pick up the new code automatically. aarch64 needs a slight rename. mn10300 is unusual in that its native operation is rsqrt, and sqrt is approximated as 1.0/rsqrt. The port also uses rsqrt<mode>2 for the rsqrt pattern, so after the patch we now pick it up as a native operation. Two other ports define rsqrt patterns: sh and v850. AFAICT these patterns aren't currently used, but I think the patch does what the authors of the patterns would have expected. There's obviously some risk of fallout though. Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnueabihf (as a target without the hooks) and powerpc64-linux-gnu. gcc/ * internal-fn.def (RSQRT): New function. * optabs.def (rsqrt_optab): New optab. * doc/md.texi (rsqrtM2): Document. * target.def (builtin_reciprocal): Replace gcall argument with a function decl. Restrict hook to machine functions. * doc/tm.texi: Regenerate. * targhooks.h (default_builtin_reciprocal): Update prototype. * targhooks.c (default_builtin_reciprocal): Likewise. * tree-ssa-math-opts.c: Include internal-fn.h. (internal_fn_reciprocal): New function. (pass_cse_reciprocals::execute): Call it, and build a call to an internal function on success. Only call targetm.builtin_reciprocal for machine functions. * config/aarch64/aarch64-protos.h (aarch64_builtin_rsqrt): Remove second argument. * config/aarch64/aarch64-builtins.c (aarch64_expand_builtin_rsqrt): Rename aarch64_rsqrt_<mode>2 to rsqrt<mode>2. (aarch64_builtin_rsqrt): Remove md_fn argument and only handle machine functions. * config/aarch64/aarch64.c (use_rsqrt_p): New function. (aarch64_builtin_reciprocal): Replace gcall argument with a function decl. Use use_rsqrt_p. Remove optimize_size check. Only handle machine functions. Update call to aarch64_builtin_rsqrt. (aarch64_optab_supported_p): New function. (TARGET_OPTAB_SUPPORTED_P): Define. * config/aarch64/aarch64-simd.md (aarch64_rsqrt_<mode>2): Rename to... (rsqrt<mode>2): ...this. * config/i386/i386.c (use_rsqrt_p): New function. (ix86_builtin_reciprocal): Replace gcall argument with a function decl. Use use_rsqrt_p. Remove optimize_insn_for_size_p check. Only handle machine functions. (ix86_optab_supported_p): Handle rsqrt_optab. * config/rs6000/rs6000.c (TARGET_OPTAB_SUPPORTED_P): Define. (rs6000_builtin_reciprocal): Replace gcall argument with a function decl. Remove optimize_insn_for_size_p check. Only handle machine functions. (rs6000_optab_supported_p): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231229 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix some issues with the ROP patch (PR 68471, 68472)bernds2015-12-032-1/+3
| | | | | | | | | | | | | | | | PR target/68471 PR target/68472 * config/i386/i386.c (ix86_mitigate_rop): Don't call compute_bb_for_insn again. Call df_insn_rescan_all. * config/i386/i386.md (set_got_rex64): Override modrm_class. * regrename.c (build_def_use): Ignore stack regs if regstack_completed. testsuite/ * gcc.target/i386/rop1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231228 138bc75d-0d04-0410-961f-82ee72b054a4
* AVX-512. Split out mask version for vec_extract_hi_<mode>.kyukhin2015-12-021-18/+26
| | | | | | | | | | | | | gcc/ * config/i386/sse.md (define_insn "vec_extract_hi_<mode>_maskm"): Remove "prefix_extra". (define_insn "vec_extract_hi_<mode>_mask"): New. (define_insn "vec_extract_hi_<mode>"): Remove masking. gcc/testsuite/ * gcc.target/i386/avx512vl-vextractf32x4-1.c: Fix scan pattern. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231167 138bc75d-0d04-0410-961f-82ee72b054a4
* PR 68432: Add a target hook to control size/speed optab choicesrsandifo2015-12-022-68/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem in the PR is that some i386 optabs FAIL when optimising for size rather than speed. The gimple level generally needs access to this information before calling the generator, so this patch adds a new hook to say whether an optab should be used when optimising for size or speed. It also has a "both" option for cases where we want code that is optimised for both size and speed. I've passed the optab to the target hook because I think in most cases that's more useful than the instruction code. We could pass both if there's a use for it though. At the moment the match-and-simplify code doesn't have direct access to the target block, so for now I've used "both" there. Tested on x86_64-linux-gnu and powerpc64-linux-gnu. gcc/ PR tree-optimization/68432 * coretypes.h (optimization_type): New enum. * doc/tm.texi.in (TARGET_OPTAB_SUPPORTED_P): New hook. * doc/tm.texi: Regenerate. * target.def (optab_supported_p): New hook. * targhooks.h (default_optab_supported_p): Declare. * targhooks.c (default_optab_supported_p): New function. * predict.h (function_optimization_type): Declare. (bb_optimization_type): Likewise. * predict.c (function_optimization_type): New function. (bb_optimization_type): Likewise. * optabs-query.h (convert_optab_handler): Define an overload that takes an optimization type. (direct_optab_handler): Likewise. * optabs-query.c (convert_optab_handler): Likewise. (direct_optab_handler): Likewise. * internal-fn.h (direct_internal_fn_supported_p): Take an optimization_type argument. * internal-fn.c (direct_optab_supported_p): Likewise. (multi_vector_optab_supported_p): Likewise. (direct_internal_fn_supported_p): Likewise. * builtins.c (replacement_internal_fn): Update call to direct_internal_fn_supported_p. * gimple-match-head.c (build_call_internal): Likewise. * tree-vect-patterns.c (vect_recog_pow_pattern): Likewise. * tree-vect-stmts.c (vectorizable_internal_function): Likewise. * tree.c (maybe_build_call_expr_loc): Likewise. * config/i386/i386.c (ix86_optab_supported_p): New function. (TARGET_OPTAB_SUPPORTED_P): Define. * config/i386/i386.md (asinxf2): Remove optimize_insn_for_size_p check. (asin<mode>2, acosxf2, acos<mode>2, log1pxf2, log1p<mode>2) (expNcorexf3, expxf2, exp<mode>2, exp10xf2, exp10<mode>2, exp2xf2) (exp2<mode>2, expm1xf2, expm1<mode>2, ldexpxf3, ldexp<mode>3) (scalbxf3, scalb<mode>3, rint<mode>2, round<mode>2) (<rounding_insn>xf2, <rounding_insn><mode>2): Likewise. gcc/testsuite/ * gcc.target/i386/pr68432-1.c: New test. * gcc.target/i386/pr68432-2.c: Likewise. * gcc.target/i386/pr68432-3.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231161 138bc75d-0d04-0410-961f-82ee72b054a4
* PR tree-optimization/68501jakub2015-11-301-4/+28
| | | | | | | | | | | | | | | | | | | | * target.def (builtin_reciprocal): Replace the 3 arguments with a gcall * one, adjust description. * targhooks.h (default_builtin_reciprocal): Replace the 3 arguments with a gcall * one. * targhooks.c (default_builtin_reciprocal): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Use targetm.builtin_reciprocal even on internal functions, adjust the arguments and allow replacing an internal function with normal built-in. * config/i386/i386.c (ix86_builtin_reciprocal): Replace the 3 arguments with a gcall * one. Handle internal fns too. * config/rs6000/rs6000.c (rs6000_builtin_reciprocal): Likewise. * config/aarch64/aarch64.c (aarch64_builtin_reciprocal): Likewise. * doc/tm.texi (builtin_reciprocal): Document. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231075 138bc75d-0d04-0410-961f-82ee72b054a4
* [AVX-512] Enable QI-mode mask logic patterns on non-AVX-512DQ targets.kyukhin2015-11-301-3/+6
| | | | | | | | | gcc/ * config/i386/i386.md (define_mode_iterator SWI1248_AVX512BW): New. (define_insn "*k<logic><mode>"): Use new iterator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231061 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/ienkovich2015-11-261-1/+1
| | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230938 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix PR68497 (ICE with -fno-checking)miyuki2015-11-241-12/+14
| | | | | | | | | | | | | | | gcc/ PR target/68497 * config/i386/i386.c (output_387_binary_op): Fix assertion for -fno-checking case. gcc/testsuite/ PR target/68497 * gcc.target/i386/pr68497.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230803 138bc75d-0d04-0410-961f-82ee72b054a4
* Add uaddv4_optab and usubv4_optabrth2015-11-232-4/+76
| | | | | | | | | | | | | PR target/67089 * optabs.def (uaddv4_optab, usubv4_optab): New. * internal-fn.c (expand_addsub_overflow): Use uaddv4_optab and usubv4_optab in the u +- u -> u case. * doc/md.texi (Standard Names): Document addv{m}4, subv{m}4, mulv{m}4, uaddv{m}4, usubv{m}4, umulv{m}4. * config/i386/i386.md (uaddv<SWI>4, usubv<SWI>4): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230767 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/67770jakub2015-11-191-1/+5
| | | | | | | | | | * config/i386/i386.md (simple_return): Disable if ix86_static_chain_on_stack is true. * gcc.target/i386/pr67770.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230593 138bc75d-0d04-0410-961f-82ee72b054a4
* 2015-11-18 Andreas Tobler <andreast@gcc.gnu.org>andreast2015-11-181-5/+15
| | | | | | | | * config/i386/freebsd.h (ASM_OUTPUT_MAX_SKIP_ALIGN): Bring in the commit from r125920 for FreeBSD. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230565 138bc75d-0d04-0410-961f-82ee72b054a4
* * regrename.h (struct du_head): Add target_data_1 and target_data_2bernds2015-11-183-0/+339
| | | | | | | | | | | | | | | | | | | | fields. * regrename.c (create_new_chain): Clear entire struct after allocating. * config/i386/i386.opt (mmitigate-rop): New option. * doc/invoke.texi (mmitigate-rop): Document. * config/i386/i386.c: Include "regrename.h". (ix86_rop_should_change_byte_p, reg_encoded_number, ix86_get_modrm_for_rop, set_rop_modrm_reg_bits, ix86_mitigate_rop): New static functions. (ix86_reorg): Call ix86_mitigate_rop if -fmitigate-rop. * config/i386/i386.md (attr "modrm_class"): New. (cmp<mode>_ccno_1, mov<mode>_xor, movstrict<mode>_xor, x86_mov<mode>cc_0_m1. x86_mov<mode>cc_0_m1_se) (x86_mov<mode>cc_0_m1_neg): Override modrm_class attribute. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230543 138bc75d-0d04-0410-961f-82ee72b054a4
* gcc/ienkovich2015-11-181-0/+2
| | | | | | | | | PR target/68405 * config/i386/i386.c (ix86_expand_mask_vec_cmp): Add missing break. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230541 138bc75d-0d04-0410-961f-82ee72b054a4
* Simplify ix86_builtin_vectorized_functionrsandifo2015-11-171-63/+0
| | | | | | | | | | | | | | | | After the previous patches it's no longer necessary for TARGET_BUILTIN_VECTORIZED_FUNCTION to return functions that map to the vector optab of the original operation. We'll use a vector form of the internal function instead. Tested on x86_64-linux-gnu. gcc/ * config/i386/i386.c (ix86_builtin_vectorized_function): Remove entries that map directly to optabs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230493 138bc75d-0d04-0410-961f-82ee72b054a4
* Make builtin_vectorized_function take a combined_fnrsandifo2015-11-171-192/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the fndecl argument to builtin_vectorized_function with a combined_fn and gets the vectoriser to call it for internal functions too. The patch also moves vectorisation of machine-specific built-ins to a new hook, builtin_md_vectorized_function. Tested on x86_64-linux-gnu, aarch64-linux-gnu, arm-linux-gnu and powerpc64-linux-gnu. gcc/ * target.def (builtin_vectorized_function): Take a combined_fn (in the form of an unsigned int) rather than a function decl. (builtin_md_vectorized_function): New. * targhooks.h (default_builtin_vectorized_function): Replace the fndecl argument with an unsigned int. (default_builtin_md_vectorized_function): Declare. * targhooks.c (default_builtin_vectorized_function): Replace the fndecl argument with an unsigned int. (default_builtin_md_vectorized_function): New function. * doc/tm.texi.in (TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION): New hook. * doc/tm.texi: Regenerate. * tree-vect-stmts.c (vectorizable_function): Update call to builtin_vectorized_function, also passing internal functions. Call builtin_md_vectorized_function for target-specific builtins. * config/aarch64/aarch64-protos.h (aarch64_builtin_vectorized_function): Replace fndecl argument with an unsigned int. * config/aarch64/aarch64-builtins.c: Include case-cfn-macros.h. (aarch64_builtin_vectorized_function): Update after above changes. Use CASE_CFN_*. * config/arm/arm-protos.h (arm_builtin_vectorized_function): Replace fndecl argument with an unsigned int. * config/arm/arm-builtins.c: Include case-cfn-macros.h (arm_builtin_vectorized_function): Update after above changes. Use CASE_CFN_*. * config/i386/i386.c: Include case-cfn-macros.h (ix86_veclib_handler): Take a combined_fn rather than a built_in_function. (ix86_veclibabi_svml, ix86_veclibabi_acml): Likewise. Use mathfn_built_in rather than calling builtin_decl_implicit directly. (ix86_builtin_vectorized_function) Update after above changes. Use CASE_CFN_*. * config/rs6000/rs6000.c: Include case-cfn-macros.h (rs6000_builtin_vectorized_libmass): Replace fndecl argument with a combined_fn. Use CASE_CFN_*. Use mathfn_built_in rather than calling builtin_decl_implicit directly. (rs6000_builtin_vectorized_function): Update after above changes. Use CASE_CFN_*. Move BUILT_IN_MD to... (rs6000_builtin_md_vectorized_function): ...this new function. (TARGET_VECTORIZE_BUILTIN_MD_VECTORIZED_FUNCTION): Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230491 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/68263uros2015-11-172-7/+7
| | | | | | | | | | | * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230456 138bc75d-0d04-0410-961f-82ee72b054a4
* [i386]Migrate reduction optabs to reduc_<op>_scalalalaw012015-11-161-31/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config/i386/sse.md (reduc_splus_v8df): Rename to... (reduc_plus_scal_v8df): ...here; reduce to temp and extract scalar. (reduc_splus_v4df): Rename to... (reduc_plus_scal_v4df): ...here; reduce to temp and extract scalar. (reduc_splus_v2df): Rename to... (reduc_plus_scal_v2df): ...here; reduce to temp and extract scalar. (reduc_splus_v16sf): Rename to... (reduc_plus_scal_v16sf): ...here; reduce to temp and extract scalar. (reduc_splus_v8sf): Rename to... (reduc_plus_scal_v8sf): ...here; reduce to temp and extract scalar. (reduc_splus_v4sf): Rename to... (reduc_plus_scal_v4sf): ...here; reduce to temp and extract scalar. (reduc_<code>_<mode>, all 3 variants): Rename each to... (reduc_<code>_scal_<mode>): ...here; reduce to temp and extract scalar. (reduc_umin_v8hf): Rename to... (reduc_umin_scal_v8hf): ...here; reduce to temp and extract scalar. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230423 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/i386/i386.c (ix86_adjust_stack_and_probe): Adjust and useebotcazou2015-11-161-38/+41
| | | | | | | | | | an lea instruction when possible. (output_adjust_stack_and_probe): Rotate the loop and simplify. (ix86_emit_probe_stack_range): Adjust. (output_probe_stack_range): Rotate the loop and simplify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230412 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/i386/freebsd.h (SUBTARGET32_DEFAULT_CPU): Change to i586.gerald2015-11-151-4/+1
| | | | | | | Remove support for FreeBSD 5 and earlier. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230397 138bc75d-0d04-0410-961f-82ee72b054a4
* always define TARGET_PECOFFtbsaunde2015-11-151-3/+0
| | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230391 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/i386/predicates.md (misaligned_operand): Return true ifuros2015-11-131-2/+3
| | | | | | | | operand is aligned to less than its natural alignmnet. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230291 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix big memory leak in ix86_valid_target_attribute_pmarxin2015-11-121-0/+2
| | | | | | | | | | | | | | | * config/i386/i386.c (ix86_valid_target_attribute_p): Finalize options at the of the function. * gcc.c (driver_get_configure_time_options): Call newly introduced init_opts_obstack. * lto-wrapper.c (main): Likewise. * opts.c (init_opts_obstack): New function. (init_options_struct): Call newly introduced init_opts_obstack. * opts.h (init_options_struct): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230264 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/67265ebotcazou2015-11-121-2/+0
| | | | | | | | * config/i386/i386.c (ix86_adjust_stack_and_probe): Remove obsolete assertion on the CFA register. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230245 138bc75d-0d04-0410-961f-82ee72b054a4
* * config/i386/i386.c (ix86_legitimate_combined_insn): Rejecturos2015-11-121-4/+5
| | | | | | | | | | | | | | combined insn if the alignment of vector mode memory operand is less than ssememalign. testsuite/ChangeLog: * gcc.target/i386/sse-1.c (swizzle): Assume that a is aligned to 64 bits. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230215 138bc75d-0d04-0410-961f-82ee72b054a4
* PR target/67265ebotcazou2015-11-111-1/+5
| | | | | | | * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230170 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix typo.kyukhin2015-11-111-1/+1
| | | | | | | | | gcc/ * config/i386/i386.c (m_SKYLAKE_AVX512): Fix typo. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230155 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix target arch attribute for Skylake.kyukhin2015-11-111-1/+5
| | | | | | | | | | | | | gcc/ * config/i386/i386.c: Handle "skylake" and "skylake-avx512". gcc/testsuite/ * g++.dg/ext/mv16.C: New functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230153 138bc75d-0d04-0410-961f-82ee72b054a4