diff options
author | Martin Liska <mliska@suse.cz> | 2021-12-28 11:05:52 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-12-28 11:05:52 +0100 |
commit | af458885cf31e1612084d3e7441e233e4fbc397a (patch) | |
tree | df458c871a3fe0c932b69c489e6a70b7be3fc265 /gcc | |
parent | c00c06b78418363632ecd769dddde98455cb4182 (diff) | |
parent | a187edd2b437fc9571d57f771a624963fcce08f8 (diff) | |
download | gcc-af458885cf31e1612084d3e7441e233e4fbc397a.zip gcc-af458885cf31e1612084d3e7441e233e4fbc397a.tar.gz gcc-af458885cf31e1612084d3e7441e233e4fbc397a.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc')
128 files changed, 4225 insertions, 513 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 43d073e..72e36fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,157 @@ +2021-12-27 John David Anglin <danglin@gcc.gnu.org> + + * config/pa/pa-protos.h: Delete + pa_maybe_emit_compare_and_swap_exchange_loop() declaration. + * config/pa/pa.c (pa_expand_compare_and_swap_loop): Delete. + (pa_maybe_emit_compare_and_swap_exchange_loop): Delete. + * config/pa/pa.md (atomic_storeq): Use __sync_lock_test_and_set + instead of pa_maybe_emit_compare_and_swap_exchange_loop. + (atomic_storehi, atomic_storesi, atomic_storedi): Likewise. + +2021-12-27 H.J. Lu <hjl.tools@gmail.com> + + PR target/103762 + * config/i386/constraints.md (BM): New constraint. + * config/i386/i386.md (m): New mode attribute. + Replace the 'm' constraint on <general_operand> with the '<m>' + constraint. + Replace the 'm' constraint on x86_64_general_operand with the + 'BM' constraint. + +2021-12-26 H.J. Lu <hjl.tools@gmail.com> + + PR target/103785 + * config/i386/i386.md: Swap operand order in comments and check + AX input in any_mul_highpart peepholes. + +2021-12-24 Uroš Bizjak <ubizjak@gmail.com> + + PR target/95046 + PR target/103797 + * config/i386/mmx.md (divv2sf3): New instruction pattern. + +2021-12-24 Iain Sandoe <iain@sandoe.co.uk> + + * config/darwin.c (darwin_override_options): Make a comment + more inclusive. + +2021-12-24 Iain Sandoe <iain@sandoe.co.uk> + + * config.gcc: Emit L2_MAX_OFILE_ALIGNMENT with suitable + values for the host. + * config/darwin.c (darwin_emit_common): Error for alignment + values > 32768. + * config/darwin.h (MAX_OFILE_ALIGNMENT): Rework to use the + configured L2_MAX_OFILE_ALIGNMENT. + +2021-12-24 Iain Sandoe <iain@sandoe.co.uk> + + * config/darwin.c (darwin_override_options): When checking for the + flag-reorder-and-partition case, also check that it is set on. + +2021-12-24 Iain Sandoe <iain@sandoe.co.uk> + + * config/darwin.h (OBJECT_FORMAT_MACHO): New. + +2021-12-23 Roger Sayle <roger@nextmovesoftware.com> + Uroš Bizjak <ubizjak@gmail.com> + + PR target/103773 + * config/i386/i386.md (*mov<mode>_and): New define_insn for + writing a zero to memory using AND. + (*mov<mode>_or): Extend to allow memory destination and HImode. + (*movdi_internal): Remove -Oz push/pop optimization from here. + (*movsi_internal): Likewise. + (peephole2): Perform -Oz push/pop optimization here, only for + register destinations, values other than zero, and in functions + that don't used the red zone. + (peephole2): With -Oz, convert writes of 0 or -1 to memory into + their clobber forms, i.e. *mov<mode>_and and *mov<mode>_or resp. + +2021-12-23 konglin1 <lingling.kong@intel.com> + + * config/i386/avx512bf16intrin.h (_mm_cvtsbh_ss): Add new intrinsic. + (_mm512_cvtpbh_ps): Likewise. + (_mm512_maskz_cvtpbh_ps): Likewise. + (_mm512_mask_cvtpbh_ps): Likewise. + * config/i386/avx512bf16vlintrin.h (_mm_cvtness_sbh): Likewise. + (_mm_cvtpbh_ps): Likewise. + (_mm256_cvtpbh_ps): Likewise. + (_mm_maskz_cvtpbh_ps): Likewise. + (_mm256_maskz_cvtpbh_ps): Likewise. + (_mm_mask_cvtpbh_ps): Likewise. + (_mm256_mask_cvtpbh_ps): Likewise. + +2021-12-23 Feng Xue <fxue@os.amperecomputing.com> + + PR ipa/103786 + * tree.c (verify_type): Fix typo. + +2021-12-23 liuhongt <hongtao.liu@intel.com> + + PR target/103750 + * config/i386/sse.md + (*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>): + New pre_reload define_insn_and_split. + (*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>): + Ditto. + (*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>): + Ditto. + (*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>): + Ditto. + (*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2): + Ditto. + (*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2): + Ditto. + (*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2): + Ditto. + (*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2): + Ditto. + +2021-12-22 Murray Steele <murray.steele@arm.com> + + * config.gcc (arm*-*-*): Add arm-mve-builtins.o to extra_objs. + * config/arm/arm-c.c (arm_pragma_arm): Handle "#pragma GCC arm". + (arm_register_target_pragmas): Register it. + * config/arm/arm-protos.h: (arm_mve::arm_handle_mve_types_h): New + prototype. + * config/arm/arm_mve_types.h: Replace MVE type definitions with + new pragma. + * config/arm/t-arm: (arm-mve-builtins.o): New target rule. + * config/arm/arm-mve-builtins.cc: New file. + * config/arm/arm-mve-builtins.def: New file. + * config/arm/arm-mve-builtins.h: New file. + +2021-12-22 Murray Steele <murray.steele@arm.com> + + * config/arm/arm-builtins.c (enum arm_type_qualifiers): Move to + arm_builtins.h. + (enum arm_simd_type): Move to arm-builtins.h. + (struct arm_simd_type_info): Move to arm-builtins.h. + * config/arm/arm-builtins.h (enum arm_simd_type): Move from + arm-builtins.c. + (enum arm_type_qualifiers): Move from arm-builtins.c. + (struct arm_simd_type_info): Move from arm-builtins.c. + +2021-12-22 Martin Liska <mliska@suse.cz> + + * doc/extend.texi: Unify all function declarations in examples + where some miss trailing ';'. + +2021-12-22 Martin Liska <mliska@suse.cz> + + * doc/extend.texi: Unify all function declarations in examples + where some miss trailing ';'. + +2021-12-22 Martin Liska <mliska@suse.cz> + + * doc/extend.texi: Unify all function declarations in examples + where some miss trailing ';'. + +2021-12-22 Martin Liska <mliska@suse.cz> + + * doc/extend.texi: Use uppercase letters for SSEx. + 2021-12-21 Jiang Haochen <haochen.jiang@intel.com> * config/i386/bmiintrin.h (_tzcnt_u16): New intrinsic. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 275f771..0802d0e 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20211222 +20211228 diff --git a/gcc/ada/doc/share/gnu_free_documentation_license.rst b/gcc/ada/doc/share/gnu_free_documentation_license.rst index c18cf66..0235545 100644 --- a/gcc/ada/doc/share/gnu_free_documentation_license.rst +++ b/gcc/ada/doc/share/gnu_free_documentation_license.rst @@ -7,7 +7,7 @@ GNU Free Documentation License Version 1.3, 3 November 2008 Copyright 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc -http://fsf.org/ +https://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -383,7 +383,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. +https://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff --git a/gcc/ada/gnat-style.texi b/gcc/ada/gnat-style.texi index a7d666c..1e77dd1 100644 --- a/gcc/ada/gnat-style.texi +++ b/gcc/ada/gnat-style.texi @@ -953,7 +953,7 @@ except that they are all lower case. Version 1.3, 3 November 2008 Copyright 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc -@indicateurl{http://fsf.org/} +@indicateurl{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -1349,7 +1349,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@indicateurl{http://www.gnu.org/copyleft/}. +@indicateurl{https://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 70e8c36..2b5cbf7 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -29893,7 +29893,7 @@ extension of package System. Version 1.3, 3 November 2008 Copyright 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc -@indicateurl{http://fsf.org/} +@indicateurl{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -30289,7 +30289,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@indicateurl{http://www.gnu.org/copyleft/}. +@indicateurl{https://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 22b6795..63e4f9d 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -28760,7 +28760,7 @@ problems. Version 1.3, 3 November 2008 Copyright 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc -@indicateurl{http://fsf.org/} +@indicateurl{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -29156,7 +29156,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@indicateurl{http://www.gnu.org/copyleft/}. +@indicateurl{https://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index da83507..6afac4c 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2021-12-27 Patrick Palka <ppalka@redhat.com> + + PR c++/103700 + * c-common.c (pointer_int_sum): When quiet, return + error_mark_node for an incomplete pointed-to type and don't + call size_in_bytes_loc. + 2021-12-17 Jason Merrill <jason@redhat.com> PR c++/103681 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index a25d59f..f3e3e9b 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -3308,6 +3308,8 @@ pointer_int_sum (location_t loc, enum tree_code resultcode, size_exp = integer_one_node; else { + if (!complain && !COMPLETE_TYPE_P (TREE_TYPE (result_type))) + return error_mark_node; size_exp = size_in_bytes_loc (loc, TREE_TYPE (result_type)); /* Wrap the pointer expression in a SAVE_EXPR to make sure it is evaluated first when the size expression may depend diff --git a/gcc/config.gcc b/gcc/config.gcc index 91806aa..294f312 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -353,14 +353,14 @@ arc*-*-*) ;; arm*-*-*) cpu_type=arm - extra_objs="arm-builtins.o aarch-common.o" + extra_objs="arm-builtins.o arm-mve-builtins.o aarch-common.o" extra_headers="mmintrin.h arm_neon.h arm_acle.h arm_fp16.h arm_cmse.h arm_bf16.h arm_mve_types.h arm_mve.h arm_cde.h" target_type_format_char='%' c_target_objs="arm-c.o" cxx_target_objs="arm-c.o" d_target_objs="arm-d.o" extra_options="${extra_options} arm/arm-tables.opt" - target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c" + target_gtfiles="\$(srcdir)/config/arm/arm-builtins.c \$(srcdir)/config/arm/arm-mve-builtins.h \$(srcdir)/config/arm/arm-mve-builtins.cc" ;; avr-*-*) cpu_type=avr @@ -677,6 +677,20 @@ case ${target} in macos_min=0 fi def_ld64=85.2 + # Tools hosted on earlier versions of Darwin constrained all object + # alignment to be 2^15 or smaller. From Darwin11 (macOS 10.7) the + # alignment of non-common is allowed to be up to 2^28. Note that the + # larger alignment is permitted when targeting 10.6 from 10.7 so that + # the constraint only need be applied per host (and only if the host + # is Darwin). + case ${host} in + *-*-darwin[4-9]* | *-*-darwin10*) + tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=15U" + ;; + *) + tm_defines="$tm_defines L2_MAX_OFILE_ALIGNMENT=28U" + ;; + esac case ${target} in # Darwin 4 to 19 correspond to macOS 10.0 to 10.15 *-*-darwin[4-9]* | *-*-darwin1[0-9]*) diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c index 3a9ff8f..b6bf313 100644 --- a/gcc/config/arm/arm-builtins.c +++ b/gcc/config/arm/arm-builtins.c @@ -48,53 +48,6 @@ #define SIMD_MAX_BUILTIN_ARGS 7 -enum arm_type_qualifiers -{ - /* T foo. */ - qualifier_none = 0x0, - /* unsigned T foo. */ - qualifier_unsigned = 0x1, /* 1 << 0 */ - /* const T foo. */ - qualifier_const = 0x2, /* 1 << 1 */ - /* T *foo. */ - qualifier_pointer = 0x4, /* 1 << 2 */ - /* const T * foo. */ - qualifier_const_pointer = 0x6, - /* Used when expanding arguments if an operand could - be an immediate. */ - qualifier_immediate = 0x8, /* 1 << 3 */ - qualifier_unsigned_immediate = 0x9, - qualifier_maybe_immediate = 0x10, /* 1 << 4 */ - /* void foo (...). */ - qualifier_void = 0x20, /* 1 << 5 */ - /* Some patterns may have internal operands, this qualifier is an - instruction to the initialisation code to skip this operand. */ - qualifier_internal = 0x40, /* 1 << 6 */ - /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum - rather than using the type of the operand. */ - qualifier_map_mode = 0x80, /* 1 << 7 */ - /* qualifier_pointer | qualifier_map_mode */ - qualifier_pointer_map_mode = 0x84, - /* qualifier_const_pointer | qualifier_map_mode */ - qualifier_const_pointer_map_mode = 0x86, - /* Polynomial types. */ - qualifier_poly = 0x100, - /* Lane indices - must be within range of previous argument = a vector. */ - qualifier_lane_index = 0x200, - /* Lane indices for single lane structure loads and stores. */ - qualifier_struct_load_store_lane_index = 0x400, - /* A void pointer. */ - qualifier_void_pointer = 0x800, - /* A const void pointer. */ - qualifier_const_void_pointer = 0x802, - /* Lane indices selected in pairs - must be within range of previous - argument = a vector. */ - qualifier_lane_pair_index = 0x1000, - /* Lane indices selected in quadtuplets - must be within range of previous - argument = a vector. */ - qualifier_lane_quadtup_index = 0x2000 -}; - /* The qualifier_internal allows generation of a unary builtin from a pattern with a third pseudo-operand such as a match_scratch. T (T). */ @@ -1377,50 +1330,12 @@ const char *arm_scalar_builtin_types[] = { NULL }; -#define ENTRY(E, M, Q, S, T, G) E, -enum arm_simd_type -{ -#include "arm-simd-builtin-types.def" - __TYPE_FINAL -}; -#undef ENTRY - -struct arm_simd_type_info -{ - enum arm_simd_type type; - - /* Internal type name. */ - const char *name; - - /* Internal type name(mangled). The mangled names conform to the - AAPCS (see "Procedure Call Standard for the ARM Architecture", - Appendix A). To qualify for emission with the mangled names defined in - that document, a vector type must not only be of the correct mode but also - be of the correct internal Neon vector type (e.g. __simd64_int8_t); - these types are registered by arm_init_simd_builtin_types (). In other - words, vector types defined in other ways e.g. via vector_size attribute - will get default mangled names. */ - const char *mangle; - - /* Internal type. */ - tree itype; - - /* Element type. */ - tree eltype; - - /* Machine mode the internal type maps to. */ - machine_mode mode; - - /* Qualifiers. */ - enum arm_type_qualifiers q; -}; - #define ENTRY(E, M, Q, S, T, G) \ {E, \ "__simd" #S "_" #T "_t", \ #G "__simd" #S "_" #T "_t", \ NULL_TREE, NULL_TREE, M##mode, qualifier_##Q}, -static struct arm_simd_type_info arm_simd_types [] = { +struct arm_simd_type_info arm_simd_types [] = { #include "arm-simd-builtin-types.def" }; #undef ENTRY diff --git a/gcc/config/arm/arm-builtins.h b/gcc/config/arm/arm-builtins.h index bee9f9b..a40fa89 100644 --- a/gcc/config/arm/arm-builtins.h +++ b/gcc/config/arm/arm-builtins.h @@ -32,4 +32,91 @@ enum resolver_ident { enum resolver_ident arm_describe_resolver (tree); unsigned arm_cde_end_args (tree); +#define ENTRY(E, M, Q, S, T, G) E, +enum arm_simd_type +{ +#include "arm-simd-builtin-types.def" + __TYPE_FINAL +}; +#undef ENTRY + +enum arm_type_qualifiers +{ + /* T foo. */ + qualifier_none = 0x0, + /* unsigned T foo. */ + qualifier_unsigned = 0x1, /* 1 << 0 */ + /* const T foo. */ + qualifier_const = 0x2, /* 1 << 1 */ + /* T *foo. */ + qualifier_pointer = 0x4, /* 1 << 2 */ + /* const T * foo. */ + qualifier_const_pointer = 0x6, + /* Used when expanding arguments if an operand could + be an immediate. */ + qualifier_immediate = 0x8, /* 1 << 3 */ + qualifier_unsigned_immediate = 0x9, + qualifier_maybe_immediate = 0x10, /* 1 << 4 */ + /* void foo (...). */ + qualifier_void = 0x20, /* 1 << 5 */ + /* Some patterns may have internal operands, this qualifier is an + instruction to the initialisation code to skip this operand. */ + qualifier_internal = 0x40, /* 1 << 6 */ + /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum + rather than using the type of the operand. */ + qualifier_map_mode = 0x80, /* 1 << 7 */ + /* qualifier_pointer | qualifier_map_mode */ + qualifier_pointer_map_mode = 0x84, + /* qualifier_const_pointer | qualifier_map_mode */ + qualifier_const_pointer_map_mode = 0x86, + /* Polynomial types. */ + qualifier_poly = 0x100, + /* Lane indices - must be within range of previous argument = a vector. */ + qualifier_lane_index = 0x200, + /* Lane indices for single lane structure loads and stores. */ + qualifier_struct_load_store_lane_index = 0x400, + /* A void pointer. */ + qualifier_void_pointer = 0x800, + /* A const void pointer. */ + qualifier_const_void_pointer = 0x802, + /* Lane indices selected in pairs - must be within range of previous + argument = a vector. */ + qualifier_lane_pair_index = 0x1000, + /* Lane indices selected in quadtuplets - must be within range of previous + argument = a vector. */ + qualifier_lane_quadtup_index = 0x2000 +}; + +struct arm_simd_type_info +{ + enum arm_simd_type type; + + /* Internal type name. */ + const char *name; + + /* Internal type name(mangled). The mangled names conform to the + AAPCS (see "Procedure Call Standard for the ARM Architecture", + Appendix A). To qualify for emission with the mangled names defined in + that document, a vector type must not only be of the correct mode but also + be of the correct internal Neon vector type (e.g. __simd64_int8_t); + these types are registered by arm_init_simd_builtin_types (). In other + words, vector types defined in other ways e.g. via vector_size attribute + will get default mangled names. */ + const char *mangle; + + /* Internal type. */ + tree itype; + + /* Element type. */ + tree eltype; + + /* Machine mode the internal type maps to. */ + machine_mode mode; + + /* Qualifiers. */ + enum arm_type_qualifiers q; +}; + +extern struct arm_simd_type_info arm_simd_types[]; + #endif /* GCC_ARM_BUILTINS_H */ diff --git a/gcc/config/arm/arm-c.c b/gcc/config/arm/arm-c.c index cc7901b..d1414f6 100644 --- a/gcc/config/arm/arm-c.c +++ b/gcc/config/arm/arm-c.c @@ -28,6 +28,7 @@ #include "c-family/c-pragma.h" #include "stringpool.h" #include "arm-builtins.h" +#include "arm-protos.h" tree arm_resolve_cde_builtin (location_t loc, tree fndecl, void *arglist) @@ -129,6 +130,24 @@ arm_resolve_cde_builtin (location_t loc, tree fndecl, void *arglist) return call_expr; } +/* Implement "#pragma GCC arm". */ +static void +arm_pragma_arm (cpp_reader *) +{ + tree x; + if (pragma_lex (&x) != CPP_STRING) + { + error ("%<#pragma GCC arm%> requires a string parameter"); + return; + } + + const char *name = TREE_STRING_POINTER (x); + if (strcmp (name, "arm_mve_types.h") == 0) + arm_mve::handle_arm_mve_types_h (); + else + error ("unknown %<#pragma GCC arm%> option %qs", name); +} + /* Implement TARGET_RESOLVE_OVERLOADED_BUILTIN. This is currently only used for the MVE related builtins for the CDE extension. Here we ensure the type of arguments is such that the size is correct, and @@ -476,6 +495,8 @@ arm_register_target_pragmas (void) targetm.target_option.pragma_parse = arm_pragma_target_parse; targetm.resolve_overloaded_builtin = arm_resolve_overloaded_builtin; + c_register_pragma ("GCC", "arm", arm_pragma_arm); + #ifdef REGISTER_SUBTARGET_PRAGMAS REGISTER_SUBTARGET_PRAGMAS (); #endif diff --git a/gcc/config/arm/arm-mve-builtins.cc b/gcc/config/arm/arm-mve-builtins.cc new file mode 100644 index 0000000..71838a8 --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.cc @@ -0,0 +1,196 @@ +/* ACLE support for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#define IN_TARGET_CODE 1 + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "fold-const.h" +#include "langhooks.h" +#include "stringpool.h" +#include "attribs.h" +#include "diagnostic.h" +#include "arm-protos.h" +#include "arm-builtins.h" +#include "arm-mve-builtins.h" + +namespace arm_mve { + +/* Static information about each single-predicate or single-vector + ACLE type. */ +struct vector_type_info +{ + /* The name of the type as declared by arm_mve.h. */ + const char *acle_name; + + /* Whether the type requires a floating point abi. */ + const bool requires_float; +}; + +/* Flag indicating whether the arm MVE types have been handled. */ +static bool handle_arm_mve_types_p; + +/* Information about each single-predicate or single-vector type. */ +static CONSTEXPR const vector_type_info vector_types[] = { +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + { #ACLE_NAME, REQUIRES_FLOAT }, +#include "arm-mve-builtins.def" +#undef DEF_MVE_TYPE +}; + +/* The scalar type associated with each vector type. */ +GTY(()) tree scalar_types[NUM_VECTOR_TYPES]; + +/* The single-predicate and single-vector types, with their built-in + "__simd128_..._t" name. Allow an index of NUM_VECTOR_TYPES, which always + yields a null tree. */ +static GTY(()) tree abi_vector_types[NUM_VECTOR_TYPES + 1]; + +/* Same, but with the arm_mve.h names. */ +GTY(()) tree acle_vector_types[3][NUM_VECTOR_TYPES + 1]; + +/* Return the MVE abi type with element of type TYPE. */ +static tree +arm_mve_type_for_scalar_type (tree eltype) +{ + for (unsigned int i = 0; i < __TYPE_FINAL; ++i) + if (arm_simd_types[i].eltype == eltype + && GET_MODE_SIZE (arm_simd_types[i].mode) == 16) + return arm_simd_types[i].itype; + + gcc_unreachable (); +} + +/* Register the built-in MVE ABI vector types, such as uint32x4_t. */ +static void +register_builtin_types () +{ +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + scalar_types[VECTOR_TYPE_ ## ACLE_NAME] = SCALAR_TYPE; +#include "arm-mve-builtins.def" +#undef DEF_MVE_TYPE + for (unsigned int i = 0; i < NUM_VECTOR_TYPES; ++i) + { + if (vector_types[i].requires_float && !TARGET_HAVE_MVE_FLOAT) + continue; + tree eltype = scalar_types[i]; + tree vectype; + if (eltype == boolean_type_node) + { + vectype = get_typenode_from_name (UINT16_TYPE); + gcc_assert (GET_MODE_SIZE (TYPE_MODE (vectype)) == 2); + } + else + { + vectype = arm_mve_type_for_scalar_type (eltype); + gcc_assert (VECTOR_MODE_P (TYPE_MODE (vectype)) + && GET_MODE_SIZE (TYPE_MODE (vectype)) == 16); + } + abi_vector_types[i] = vectype; + } +} + +/* Register vector type TYPE under its arm_mve.h name. */ +static void +register_vector_type (vector_type_index type) +{ + if (vector_types[type].requires_float && !TARGET_HAVE_MVE_FLOAT) + return; + tree vectype = abi_vector_types[type]; + tree id = get_identifier (vector_types[type].acle_name); + tree decl = build_decl (input_location, TYPE_DECL, id, vectype); + decl = lang_hooks.decls.pushdecl (decl); + + /* Record the new ACLE type if pushdecl succeeded without error. Use + the ABI type otherwise, so that the type we record at least has the + right form, even if it doesn't have the right name. This should give + better error recovery behavior than installing error_mark_node or + installing an incorrect type. */ + if (decl + && TREE_CODE (decl) == TYPE_DECL + && TREE_TYPE (decl) != error_mark_node + && TYPE_MAIN_VARIANT (TREE_TYPE (decl)) == vectype) + vectype = TREE_TYPE (decl); + acle_vector_types[0][type] = vectype; +} + +/* Register tuple type TYPE with NUM_VECTORS arity under its + arm_mve_types.h name. */ +static void +register_builtin_tuple_types (vector_type_index type) +{ + const vector_type_info* info = &vector_types[type]; + if (scalar_types[type] == boolean_type_node + || (info->requires_float && !TARGET_HAVE_MVE_FLOAT)) + return; + const char *vector_type_name = info->acle_name; + char buffer[sizeof ("float32x4x2_t")]; + for (unsigned int num_vectors = 2; num_vectors <= 4; num_vectors += 2) + { + snprintf (buffer, sizeof (buffer), "%.*sx%d_t", + (int) strlen (vector_type_name) - 2, vector_type_name, + num_vectors); + + tree vectype = acle_vector_types[0][type]; + tree arrtype = build_array_type_nelts (vectype, num_vectors); + gcc_assert (TYPE_MODE_RAW (arrtype) == TYPE_MODE (arrtype)); + tree field = build_decl (input_location, FIELD_DECL, + get_identifier ("val"), arrtype); + + tree t = lang_hooks.types.simulate_record_decl (input_location, buffer, + make_array_slice (&field, + 1)); + gcc_assert (TYPE_MODE_RAW (t) == TYPE_MODE (t)); + acle_vector_types[num_vectors >> 1][type] = TREE_TYPE (t); + } +} + +/* Implement #pragma GCC arm "arm_mve_types.h". */ +void +handle_arm_mve_types_h () +{ + if (handle_arm_mve_types_p) + { + error ("duplicate definition of %qs", "arm_mve_types.h"); + return; + } + handle_arm_mve_types_p = true; + if (!TARGET_HAVE_MVE) + { + error ("this definition requires the MVE ISA extension"); + return; + } + register_builtin_types (); + for (unsigned int type_i = 0; type_i < NUM_VECTOR_TYPES; ++type_i) + { + vector_type_index type = vector_type_index (type_i); + register_vector_type (type); + if (type_i != VECTOR_TYPE_mve_pred16_t) + register_builtin_tuple_types (type); + } +} + +} /* end namespace arm_mve */ + +using namespace arm_mve; + +#include "gt-arm-mve-builtins.h" diff --git a/gcc/config/arm/arm-mve-builtins.def b/gcc/config/arm/arm-mve-builtins.def new file mode 100644 index 0000000..31bfa60 --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.def @@ -0,0 +1,39 @@ +/* Builtin lists for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#ifndef DEF_MVE_TYPE +#error "arm-mve-builtins.def included without defining DEF_MVE_TYPE" +#endif + +#define REQUIRES_FLOAT false +DEF_MVE_TYPE (mve_pred16_t, boolean_type_node) +DEF_MVE_TYPE (uint8x16_t, unsigned_intQI_type_node) +DEF_MVE_TYPE (uint16x8_t, unsigned_intHI_type_node) +DEF_MVE_TYPE (uint32x4_t, unsigned_intSI_type_node) +DEF_MVE_TYPE (uint64x2_t, unsigned_intDI_type_node) +DEF_MVE_TYPE (int8x16_t, intQI_type_node) +DEF_MVE_TYPE (int16x8_t, intHI_type_node) +DEF_MVE_TYPE (int32x4_t, intSI_type_node) +DEF_MVE_TYPE (int64x2_t, intDI_type_node) +#undef REQUIRES_FLOAT + +#define REQUIRES_FLOAT true +DEF_MVE_TYPE (float16x8_t, arm_fp16_type_node) +DEF_MVE_TYPE (float32x4_t, float_type_node) +#undef REQUIRES_FLOAT diff --git a/gcc/config/arm/arm-mve-builtins.h b/gcc/config/arm/arm-mve-builtins.h new file mode 100644 index 0000000..aa5c2cc --- /dev/null +++ b/gcc/config/arm/arm-mve-builtins.h @@ -0,0 +1,41 @@ +/* ACLE support for Arm MVE + Copyright (C) 2021 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + GCC is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + +#ifndef GCC_ARM_MVE_BUILTINS_H +#define GCC_ARM_MVE_BUILTINS_H + +namespace arm_mve { + +/* Enumerates the MVE predicate and (data) vector types, together called + "vector types" for brevity. */ +enum vector_type_index +{ +#define DEF_MVE_TYPE(ACLE_NAME, SCALAR_TYPE) \ + VECTOR_TYPE_ ## ACLE_NAME, +#include "arm-mve-builtins.def" + NUM_VECTOR_TYPES +#undef DEF_MVE_TYPE +}; + +extern tree scalar_types[NUM_VECTOR_TYPES]; +extern tree acle_vector_types[3][NUM_VECTOR_TYPES + 1]; + +} /* end namespace arm_mve */ + +#endif /* GCC_ARM_MVE_BUILTINS_H */ diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index 9b1f613..c91cb5a 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -204,6 +204,11 @@ extern int arm_apply_result_size (void); #endif /* RTX_CODE */ +/* MVE functions. */ +namespace arm_mve { + void handle_arm_mve_types_h (); +} + /* Thumb functions. */ extern void arm_init_expanders (void); extern const char *thumb1_unexpanded_epilogue (void); diff --git a/gcc/config/arm/arm_mve_types.h b/gcc/config/arm/arm_mve_types.h index 8958f4e..7fbc89b 100644 --- a/gcc/config/arm/arm_mve_types.h +++ b/gcc/config/arm/arm_mve_types.h @@ -25,37 +25,9 @@ #if (__ARM_FEATURE_MVE & 2) /* MVE Floating point. */ typedef __fp16 float16_t; typedef float float32_t; -typedef __simd128_float16_t float16x8_t; -typedef __simd128_float32_t float32x4_t; - -typedef struct { float16x8_t val[2]; } float16x8x2_t; -typedef struct { float16x8_t val[4]; } float16x8x4_t; -typedef struct { float32x4_t val[2]; } float32x4x2_t; -typedef struct { float32x4_t val[4]; } float32x4x4_t; #endif -typedef uint16_t mve_pred16_t; -typedef __simd128_uint8_t uint8x16_t; -typedef __simd128_uint16_t uint16x8_t; -typedef __simd128_uint32_t uint32x4_t; -typedef __simd128_uint64_t uint64x2_t; -typedef __simd128_int8_t int8x16_t; -typedef __simd128_int16_t int16x8_t; -typedef __simd128_int32_t int32x4_t; -typedef __simd128_int64_t int64x2_t; - -typedef struct { int16x8_t val[2]; } int16x8x2_t; -typedef struct { int16x8_t val[4]; } int16x8x4_t; -typedef struct { int32x4_t val[2]; } int32x4x2_t; -typedef struct { int32x4_t val[4]; } int32x4x4_t; -typedef struct { int8x16_t val[2]; } int8x16x2_t; -typedef struct { int8x16_t val[4]; } int8x16x4_t; -typedef struct { uint16x8_t val[2]; } uint16x8x2_t; -typedef struct { uint16x8_t val[4]; } uint16x8x4_t; -typedef struct { uint32x4_t val[2]; } uint32x4x2_t; -typedef struct { uint32x4_t val[4]; } uint32x4x4_t; -typedef struct { uint8x16_t val[2]; } uint8x16x2_t; -typedef struct { uint8x16_t val[4]; } uint8x16x4_t; +#pragma GCC arm "arm_mve_types.h" __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index 5f69ee6..f655f36 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -153,6 +153,16 @@ arm-builtins.o: $(srcdir)/config/arm/arm-builtins.c $(CONFIG_H) \ $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(srcdir)/config/arm/arm-builtins.c +arm-mve-builtins.o: $(srcdir)/config/arm/arm-mve-builtins.cc $(CONFIG_H) \ + $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + fold-const.h langhooks.h stringpool.h attribs.h diagnostic.h \ + $(srcdir)/config/arm/arm-protos.h \ + $(srcdir)/config/arm/arm-builtins.h \ + $(srcdir)/config/arm/arm-mve-builtins.h \ + $(srcdir)/config/arm/arm-mve-builtins.def + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ + $(srcdir)/config/arm/arm-mve-builtins.cc + arm-c.o: $(srcdir)/config/arm/arm-c.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) $(TREE_H) output.h $(C_COMMON_H) $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 8ad5b26..c8e8b9d 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -2558,7 +2558,6 @@ darwin_emit_common (FILE *fp, const char *name, rounded = (size + (align-1)) & ~(align-1); l2align = floor_log2 (align); - gcc_assert (l2align <= L2_MAX_OFILE_ALIGNMENT); in_section = comm_section; /* We mustn't allow multiple public symbols to share an address when using @@ -2709,6 +2708,10 @@ darwin_asm_output_aligned_decl_common (FILE *fp, tree decl, const char *name, #ifdef DEBUG_DARWIN_MEM_ALLOCATORS fprintf (fp, "# adcom: %s (%d,%d) decl=0x0\n", name, (int)size, (int)align); #endif + /* Common variables are limited to a maximum alignment of 2^15. */ + if (align > 32768) + error_at (UNKNOWN_LOCATION, "common variables must have an alignment" + " of 32678 or less"); darwin_emit_common (fp, name, size, align); return; } @@ -2736,7 +2739,7 @@ fprintf (fp, "# adcom: %s (%lld,%d) ro %d cst %d stat %d com %d pub %d" } /* We shouldn't be messing with this if the decl has a section name. */ - gcc_assert (DECL_SECTION_NAME (decl) == NULL); + gcc_checking_assert (DECL_SECTION_NAME (decl) == NULL); /* We would rather not have to check this here - but it seems that we might be passed a decl that should be in coalesced space. */ @@ -2765,10 +2768,16 @@ fprintf (fp, "# adcom: %s (%lld,%d) ro %d cst %d stat %d com %d pub %d" l2align = floor_log2 (align / BITS_PER_UNIT); /* Check we aren't asking for more aligment than the platform allows. */ - gcc_assert (l2align <= L2_MAX_OFILE_ALIGNMENT); + gcc_checking_assert (l2align <= L2_MAX_OFILE_ALIGNMENT); if (TREE_PUBLIC (decl) != 0) - darwin_emit_common (fp, name, size, align); + { + /* Common variables are limited to a maximum alignment of 2^15. */ + if (l2align > 15) + error_at (DECL_SOURCE_LOCATION (decl), "common variables must have" + " an alignment of 32678 or less"); + darwin_emit_common (fp, name, size, align); + } else darwin_emit_local_bss (fp, decl, name, size, l2align); } @@ -3330,12 +3339,13 @@ darwin_override_options (void) /* Disable -freorder-blocks-and-partition when unwind tables are being emitted for Darwin < 9 (OSX 10.5). - The strategy is, "Unless the User has specifically set/unset an unwind + The strategy is, "Unless the user has specifically set/unset an unwind flag we will switch off -freorder-blocks-and-partition when unwind tables - will be generated". If the User specifically sets flags... we assume - (s)he knows why... */ + will be generated". If the user specifically sets flags, we have to + assume they know why. */ if (generating_for_darwin_version < 9 && OPTION_SET_P (flag_reorder_blocks_and_partition) + && flag_reorder_blocks_and_partition && ((global_options.x_flag_exceptions /* User, c++, java */ && !OPTION_SET_P (flag_exceptions)) /* User specified... */ || (global_options.x_flag_unwind_tables diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 75b688e..d6f52e7 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -43,6 +43,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DARWIN_X86 0 #define DARWIN_PPC 0 +#define OBJECT_FORMAT_MACHO 1 + /* Suppress g++ attempt to link in the math library automatically. */ #define MATH_LIBRARY "" @@ -871,13 +873,12 @@ int darwin_label_is_anonymous_local_objc_name (const char *name); if ((LOG) != 0) \ fprintf (FILE, "\t%s\t%d\n", ALIGN_ASM_OP, (LOG)) -/* The maximum alignment which the object file format can support in - bits. For Mach-O, this is 2^15 bytes. */ +/* The maximum alignment which the object file format can support in bits + which depends on the OS version and whether the object is a common + variable. */ #undef MAX_OFILE_ALIGNMENT -#define MAX_OFILE_ALIGNMENT (0x8000 * 8) - -#define L2_MAX_OFILE_ALIGNMENT 15 +#define MAX_OFILE_ALIGNMENT ((1U << L2_MAX_OFILE_ALIGNMENT) * 8U) /* These are the three variants that emit referenced blank space. */ #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \ diff --git a/gcc/config/i386/avx512bf16intrin.h b/gcc/config/i386/avx512bf16intrin.h index 9afc6bd..6b62dc3 100644 --- a/gcc/config/i386/avx512bf16intrin.h +++ b/gcc/config/i386/avx512bf16intrin.h @@ -41,6 +41,16 @@ typedef short __v32bh __attribute__ ((__vector_size__ (64))); vector types, and their scalar components. */ typedef short __m512bh __attribute__ ((__vector_size__ (64), __may_alias__)); +/* Convert One BF16 Data to One Single Float Data. */ +extern __inline float +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtsbh_ss (__bfloat16 __A) +{ + union{ float a; unsigned int b;} __tmp; + __tmp.b = ((unsigned int)(__A)) << 16; + return __tmp.a; +} + /* vcvtne2ps2bf16 */ extern __inline __m512bh @@ -110,6 +120,32 @@ _mm512_maskz_dpbf16_ps (__mmask16 __A, __m512 __B, __m512bh __C, __m512bh __D) return (__m512)__builtin_ia32_dpbf16ps_v16sf_maskz(__B, __C, __D, __A); } +extern __inline __m512 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_cvtpbh_ps (__m256bh __A) +{ + return (__m512)_mm512_castsi512_ps ((__m512i)_mm512_slli_epi32 ( + (__m512i)_mm512_cvtepi16_epi32 ((__m256i)__A), 16)); +} + +extern __inline __m512 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_maskz_cvtpbh_ps (__mmask16 __U, __m256bh __A) +{ + return (__m512)_mm512_castsi512_ps ((__m512i) _mm512_slli_epi32 ( + (__m512i)_mm512_maskz_cvtepi16_epi32 ( + (__mmask16)__U, (__m256i)__A), 16)); +} + +extern __inline __m512 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm512_mask_cvtpbh_ps (__m512 __S, __mmask16 __U, __m256bh __A) +{ + return (__m512)_mm512_castsi512_ps ((__m512i)(_mm512_mask_slli_epi32 ( + (__m512i)__S, (__mmask16)__U, + (__m512i)_mm512_cvtepi16_epi32 ((__m256i)__A), 16))); +} + #ifdef __DISABLE_AVX512BF16__ #undef __DISABLE_AVX512BF16__ #pragma GCC pop_options diff --git a/gcc/config/i386/avx512bf16vlintrin.h b/gcc/config/i386/avx512bf16vlintrin.h index 6dd396d..5e6a650 100644 --- a/gcc/config/i386/avx512bf16vlintrin.h +++ b/gcc/config/i386/avx512bf16vlintrin.h @@ -43,6 +43,7 @@ typedef short __v8bh __attribute__ ((__vector_size__ (16))); typedef short __m256bh __attribute__ ((__vector_size__ (32), __may_alias__)); typedef short __m128bh __attribute__ ((__vector_size__ (16), __may_alias__)); +typedef unsigned short __bfloat16; /* vcvtne2ps2bf16 */ extern __inline __m256bh @@ -175,6 +176,68 @@ _mm_maskz_dpbf16_ps (__mmask8 __A, __m128 __B, __m128bh __C, __m128bh __D) return (__m128)__builtin_ia32_dpbf16ps_v4sf_maskz(__B, __C, __D, __A); } +extern __inline __bfloat16 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtness_sbh (float __A) +{ + __v4sf __V = {__A, 0, 0, 0}; + __v8hi __R = __builtin_ia32_cvtneps2bf16_v4sf_mask ((__v4sf)__V, + (__v8hi)_mm_undefined_si128 (), (__mmask8)-1); + return __R[0]; +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_cvtpbh_ps (__m128bh __A) +{ + return (__m128)_mm_castsi128_ps ((__m128i)_mm_slli_epi32 ( + (__m128i)_mm_cvtepi16_epi32 ((__m128i)__A), 16)); +} + +extern __inline __m256 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_cvtpbh_ps (__m128bh __A) +{ + return (__m256)_mm256_castsi256_ps ((__m256i)_mm256_slli_epi32 ( + (__m256i)_mm256_cvtepi16_epi32 ((__m128i)__A), 16)); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_maskz_cvtpbh_ps (__mmask8 __U, __m128bh __A) +{ + return (__m128)_mm_castsi128_ps ((__m128i)_mm_slli_epi32 ( + (__m128i)_mm_maskz_cvtepi16_epi32 ( + (__mmask8)__U, (__m128i)__A), 16)); +} + +extern __inline __m256 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_maskz_cvtpbh_ps (__mmask8 __U, __m128bh __A) +{ + return (__m256)_mm256_castsi256_ps ((__m256i)_mm256_slli_epi32 ( + (__m256i)_mm256_maskz_cvtepi16_epi32 ( + (__mmask8)__U, (__m128i)__A), 16)); +} + +extern __inline __m128 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm_mask_cvtpbh_ps (__m128 __S, __mmask8 __U, __m128bh __A) +{ + return (__m128)_mm_castsi128_ps ((__m128i)_mm_mask_slli_epi32 ( + (__m128i)__S, (__mmask8)__U, (__m128i)_mm_cvtepi16_epi32 ( + (__m128i)__A), 16)); +} + +extern __inline __m256 +__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) +_mm256_mask_cvtpbh_ps (__m256 __S, __mmask8 __U, __m128bh __A) +{ + return (__m256)_mm256_castsi256_ps ((__m256i)_mm256_mask_slli_epi32 ( + (__m256i)__S, (__mmask8)__U, (__m256i)_mm256_cvtepi16_epi32 ( + (__m128i)__A), 16)); +} + #ifdef __DISABLE_AVX512BF16VL__ #undef __DISABLE_AVX512BF16VL__ #pragma GCC pop_options diff --git a/gcc/config/i386/constraints.md b/gcc/config/i386/constraints.md index 6b291a0..ded2e19 100644 --- a/gcc/config/i386/constraints.md +++ b/gcc/config/i386/constraints.md @@ -168,6 +168,7 @@ ;; z Constant call address operand. ;; C Integer SSE constant with all bits set operand. ;; F Floating-point SSE constant with all bits set operand. +;; M x86-64 memory operand. (define_constraint "Bf" "@internal Flags register operand." @@ -232,6 +233,15 @@ (and (match_test "TARGET_SSE") (match_operand 0 "float_vector_all_ones_operand"))) +;; NB: Similar to 'm', but don't use define_memory_constraint on x86-64 +;; to prevent LRA from converting the operand to the form '(mem (reg X))' +;; where X is a base register. +(define_constraint "BM" + "@internal x86-64 memory operand." + (and (match_code "mem") + (match_test "memory_address_addr_space_p (GET_MODE (op), XEXP (op, 0), + MEM_ADDR_SPACE (op))"))) + ;; Integer constant constraints. (define_constraint "Wb" "Integer constant in the range 0 @dots{} 7, for 8-bit shifts." diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 58b1064..e670e7d 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1148,6 +1148,9 @@ ;; General operand constraint for word modes. (define_mode_attr g [(QI "qmn") (HI "rmn") (SI "rme") (DI "rme")]) +;; Memory operand constraint for word modes. +(define_mode_attr m [(QI "m") (HI "m") (SI "BM") (DI "BM")]) + ;; Immediate operand constraint for double integer modes. (define_mode_attr di [(SI "nF") (DI "Wd")]) @@ -1390,7 +1393,7 @@ (define_insn "*cmp<mode>_1" [(set (reg FLAGS_REG) (compare (match_operand:SWI 0 "nonimmediate_operand" "<r>m,<r>") - (match_operand:SWI 1 "<general_operand>" "<r><i>,<r>m")))] + (match_operand:SWI 1 "<general_operand>" "<r><i>,<r><m>")))] "ix86_match_ccmode (insn, CCmode)" "cmp{<imodesuffix>}\t{%1, %0|%0, %1}" [(set_attr "type" "icmp") @@ -1400,7 +1403,7 @@ [(set (reg FLAGS_REG) (compare (minus:SWI (match_operand:SWI 0 "nonimmediate_operand" "<r>m,<r>") - (match_operand:SWI 1 "<general_operand>" "<r><i>,<r>m")) + (match_operand:SWI 1 "<general_operand>" "<r><i>,<r><m>")) (const_int 0)))] "ix86_match_ccmode (insn, CCGOCmode)" "cmp{<imodesuffix>}\t{%1, %0|%0, %1}" @@ -2028,9 +2031,19 @@ (set_attr "mode" "SI") (set_attr "length_immediate" "0")]) +(define_insn "*mov<mode>_and" + [(set (match_operand:SWI248 0 "memory_operand" "=m") + (match_operand:SWI248 1 "const0_operand")) + (clobber (reg:CC FLAGS_REG))] + "reload_completed" + "and{<imodesuffix>}\t{%1, %0|%0, %1}" + [(set_attr "type" "alu1") + (set_attr "mode" "<MODE>") + (set_attr "length_immediate" "1")]) + (define_insn "*mov<mode>_or" - [(set (match_operand:SWI48 0 "register_operand" "=r") - (match_operand:SWI48 1 "constm1_operand")) + [(set (match_operand:SWI248 0 "nonimmediate_operand" "=rm") + (match_operand:SWI248 1 "constm1_operand")) (clobber (reg:CC FLAGS_REG))] "reload_completed" "or{<imodesuffix>}\t{%1, %0|%0, %1}" @@ -2218,14 +2231,7 @@ case TYPE_IMOV: gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); if (get_attr_mode (insn) == MODE_SI) - { - if (optimize_size > 1 - && TARGET_64BIT - && CONST_INT_P (operands[1]) - && IN_RANGE (INTVAL (operands[1]), -128, 127)) - return "push{q}\t%1\n\tpop{q}\t%0"; - return "mov{l}\t{%k1, %k0|%k0, %k1}"; - } + return "mov{l}\t{%k1, %k0|%k0, %k1}"; else if (which_alternative == 4) return "movabs{q}\t{%1, %0|%0, %1}"; else if (ix86_use_lea_for_mov (insn, operands)) @@ -2443,14 +2449,6 @@ gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); if (ix86_use_lea_for_mov (insn, operands)) return "lea{l}\t{%E1, %0|%0, %E1}"; - else if (optimize_size > 1 - && CONST_INT_P (operands[1]) - && IN_RANGE (INTVAL (operands[1]), -128, 127)) - { - if (TARGET_64BIT) - return "push{q}\t%1\n\tpop{q}\t%q0"; - return "push{l}\t%1\n\tpop{l}\t%0"; - } else return "mov{l}\t{%1, %0|%0, %1}"; @@ -2514,6 +2512,37 @@ ] (symbol_ref "true")))]) +;; With -Oz, transform mov $imm,reg to the shorter push $imm; pop reg. +(define_peephole2 + [(set (match_operand:SWI248 0 "general_reg_operand") + (match_operand:SWI248 1 "const_int_operand"))] + "optimize_insn_for_size_p () && optimize_size > 1 + && operands[1] != const0_rtx + && IN_RANGE (INTVAL (operands[1]), -128, 127) + && !ix86_red_zone_used" + [(set (match_dup 2) (match_dup 1)) + (set (match_dup 0) (match_dup 3))] +{ + if (GET_MODE (operands[0]) != word_mode) + operands[0] = gen_rtx_REG (word_mode, REGNO (operands[0])); + + operands[2] = gen_rtx_MEM (word_mode, + gen_rtx_PRE_DEC (Pmode, stack_pointer_rtx)); + operands[3] = gen_rtx_MEM (word_mode, + gen_rtx_POST_INC (Pmode, stack_pointer_rtx)); +}) + +;; With -Oz, transform mov $0,mem to the shorter and $0,mem. +;; Likewise, transform mov $-1,mem to the shorter or $-1,mem. +(define_peephole2 + [(set (match_operand:SWI248 0 "memory_operand") + (match_operand:SWI248 1 "const_int_operand"))] + "(operands[1] == const0_rtx || operands[1] == constm1_rtx) + && optimize_insn_for_size_p () && optimize_size > 1 + && peep2_regno_dead_p (0, FLAGS_REG)" + [(parallel [(set (match_dup 0) (match_dup 1)) + (clobber (reg:CC FLAGS_REG))])]) + (define_insn "*movhi_internal" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m ,*k,*k ,r ,m ,*k ,?r,?*v,*v,*v,*v,m") @@ -5658,7 +5687,7 @@ [(set (match_operand:SWI48 0 "nonimmediate_operand" "=rm,r,r,r") (plus:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "%0,0,r,r") - (match_operand:SWI48 2 "x86_64_general_operand" "re,m,0,le"))) + (match_operand:SWI48 2 "x86_64_general_operand" "re,BM,0,le"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)" { @@ -5714,7 +5743,7 @@ [(set (match_operand:DI 0 "register_operand" "=r,r,r") (zero_extend:DI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r,r") - (match_operand:SI 2 "x86_64_general_operand" "rme,0,le")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe,0,le")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" { @@ -5972,7 +6001,7 @@ (compare (plus:SWI (match_operand:SWI 1 "nonimmediate_operand" "%0,0,<r>") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m,0")) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>,0")) (const_int 0))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>,<r>") (plus:SWI (match_dup 1) (match_dup 2)))] @@ -6017,7 +6046,7 @@ [(set (reg FLAGS_REG) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,r") - (match_operand:SI 2 "x86_64_general_operand" "rme,0")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe,0")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] @@ -6102,7 +6131,7 @@ (define_insn "*addsi_3_zext" [(set (reg FLAGS_REG) (compare - (neg:SI (match_operand:SI 2 "x86_64_general_operand" "rme,0")) + (neg:SI (match_operand:SI 2 "x86_64_general_operand" "rBMe,0")) (match_operand:SI 1 "nonimmediate_operand" "%0,r"))) (set (match_operand:DI 0 "register_operand" "=r,r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] @@ -6806,7 +6835,7 @@ [(set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (minus:SWI (match_operand:SWI 1 "nonimmediate_operand" "0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m"))) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)" "sub{<imodesuffix>}\t{%2, %0|%0, %2}" @@ -6817,7 +6846,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (minus:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "x86_64_general_operand" "rme")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, SImode, operands)" "sub{l}\t{%2, %k0|%k0, %2}" @@ -6849,7 +6878,7 @@ (compare (minus:SWI (match_operand:SWI 1 "nonimmediate_operand" "0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m")) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>")) (const_int 0))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (minus:SWI (match_dup 1) (match_dup 2)))] @@ -6863,7 +6892,7 @@ [(set (reg FLAGS_REG) (compare (minus:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "x86_64_general_operand" "rme")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI @@ -7116,7 +7145,7 @@ (define_insn "*sub<mode>_3" [(set (reg FLAGS_REG) (compare (match_operand:SWI 1 "nonimmediate_operand" "0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m"))) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>"))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (minus:SWI (match_dup 1) (match_dup 2)))] "ix86_match_ccmode (insn, CCmode) @@ -7192,7 +7221,7 @@ (define_insn "*subsi_3_zext" [(set (reg FLAGS_REG) (compare (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "x86_64_general_operand" "rme"))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe"))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (minus:SI (match_dup 1) @@ -7212,7 +7241,7 @@ (match_operator:SWI 4 "ix86_carry_flag_operator" [(match_operand 3 "flags_reg_operand") (const_int 0)]) (match_operand:SWI 1 "nonimmediate_operand" "%0,0")) - (match_operand:SWI 2 "<general_operand>" "<r><i>,m"))) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (PLUS, <MODE>mode, operands)" "adc{<imodesuffix>}\t{%2, %0|%0, %2}" @@ -7256,7 +7285,7 @@ (plus:SI (match_operator:SI 3 "ix86_carry_flag_operator" [(reg FLAGS_REG) (const_int 0)]) (match_operand:SI 1 "register_operand" "%0")) - (match_operand:SI 2 "x86_64_general_operand" "rme")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (PLUS, SImode, operands)" "adc{l}\t{%2, %k0|%k0, %2}" @@ -7382,7 +7411,7 @@ (match_operand:SWI 1 "nonimmediate_operand" "0,0") (match_operator:SWI 4 "ix86_carry_flag_operator" [(match_operand 3 "flags_reg_operand") (const_int 0)])) - (match_operand:SWI 2 "<general_operand>" "<r><i>,m"))) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (MINUS, <MODE>mode, operands)" "sbb{<imodesuffix>}\t{%2, %0|%0, %2}" @@ -7427,7 +7456,7 @@ (match_operand:SI 1 "register_operand" "0") (match_operator:SI 3 "ix86_carry_flag_operator" [(reg FLAGS_REG) (const_int 0)])) - (match_operand:SI 2 "x86_64_general_operand" "rme")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (MINUS, SImode, operands)" "sbb{l}\t{%2, %k0|%k0, %2}" @@ -7503,7 +7532,7 @@ (define_insn "@sub<mode>3_carry_ccgz" [(set (reg:CCGZ FLAGS_REG) (unspec:CCGZ [(match_operand:DWIH 1 "register_operand" "0") - (match_operand:DWIH 2 "x86_64_general_operand" "rme") + (match_operand:DWIH 2 "x86_64_general_operand" "rBMe") (ltu:DWIH (reg:CC FLAGS_REG) (const_int 0))] UNSPEC_SBB)) (clobber (match_scratch:DWIH 0 "=r"))] @@ -7590,7 +7619,7 @@ (compare:CCC (plus:SWI (match_operand:SWI 1 "nonimmediate_operand" "%0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m")) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>")) (match_dup 1))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (plus:SWI (match_dup 1) (match_dup 2)))] @@ -7621,7 +7650,7 @@ (compare:CCC (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")) (match_dup 1))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] @@ -7648,7 +7677,7 @@ (compare:CCC (plus:SWI (match_operand:SWI 1 "nonimmediate_operand" "%0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m")) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>")) (match_dup 2))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (plus:SWI (match_dup 1) (match_dup 2)))] @@ -7662,7 +7691,7 @@ (compare:CCC (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")) (match_dup 2))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (match_dup 1) (match_dup 2))))] @@ -8006,7 +8035,7 @@ [(set (match_operand:SWIM248 0 "register_operand" "=r,r,r") (mult:SWIM248 (match_operand:SWIM248 1 "nonimmediate_operand" "%rm,rm,0") - (match_operand:SWIM248 2 "<general_operand>" "K,<i>,mr"))) + (match_operand:SWIM248 2 "<general_operand>" "K,<i>,<m>r"))) (clobber (reg:CC FLAGS_REG))] "!(MEM_P (operands[1]) && MEM_P (operands[2]))" "@ @@ -8042,7 +8071,7 @@ [(set (match_operand:DI 0 "register_operand" "=r,r,r") (zero_extend:DI (mult:SI (match_operand:SI 1 "nonimmediate_operand" "%rm,rm,0") - (match_operand:SI 2 "x86_64_general_operand" "K,e,mr")))) + (match_operand:SI 2 "x86_64_general_operand" "K,e,BMr")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && !(MEM_P (operands[1]) && MEM_P (operands[2]))" @@ -8552,7 +8581,7 @@ (set_attr "mode" "SI")]) ;; Highpart multiplication peephole2s to tweak register allocation. -;; mov %rdx,imm; mov %rax,%rdi; imulq %rdx -> mov %rax,imm; imulq %rdi +;; mov imm,%rdx; mov %rdi,%rax; imulq %rdx -> mov imm,%rax; imulq %rdi (define_peephole2 [(set (match_operand:SWI48 0 "general_reg_operand") (match_operand:SWI48 1 "immediate_operand")) @@ -8562,7 +8591,8 @@ (any_mul_highpart:SWI48 (match_dup 2) (match_dup 0))) (clobber (match_dup 2)) (clobber (reg:CC FLAGS_REG))])] - "REGNO (operands[0]) != REGNO (operands[2]) + "REGNO (operands[3]) != AX_REG + && REGNO (operands[0]) != REGNO (operands[2]) && REGNO (operands[0]) != REGNO (operands[3]) && (REGNO (operands[0]) == REGNO (operands[4]) || peep2_reg_dead_p (3, operands[0]))" @@ -8582,7 +8612,10 @@ (any_mul_highpart:SI (match_dup 2) (match_dup 0)))) (clobber (match_dup 2)) (clobber (reg:CC FLAGS_REG))])] - "REGNO (operands[0]) != REGNO (operands[2]) + "TARGET_64BIT + && REGNO (operands[3]) != AX_REG + && REGNO (operands[0]) != REGNO (operands[2]) + && REGNO (operands[2]) != REGNO (operands[3]) && REGNO (operands[0]) != REGNO (operands[3]) && (REGNO (operands[0]) == REGNO (operands[4]) || peep2_reg_dead_p (3, operands[0]))" @@ -9783,7 +9816,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (AND, SImode, operands)" "and{l}\t{%2, %k0|%k0, %2}" @@ -9793,7 +9826,7 @@ (define_insn "*and<mode>_1" [(set (match_operand:SWI24 0 "nonimmediate_operand" "=rm,r,Ya,?k") (and:SWI24 (match_operand:SWI24 1 "nonimmediate_operand" "%0,0,qm,k") - (match_operand:SWI24 2 "<general_operand>" "r<i>,m,L,k"))) + (match_operand:SWI24 2 "<general_operand>" "r<i>,<m>,L,k"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (AND, <MODE>mode, operands)" "@ @@ -9975,7 +10008,7 @@ [(set (reg FLAGS_REG) (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (and:SI (match_dup 1) (match_dup 2))))] @@ -10018,7 +10051,7 @@ [(set (reg FLAGS_REG) (compare (and:SWI124 (match_operand:SWI124 1 "nonimmediate_operand" "%0,0") - (match_operand:SWI124 2 "<general_operand>" "<r><i>,m")) + (match_operand:SWI124 2 "<general_operand>" "<r><i>,<m>")) (const_int 0))) (set (match_operand:SWI124 0 "nonimmediate_operand" "=<r>m,<r>") (and:SWI124 (match_dup 1) (match_dup 2)))] @@ -10332,7 +10365,7 @@ [(set (match_operand:SWI248 0 "nonimmediate_operand" "=rm,r,?k") (any_or:SWI248 (match_operand:SWI248 1 "nonimmediate_operand" "%0,0,k") - (match_operand:SWI248 2 "<general_operand>" "r<i>,m,k"))) + (match_operand:SWI248 2 "<general_operand>" "r<i>,<m>,k"))) (clobber (reg:CC FLAGS_REG))] "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)" "@ @@ -10400,7 +10433,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (any_or:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")))) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")))) (clobber (reg:CC FLAGS_REG))] "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)" "<logic>{l}\t{%2, %k0|%k0, %2}" @@ -10503,7 +10536,7 @@ [(set (reg FLAGS_REG) (compare (any_or:SWI (match_operand:SWI 1 "nonimmediate_operand" "%0,0") - (match_operand:SWI 2 "<general_operand>" "<r><i>,m")) + (match_operand:SWI 2 "<general_operand>" "<r><i>,<m>")) (const_int 0))) (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>m,<r>") (any_or:SWI (match_dup 1) (match_dup 2)))] @@ -10518,7 +10551,7 @@ (define_insn "*<code>si_2_zext" [(set (reg FLAGS_REG) (compare (any_or:SI (match_operand:SI 1 "nonimmediate_operand" "%0") - (match_operand:SI 2 "x86_64_general_operand" "rme")) + (match_operand:SI 2 "x86_64_general_operand" "rBMe")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (any_or:SI (match_dup 1) (match_dup 2))))] diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 6c5cbcf..e394cba 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -523,6 +523,28 @@ (set_attr "prefix" "*,orig,vex") (set_attr "mode" "V2SF,V4SF,V4SF")]) +(define_expand "divv2sf3" + [(set (match_operand:V2SF 0 "register_operand") + (div:V2SF (match_operand:V2SF 1 "register_operand") + (match_operand:V2SF 2 "register_operand")))] + "TARGET_MMX_WITH_SSE" +{ + rtx op1 = lowpart_subreg (V4SFmode, force_reg (V2SFmode, operands[1]), + V2SFmode); + rtx op2 = gen_rtx_VEC_CONCAT (V4SFmode, operands[2], + force_reg (V2SFmode, CONST1_RTX (V2SFmode))); + rtx tmp = gen_reg_rtx (V4SFmode); + + emit_insn (gen_rtx_SET (tmp, op2)); + + rtx op0 = gen_reg_rtx (V4SFmode); + + emit_insn (gen_divv4sf3 (op0, op1, tmp)); + + emit_move_insn (operands[0], lowpart_subreg (V2SFmode, op0, V4SFmode)); + DONE; +}) + (define_expand "mmx_<code>v2sf3" [(set (match_operand:V2SF 0 "register_operand") (smaxmin:V2SF diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index cb1c0b1..69c7547 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -3702,6 +3702,77 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) +;; Since vpcmpd implicitly clear the upper bits of dest, transform +;; vpcmpd + zero_extend to vpcmpd since the instruction +(define_insn_and_split "*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<V48H_AVX512VL:avx512fmaskmode> + [(match_operand:V48H_AVX512VL 1 "nonimmediate_operand") + (match_operand:V48H_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand" "n")] + UNSPEC_PCMP)))] + "TARGET_AVX512F + && (!VALID_MASK_AVX512BW_MODE (<SWI248x:MODE>mode) || TARGET_AVX512BW) + && ix86_pre_reload_split () + && (GET_MODE_NUNITS (<V48H_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode))" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<V48H_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP))] +{ + operands[1] = force_reg (<V48H_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<V48H_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<V48H_AVX512VL:sseinsnmode>")]) + +(define_insn_and_split "*<avx512>_cmp<V48H_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<V48H_AVX512VL:avx512fmaskmode> + [(match_operand:V48H_AVX512VL 1 "nonimmediate_operand") + (match_operand:V48H_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_PCMP))) + (set (match_operand:<V48H_AVX512VL:avx512fmaskmode> 4 "register_operand") + (unspec:<V48H_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP))] + "TARGET_AVX512F + && (!VALID_MASK_AVX512BW_MODE (<SWI248x:MODE>mode) || TARGET_AVX512BW) + && (GET_MODE_NUNITS (<V48H_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode)) + && ix86_pre_reload_split ()" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<V48H_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP)) + (set (match_dup 4) (match_dup 0))] +{ + operands[1] = force_reg (<V48H_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<V48H_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<V48H_AVX512VL:sseinsnmode>")]) + (define_insn_and_split "*<avx512>_cmp<mode>3" [(set (match_operand:<avx512fmaskmode> 0 "register_operand") (not:<avx512fmaskmode> @@ -3735,6 +3806,73 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) +(define_insn_and_split "*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_operand:VI12_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI12_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_PCMP)))] + "TARGET_AVX512BW + && ix86_pre_reload_split () + && (GET_MODE_NUNITS (<VI12_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode))" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP))] +{ + operands[1] = force_reg (<VI12_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI12_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI12_AVX512VL:sseinsnmode>")]) + +(define_insn_and_split "*<avx512>_cmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_operand:VI12_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI12_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_PCMP))) + (set (match_operand:<VI12_AVX512VL:avx512fmaskmode> 4 "register_operand") + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP))] + "TARGET_AVX512BW + && (GET_MODE_NUNITS (<VI12_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode)) + && ix86_pre_reload_split ()" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_PCMP)) + (set (match_dup 4) (match_dup 0))] +{ + operands[1] = force_reg (<VI12_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI12_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI12_AVX512VL:sseinsnmode>")]) + (define_int_iterator UNSPEC_PCMP_ITER [UNSPEC_PCMP UNSPEC_UNSIGNED_PCMP]) @@ -3771,6 +3909,74 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) +(define_insn_and_split "*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_operand:VI12_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI12_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_UNSIGNED_PCMP)))] + "TARGET_AVX512BW + && ix86_pre_reload_split () + && (GET_MODE_NUNITS (<VI12_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode))" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP))] +{ + operands[1] = force_reg (<VI12_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI12_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI12_AVX512VL:sseinsnmode>")]) + +(define_insn_and_split "*<avx512>_ucmp<VI12_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_operand:VI12_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI12_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_UNSIGNED_PCMP))) + (set (match_operand:<VI12_AVX512VL:avx512fmaskmode> 4 "register_operand") + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP))] + "TARGET_AVX512BW + && ix86_pre_reload_split () + && (GET_MODE_NUNITS (<VI12_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode)) + && ix86_pre_reload_split ()" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI12_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP)) + (set (match_dup 4) (match_dup 0))] +{ + operands[1] = force_reg (<VI12_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI12_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI12_AVX512VL:sseinsnmode>")]) + (define_insn "<avx512>_ucmp<mode>3<mask_scalar_merge_name>" [(set (match_operand:<avx512fmaskmode> 0 "register_operand" "=k") (unspec:<avx512fmaskmode> @@ -3785,6 +3991,75 @@ (set_attr "prefix" "evex") (set_attr "mode" "<sseinsnmode>")]) +(define_insn_and_split "*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI48_AVX512VL:avx512fmaskmode> + [(match_operand:VI48_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI48_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_UNSIGNED_PCMP)))] + "TARGET_AVX512F + && (!VALID_MASK_AVX512BW_MODE (<SWI248x:MODE>mode) || TARGET_AVX512BW) + && ix86_pre_reload_split () + && (GET_MODE_NUNITS (<VI48_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode))" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI48_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP))] +{ + operands[1] = force_reg (<VI48_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI48_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI48_AVX512VL:sseinsnmode>")]) + +(define_insn_and_split "*<avx512>_ucmp<VI48_AVX512VL:mode>3_zero_extend<SWI248x:mode>_2" + [(set (match_operand:SWI248x 0 "register_operand") + (zero_extend:SWI248x + (unspec:<VI48_AVX512VL:avx512fmaskmode> + [(match_operand:VI48_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI48_AVX512VL 2 "nonimmediate_operand") + (match_operand:SI 3 "const_0_to_7_operand")] + UNSPEC_UNSIGNED_PCMP))) + (set (match_operand:<VI48_AVX512VL:avx512fmaskmode> 4 "register_operand") + (unspec:<VI48_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP))] + "TARGET_AVX512F + && (!VALID_MASK_AVX512BW_MODE (<SWI248x:MODE>mode) || TARGET_AVX512BW) + && (GET_MODE_NUNITS (<VI48_AVX512VL:MODE>mode) + < GET_MODE_PRECISION (<SWI248x:MODE>mode)) + && ix86_pre_reload_split ()" + "#" + "&& 1" + [(set (match_dup 0) + (unspec:<VI48_AVX512VL:avx512fmaskmode> + [(match_dup 1) + (match_dup 2) + (match_dup 3)] + UNSPEC_UNSIGNED_PCMP)) + (set (match_dup 4) (match_dup 0))] +{ + operands[1] = force_reg (<VI48_AVX512VL:MODE>mode, operands[1]); + operands[0] = lowpart_subreg (<VI48_AVX512VL:avx512fmaskmode>mode, + operands[0], <SWI248x:MODE>mode); +} + [(set_attr "type" "ssecmp") + (set_attr "length_immediate" "1") + (set_attr "prefix" "evex") + (set_attr "mode" "<VI48_AVX512VL:sseinsnmode>")]) + (define_insn_and_split "*<avx512>_ucmp<mode>3" [(set (match_operand:<avx512fmaskmode> 0 "register_operand") (not:<avx512fmaskmode> diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 5bf6fef..69377db 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -73,7 +73,6 @@ extern rtx pa_return_addr_rtx (int, rtx); extern int pa_insn_refs_are_delayed (rtx_insn *); extern rtx pa_get_deferred_plabel (rtx); -extern rtx pa_maybe_emit_compare_and_swap_exchange_loop (rtx, rtx, rtx); #endif /* RTX_CODE */ extern int pa_and_mask_p (unsigned HOST_WIDE_INT); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 2b10ef3..895978a 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -11023,82 +11023,6 @@ pa_output_addr_diff_vec (rtx lab, rtx body) fputs ("\t.end_brtab\n", asm_out_file); } -/* This is a helper function for the other atomic operations. This function - emits a loop that contains SEQ that iterates until a compare-and-swap - operation at the end succeeds. MEM is the memory to be modified. SEQ is - a set of instructions that takes a value from OLD_REG as an input and - produces a value in NEW_REG as an output. Before SEQ, OLD_REG will be - set to the current contents of MEM. After SEQ, a compare-and-swap will - attempt to update MEM with NEW_REG. The function returns true when the - loop was generated successfully. */ - -static bool -pa_expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq) -{ - machine_mode mode = GET_MODE (mem); - rtx_code_label *label; - rtx cmp_reg, success, oldval; - - /* The loop we want to generate looks like - - cmp_reg = mem; - label: - old_reg = cmp_reg; - seq; - (success, cmp_reg) = compare-and-swap(mem, old_reg, new_reg) - if (success) - goto label; - - Note that we only do the plain load from memory once. Subsequent - iterations use the value loaded by the compare-and-swap pattern. */ - - label = gen_label_rtx (); - cmp_reg = gen_reg_rtx (mode); - - emit_move_insn (cmp_reg, mem); - emit_label (label); - emit_move_insn (old_reg, cmp_reg); - if (seq) - emit_insn (seq); - - success = NULL_RTX; - oldval = cmp_reg; - if (!expand_atomic_compare_and_swap (&success, &oldval, mem, old_reg, - new_reg, false, MEMMODEL_SYNC_SEQ_CST, - MEMMODEL_RELAXED)) - return false; - - if (oldval != cmp_reg) - emit_move_insn (cmp_reg, oldval); - - /* Mark this jump predicted not taken. */ - emit_cmp_and_jump_insns (success, const0_rtx, EQ, const0_rtx, - GET_MODE (success), 1, label, - profile_probability::guessed_never ()); - return true; -} - -/* This function tries to implement an atomic exchange operation using a - compare_and_swap loop. VAL is written to *MEM. The previous contents of - *MEM are returned, using TARGET if possible. No memory model is required - since a compare_and_swap loop is seq-cst. */ - -rtx -pa_maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val) -{ - machine_mode mode = GET_MODE (mem); - - if (can_compare_and_swap_p (mode, true)) - { - if (!target || !register_operand (target, mode)) - target = gen_reg_rtx (mode); - if (pa_expand_compare_and_swap_loop (mem, target, val, NULL_RTX)) - return target; - } - - return NULL_RTX; -} - /* Implement TARGET_CALLEE_COPIES. The callee is responsible for copying arguments passed by hidden reference in the 32-bit HP runtime. Users can override this behavior for better compatibility with openmp at the diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index f124c30..af5449a 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -10366,10 +10366,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_1"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], QImode); + DONE; } FAIL; }) @@ -10384,10 +10386,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_2"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], HImode); + DONE; } FAIL; }) @@ -10402,10 +10406,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_4"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], SImode); + DONE; } FAIL; }) @@ -10453,10 +10459,12 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" if (TARGET_SYNC_LIBCALL) { - rtx mem = operands[0]; - rtx val = operands[1]; - if (pa_maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val)) - DONE; + rtx libfunc = init_one_libfunc ("__sync_lock_test_and_set_8"); + + emit_library_call (libfunc, LCT_NORMAL, VOIDmode, + XEXP (operands[0], 0), Pmode, + operands[1], DImode); + DONE; } if (TARGET_64BIT || TARGET_SOFT_FLOAT) diff --git a/gcc/d/gdc.texi b/gcc/d/gdc.texi index 18cbb0e..8df05c3 100644 --- a/gcc/d/gdc.texi +++ b/gcc/d/gdc.texi @@ -295,14 +295,14 @@ values are supported: @item all Turns on all upcoming D language features. @item dip1000 -Implements @uref{http://wiki.dlang.org/DIP1000} (Scoped pointers). +Implements @uref{https://wiki.dlang.org/DIP1000} (Scoped pointers). @item dip1008 -Implements @uref{http://wiki.dlang.org/DIP1008} (Allow exceptions in +Implements @uref{https://wiki.dlang.org/DIP1008} (Allow exceptions in @code{@@nogc} code). @item dip1021 -Implements @uref{http://wiki.dlang.org/DIP1021} (Mutable function arguments). +Implements @uref{https://wiki.dlang.org/DIP1021} (Mutable function arguments). @item dip25 -Implements @uref{http://wiki.dlang.org/DIP25} (Sealed references). +Implements @uref{https://wiki.dlang.org/DIP25} (Sealed references). @item dtorfields Turns on generation for destructing fields of partially constructed objects. @item fieldwise @@ -352,7 +352,7 @@ are supported: @item all Turns off all revertable D language features. @item dip25 -Reverts @uref{http://wiki.dlang.org/DIP25} (Sealed references). +Reverts @uref{https://wiki.dlang.org/DIP25} (Sealed references). @item dtorfields Turns off generation for destructing fields of partially constructed objects. @item markdown diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index a8d4d5d..9f70cb5 100644 --- a/gcc/doc/contrib.texi +++ b/gcc/doc/contrib.texi @@ -190,7 +190,7 @@ Eric Christopher for his Java porting help and clean-ups. Branko Cibej for more warning contributions. @item -The @uref{http://www.gnu.org/software/classpath/,,GNU Classpath project} +The @uref{https://www.gnu.org/software/classpath/,,GNU Classpath project} for all of their merged runtime code. @item diff --git a/gcc/doc/contribute.texi b/gcc/doc/contribute.texi index a23240d..e3c1d43 100644 --- a/gcc/doc/contribute.texi +++ b/gcc/doc/contribute.texi @@ -7,18 +7,18 @@ If you would like to help pretest GCC releases to assure they work well, current development sources are available via Git (see -@uref{http://gcc.gnu.org/git.html}). Source and binary snapshots are -also available for FTP; see @uref{http://gcc.gnu.org/snapshots.html}. +@uref{https://gcc.gnu.org/git.html}). Source and binary snapshots are +also available for FTP; see @uref{https://gcc.gnu.org/snapshots.html}. If you would like to work on improvements to GCC, please read the advice at these URLs: @smallexample -@uref{http://gcc.gnu.org/contribute.html} -@uref{http://gcc.gnu.org/contributewhy.html} +@uref{https://gcc.gnu.org/contribute.html} +@uref{https://gcc.gnu.org/contributewhy.html} @end smallexample @noindent for information on how to make useful contributions and avoid duplication of effort. Suggested projects are listed at -@uref{http://gcc.gnu.org/projects/}. +@uref{https://gcc.gnu.org/projects/}. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index c291100..a53a45d 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -12298,7 +12298,7 @@ All objects must be the same size. There are 6 different memory orders that can be specified. These map to the C++11 memory orders with the same names, see the C++11 standard -or the @uref{http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync,GCC wiki +or the @uref{https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync,GCC wiki on atomic synchronization} for detailed definitions. Individual targets may also support additional memory orders for use on specific architectures. Refer to the target documentation for details of @@ -25011,7 +25011,7 @@ of foo is created by using the same function signature but with a different target string. Function foo is called or a pointer to it is taken just like a regular function. GCC takes care of doing the dispatching to call the right version at runtime. Refer to the -@uref{http://gcc.gnu.org/wiki/FunctionMultiVersioning, GCC wiki on +@uref{https://gcc.gnu.org/wiki/FunctionMultiVersioning, GCC wiki on Function Multiversioning} for more details. @node Type Traits diff --git a/gcc/doc/gccint.texi b/gcc/doc/gccint.texi index a81cbc7..825f645 100644 --- a/gcc/doc/gccint.texi +++ b/gcc/doc/gccint.texi @@ -93,7 +93,7 @@ interfaces to GCC front ends, and how support for a target system is implemented in GCC@. Additional tutorial information is linked to from -@uref{http://gcc.gnu.org/readings.html}. +@uref{https://gcc.gnu.org/readings.html}. @menu * Contributing:: How to contribute to testing and developing GCC. diff --git a/gcc/doc/gnu.texi b/gcc/doc/gnu.texi index 641fe30..8ff116a 100644 --- a/gcc/doc/gnu.texi +++ b/gcc/doc/gnu.texi @@ -15,6 +15,6 @@ systems. For more information, see: @smallexample -@uref{http://www.gnu.org/} -@uref{http://www.gnu.org/gnu/linux-and-gnu.html} +@uref{https://www.gnu.org/} +@uref{https://www.gnu.org/gnu/linux-and-gnu.html} @end smallexample diff --git a/gcc/doc/implement-c.texi b/gcc/doc/implement-c.texi index b656ac8..c5eea37 100644 --- a/gcc/doc/implement-c.texi +++ b/gcc/doc/implement-c.texi @@ -16,7 +16,7 @@ implementation-defined in one version of the standard. Some choices depend on the externally determined ABI for the platform (including standard character encodings) which GCC follows; these are listed as ``determined by ABI'' below. @xref{Compatibility, , Binary -Compatibility}, and @uref{http://gcc.gnu.org/readings.html}. Some +Compatibility}, and @uref{https://gcc.gnu.org/readings.html}. Some choices are documented in the preprocessor manual. @xref{Implementation-defined behavior, , Implementation-defined behavior, cpp, The C Preprocessor}. Some choices are made by the diff --git a/gcc/doc/implement-cxx.texi b/gcc/doc/implement-cxx.texi index 115f3fb..4703403 100644 --- a/gcc/doc/implement-cxx.texi +++ b/gcc/doc/implement-cxx.texi @@ -16,7 +16,7 @@ one version of the standard. Some choices depend on the externally determined ABI for the platform (including standard character encodings) which GCC follows; these are listed as ``determined by ABI'' below. @xref{Compatibility, , Binary -Compatibility}, and @uref{http://gcc.gnu.org/readings.html}. Some +Compatibility}, and @uref{https://gcc.gnu.org/readings.html}. Some choices are documented in the preprocessor manual. @xref{Implementation-defined behavior, , Implementation-defined behavior, cpp, The C Preprocessor}. Some choices are documented in diff --git a/gcc/doc/include/fdl.texi b/gcc/doc/include/fdl.texi index ce8c61b..45b40c7 100644 --- a/gcc/doc/include/fdl.texi +++ b/gcc/doc/include/fdl.texi @@ -7,7 +7,7 @@ gpl(7), fsf-funding(7). @c man end @c man begin COPYRIGHT Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. -@uref{http://fsf.org/} +@uref{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -46,7 +46,7 @@ of this license document, but changing it is not allowed. @display Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. -@uref{http://fsf.org/} +@uref{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -454,7 +454,7 @@ The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@uref{http://www.gnu.org/copyleft/}. +@uref{https://www.gnu.org/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff --git a/gcc/doc/include/gpl_v3.texi b/gcc/doc/include/gpl_v3.texi index 86d8190..c978f21 100644 --- a/gcc/doc/include/gpl_v3.texi +++ b/gcc/doc/include/gpl_v3.texi @@ -20,7 +20,7 @@ license document, but changing it is not allowed. @c This file is intended to be included in another file. @display -Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} +Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/} Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -699,7 +699,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program. If not, see @url{http://www.gnu.org/licenses/}. +along with this program. If not, see @url{https://www.gnu.org/licenses/}. @end smallexample Also add information on how to contact you by electronic and paper mail. @@ -722,7 +722,7 @@ use an ``about box''. You should also get your employer (if you work as a programmer) or school, if any, to sign a ``copyright disclaimer'' for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -@url{http://www.gnu.org/licenses/}. +@url{https://www.gnu.org/licenses/}. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index df3825f..0770f65 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -139,7 +139,7 @@ Free Documentation License}''. @end ifnothtml The latest version of this document is always available at -@uref{http://gcc.gnu.org/install/,,http://gcc.gnu.org/install/}. +@uref{https://gcc.gnu.org/install/,,https://gcc.gnu.org/install/}. It refers to the current development sources, instructions for specific released versions are included with the sources. @@ -156,7 +156,7 @@ We recommend you browse the entire generic installation instructions before you proceed. Lists of successful builds for released versions of GCC are -available at @uref{http://gcc.gnu.org/buildstat.html}. +available at @uref{https://gcc.gnu.org/buildstat.html}. These lists are updated as new information becomes available. The installation procedure itself is broken into five steps. @@ -559,10 +559,10 @@ own sources. @cindex Downloading GCC @cindex Downloading the Source -GCC is distributed via @uref{http://gcc.gnu.org/git.html,,git} and via +GCC is distributed via @uref{https://gcc.gnu.org/git.html,,git} and via HTTPS as tarballs compressed with @command{gzip} or @command{bzip2}. -Please refer to the @uref{http://gcc.gnu.org/releases.html,,releases web page} +Please refer to the @uref{https://gcc.gnu.org/releases.html,,releases web page} for information on how to obtain GCC@. The source distribution includes the C, C++, Objective-C, Fortran, @@ -2412,7 +2412,7 @@ Only supported for the AVR target. Specifies that @samp{AVR-Libc} is being used as the target C@tie{} library. This causes float support functions like @code{__addsf3} to be omitted from @file{libgcc.a} on the assumption that it will be provided by @file{libm.a}. For more -technical details, cf. @uref{http://gcc.gnu.org/PR54461,,PR54461}. +technical details, cf. @uref{https://gcc.gnu.org/PR54461,,PR54461}. It is not supported for RTEMS configurations, which currently use newlib. The option is supported since version 4.7.2 and is the default in 4.8.0 and newer. @@ -3021,9 +3021,9 @@ the code quality may be much worse. Before you install GCC, we encourage you to run the testsuites and to compare your results with results from a similar configuration that have been submitted to the -@uref{http://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}. +@uref{https://gcc.gnu.org/ml/gcc-testresults/,,gcc-testresults mailing list}. Some of these archived results are linked from the build status lists -at @uref{http://gcc.gnu.org/buildstat.html}, although not everyone who +at @uref{https://gcc.gnu.org/buildstat.html}, although not everyone who reports a successful build runs the testsuites and submits the results. This step is optional and may require you to download additional software, but it can give you confidence in your new GCC installation or point out @@ -3035,7 +3035,7 @@ These are part of the full distribution, but if you downloaded the separately. Second, you must have the testing tools installed. This includes -@uref{http://www.gnu.org/software/dejagnu/,,DejaGnu}, Tcl, and Expect; +@uref{https://www.gnu.org/software/dejagnu/,,DejaGnu}, Tcl, and Expect; the DejaGnu site has links to these. Some optional tests also require Python3 and pytest module. @@ -3066,7 +3066,7 @@ might emit some harmless messages resembling @samp{WARNING: Couldn't find tool init file} that can be ignored. If you are testing a cross-compiler, you may want to run the testsuite -on a simulator as described at @uref{http://gcc.gnu.org/simtest-howto.html}. +on a simulator as described at @uref{https://gcc.gnu.org/simtest-howto.html}. @section How can you run the testsuite on selected tests? @@ -3308,7 +3308,7 @@ make install-strip If you are bootstrapping a released version of GCC then please quickly review the build status page for your release, available from -@uref{http://gcc.gnu.org/buildstat.html}. +@uref{https://gcc.gnu.org/buildstat.html}. If your system is not listed for the version of GCC that you built, send a note to @email{gcc@@gcc.gnu.org} indicating @@ -3471,7 +3471,7 @@ The @uref{https://osdn.net/projects/mingw/,,MinGW} and number of platforms. @item -The @uref{http://gcc.gnu.org/wiki/GFortranBinaries,,GFortran Wiki} has +The @uref{https://gcc.gnu.org/wiki/GFortranBinaries,,GFortran Wiki} has links to GNU Fortran binaries for several platforms. @end itemize @@ -4138,7 +4138,7 @@ libstdc++-v3 documentation. @anchor{ix86-x-linux} @heading i?86-*-linux* As of GCC 3.3, binutils 2.13.1 or later is required for this platform. -See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information. +See @uref{https://gcc.gnu.org/PR10877,,bug 10877} for more information. If you receive Signal 11 errors when building on GNU/Linux, then it is possible you have a hardware problem. Further information on this can be @@ -4342,19 +4342,19 @@ overflow severe error when the @option{-bbigtoc} option is used to link GCC-produced object files into an executable that overflows the TOC@. A fix for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is available from IBM Customer Support and from its -@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com} +@uref{https://techsupport.services.ibm.com/,,techsupport.services.ibm.com} website as PTF U455193. The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core with a segmentation fault when invoked by any version of GCC@. A fix for APAR IX87327 is available from IBM Customer Support and from its -@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com} +@uref{https://techsupport.services.ibm.com/,,techsupport.services.ibm.com} website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above. The initial assembler shipped with AIX 4.3.0 generates incorrect object files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS TO ASSEMBLE/BIND) is available from IBM Customer Support and from its -@uref{http://techsupport.services.ibm.com/,,techsupport.services.ibm.com} +@uref{https://techsupport.services.ibm.com/,,techsupport.services.ibm.com} website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above. AIX provides National Language Support (NLS)@. Compilers and assemblers @@ -4603,7 +4603,7 @@ binaries are available at This version of GCC requires at least cctools-590.36. The cctools-590.36 package referenced from -@uref{http://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work +@uref{https://gcc.gnu.org/ml/gcc/2006-03/msg00507.html} will not work on systems older than 10.3.9 (aka darwin7.9.0). @html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 06b38f9..2fdab82 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21,7 +21,7 @@ For instructions on reporting bugs, see $$BUGURL$$. See the Info entry for @command{gcc}, or -@w{@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}}, +@w{@uref{https://gcc.gnu.org/onlinedocs/gcc/Contributors.html}}, for contributors to GCC@. @node Invoking GCC @@ -2318,7 +2318,7 @@ ISO C99. This standard is substantially completely supported, modulo bugs and floating-point issues (mainly but not entirely relating to optional C99 features from Annexes F and G). See -@w{@uref{http://gcc.gnu.org/c99status.html}} for more information. The +@w{@uref{https://gcc.gnu.org/c99status.html}} for more information. The names @samp{c9x} and @samp{iso9899:199x} are deprecated. @item c11 @@ -6683,7 +6683,7 @@ The standard is worded confusingly, therefore there is some debate over the precise meaning of the sequence point rules in subtle cases. Links to discussions of the problem, including proposed formal definitions, may be found on the GCC readings page, at -@uref{http://gcc.gnu.org/@/readings.html}. +@uref{https://gcc.gnu.org/@/readings.html}. This warning is enabled by @option{-Wall} for C and C++. @@ -17292,7 +17292,7 @@ visibility so that the @samp{type_info} nodes are unified between the DSOs. An overview of these techniques, their benefits and how to use them -is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}. +is at @uref{https://gcc.gnu.org/@/wiki/@/Visibility}. @item -fstrict-volatile-bitfields @opindex fstrict-volatile-bitfields @@ -25202,7 +25202,7 @@ generates 64-bit code when you select a 64-bit architecture, but you can use @option{-mgp32} to get 32-bit code instead. For information about the O64 ABI, see -@uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}. +@uref{https://gcc.gnu.org/@/projects/@/mipso64-abi.html}. GCC supports a variant of the o32 ABI in which floating-point registers are 64 rather than 32 bits wide. You can select this combination with diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index 9046cbe..ea33595 100644 --- a/gcc/doc/passes.texi +++ b/gcc/doc/passes.texi @@ -724,7 +724,7 @@ into several threads. The pass is implemented in @file{tree-parloops.c}. Graphite is a loop transformation framework based on the polyhedral model. Graphite stands for Gimple Represented as Polyhedra. The internals of this infrastructure are documented in -@w{@uref{http://gcc.gnu.org/wiki/Graphite}}. The passes working on +@w{@uref{https://gcc.gnu.org/wiki/Graphite}}. The passes working on this representation are implemented in the various @file{graphite-*} files. diff --git a/gcc/doc/service.texi b/gcc/doc/service.texi index 75f16b3..0fbce71 100644 --- a/gcc/doc/service.texi +++ b/gcc/doc/service.texi @@ -24,4 +24,4 @@ The service directory is found at @end itemize For further information, see -@uref{http://gcc.gnu.org/faq.html#support}. +@uref{https://gcc.gnu.org/faq.html#support}. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 702cd0c..f06f897 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -7,7 +7,7 @@ This chapter describes the structure of the GCC source tree, and how GCC is built. The user documentation for building and installing GCC -is in a separate manual (@uref{http://gcc.gnu.org/install/}), with +is in a separate manual (@uref{https://gcc.gnu.org/install/}), with which it is presumed that you are familiar. @menu diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index 128b1c6..be773ff 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -92,7 +92,7 @@ A new edition of the ISO C standard was published in 1999 as ISO/IEC development, drafts of this standard version were referred to as @dfn{C9X}.) GCC has substantially complete support for this standard version; see -@uref{http://gcc.gnu.org/c99status.html} for details. To select this +@uref{https://gcc.gnu.org/c99status.html} for details. To select this standard, use @option{-std=c99} or @option{-std=iso9899:1999}. Errors in the 1999 ISO C standard were corrected in three Technical @@ -187,7 +187,7 @@ to @code{abort}. For references to Technical Corrigenda, Rationale documents and information concerning the history of C that is available online, see -@uref{http://gcc.gnu.org/readings.html} +@uref{https://gcc.gnu.org/readings.html} @section C++ Language @@ -313,7 +313,7 @@ The authoritative manual on Objective-C 2.0 is available from Apple: @end itemize For more information concerning the history of Objective-C that is -available online, see @uref{http://gcc.gnu.org/readings.html} +available online, see @uref{https://gcc.gnu.org/readings.html} @section Go Language diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 5efbba8..687c808 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2021-12-22 Harald Anlauf <anlauf@gmx.de> + + PR fortran/103778 + * check.c (is_c_interoperable): A BOZ literal constant is not + interoperable. + +2021-12-22 Harald Anlauf <anlauf@gmx.de> + + PR fortran/103776 + * match.c (match_case_selector): Reject expressions in CASE + selector which are not scalar. + 2021-12-18 Harald Anlauf <anlauf@gmx.de> PR fortran/103412 diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 625473c..b4db933 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -5185,6 +5185,12 @@ is_c_interoperable (gfc_expr *expr, const char **msg, bool c_loc, bool c_f_ptr) return false; } + if (expr->ts.type == BT_BOZ) + { + *msg = "BOZ literal constant"; + return false; + } + if (expr->ts.type == BT_CLASS) { *msg = "Expression is polymorphic"; diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 3264709..e779147 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -246,11 +246,11 @@ including OpenMP and OpenACC support for parallel programming. The GNU Fortran compiler passes the @uref{http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html, NIST Fortran 77 Test Suite}, and produces acceptable results on the -@uref{http://www.netlib.org/lapack/faq.html#1.21, LAPACK Test Suite}. +@uref{https://www.netlib.org/lapack/faq.html#1.21, LAPACK Test Suite}. It also provides respectable performance on the @uref{https://polyhedron.com/?page_id=175, Polyhedron Fortran compiler benchmarks} and the -@uref{http://www.netlib.org/benchmark/livermore, +@uref{https://www.netlib.org/benchmark/livermore, Livermore Fortran Kernels test}. It has been used to compile a number of large real-world programs, including @uref{http://hirlam.org/, the HARMONIE and HIRLAM weather forecasting code} and @@ -441,9 +441,9 @@ found in the following sections of the documentation. Additionally, the GNU Fortran compilers supports the OpenMP specification (version 4.5 and partial support of the features of the 5.0 version, -@url{http://openmp.org/@/openmp-specifications/}). +@url{https://openmp.org/@/openmp-specifications/}). There also is support for the OpenACC specification (targeting -version 2.6, @uref{http://www.openacc.org/}). See +version 2.6, @uref{https://www.openacc.org/}). See @uref{https://gcc.gnu.org/wiki/OpenACC} for more information. @node Fortran 95 status @@ -456,7 +456,7 @@ The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000) varying length character strings. While GNU Fortran currently does not support such strings directly, there exist two Fortran implementations for them, which work with GNU Fortran. They can be found at -@uref{http://www.fortran.com/@/iso_varying_string.f95} and at +@uref{https://www.fortran.com/@/iso_varying_string.f95} and at @uref{ftp://ftp.nag.co.uk/@/sc22wg5/@/ISO_VARYING_STRING/}. Deferred-length character strings of Fortran 2003 supports part of @@ -1786,7 +1786,7 @@ It consists of a set of compiler directives, library routines, and environment variables that influence run-time behavior. GNU Fortran strives to be compatible to the -@uref{http://openmp.org/wp/openmp-specifications/, +@uref{https://openmp.org/wp/openmp-specifications/, OpenMP Application Program Interface v4.5}. To enable the processing of the OpenMP directive @code{!$omp} in @@ -1844,7 +1844,7 @@ compiler directives, library routines, and environment variables that influence run-time behavior. GNU Fortran strives to be compatible to the -@uref{http://www.openacc.org/, OpenACC Application Programming +@uref{https://www.openacc.org/, OpenACC Application Programming Interface v2.6}. To enable the processing of the OpenACC directive @code{!$acc} in diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi index 04d4cb5..c947425 100644 --- a/gcc/fortran/intrinsic.texi +++ b/gcc/fortran/intrinsic.texi @@ -15245,7 +15245,7 @@ the named constants defined in the modules are listed below. For details refer to the actual -@uref{http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf, +@uref{https://www.openmp.org/wp-content/uploads/openmp-4.5.pdf, OpenMP Application Program Interface v4.5} and @uref{https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf, OpenMP Application Program Interface v5.0}. @@ -15410,7 +15410,7 @@ Runtime Library} manual, the named constants defined in the modules are listed below. For details refer to the actual -@uref{http://www.openacc.org/, +@uref{https://www.openacc.org/, OpenACC Application Programming Interface v2.6}. @code{OPENACC} provides the scalar default-integer diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 52bc5af..617fb35 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -6088,6 +6088,19 @@ match_case_selector (gfc_case **cp) } } + if (c->low && c->low->rank != 0) + { + gfc_error ("Expression in CASE selector at %L must be scalar", + &c->low->where); + goto cleanup; + } + if (c->high && c->high->rank != 0) + { + gfc_error ("Expression in CASE selector at %L must be scalar", + &c->high->where); + goto cleanup; + } + *cp = c; return MATCH_YES; diff --git a/gcc/go/gccgo.texi b/gcc/go/gccgo.texi index 1d3f5b1..e2da482 100644 --- a/gcc/go/gccgo.texi +++ b/gcc/go/gccgo.texi @@ -45,7 +45,7 @@ This manual describes how to use @command{gccgo}, the GNU compiler for the Go programming language. This manual is specifically about @command{gccgo}. For more information about the Go programming language in general, including language specifications and standard -package documentation, see @uref{http://golang.org/}. +package documentation, see @uref{https://golang.org/}. @menu * Copying:: The GNU General Public License. @@ -335,7 +335,7 @@ or with C++ code compiled using @code{extern "C"}. This information is provided largely for documentation purposes. For ordinary use it is best to build programs with the go tool and then use @code{import "C"}, as described at -@url{http://golang.org/cmd/cgo}. +@url{https://golang.org/cmd/cgo}. @menu * C Type Interoperability:: How C and Go types match up. diff --git a/gcc/jit/docs/_build/texinfo/libgccjit.texi b/gcc/jit/docs/_build/texinfo/libgccjit.texi index 724c388..2e6c040 100644 --- a/gcc/jit/docs/_build/texinfo/libgccjit.texi +++ b/gcc/jit/docs/_build/texinfo/libgccjit.texi @@ -63,9 +63,9 @@ Copyright @copyright{} 2014-2021 Free Software Foundation, Inc. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. -This document describes libgccjit@footnote{http://gcc.gnu.org/wiki/JIT}, an API +This document describes libgccjit@footnote{https://gcc.gnu.org/wiki/JIT}, an API for embedding GCC inside programs and libraries. There are actually two APIs for the library: @@ -98,7 +98,7 @@ Contents: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Tutorial:: @@ -418,7 +418,7 @@ Running the test suite @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Tutorial part 1; “Hello world”: Tutorial part 1 “Hello world”. @@ -463,7 +463,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit.h> @@ -606,7 +606,7 @@ hello world @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 2 Creating a trivial machine code function,Tutorial part 3 Loops and variables,Tutorial part 1 “Hello world”,Tutorial @anchor{intro/tutorial02 doc}@anchor{6}@anchor{intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{7} @@ -1001,7 +1001,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit.h> @@ -1128,7 +1128,7 @@ result: 25 @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 3 Loops and variables,Tutorial part 4 Adding JIT-compilation to a toy interpreter,Tutorial part 2 Creating a trivial machine code function,Tutorial @anchor{intro/tutorial03 doc}@anchor{21}@anchor{intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{22} @@ -1560,7 +1560,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit.h> @@ -1746,7 +1746,7 @@ loop_test returned: 285 @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 4 Adding JIT-compilation to a toy interpreter,Tutorial part 5 Implementing an Ahead-of-Time compiler,Tutorial part 3 Loops and variables,Tutorial @anchor{intro/tutorial04 doc}@anchor{35}@anchor{intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{36} @@ -3605,7 +3605,7 @@ instr9: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 5 Implementing an Ahead-of-Time compiler,,Tutorial part 4 Adding JIT-compilation to a toy interpreter,Tutorial @anchor{intro/tutorial05 doc}@anchor{48}@anchor{intro/tutorial05 tutorial-part-5-implementing-an-ahead-of-time-compiler}@anchor{49} @@ -4409,7 +4409,7 @@ and to a dynamic library. See the documentation of @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Topic Reference,C++ bindings for libgccjit,Tutorial,Top @anchor{topics/index doc}@anchor{4f}@anchor{topics/index topic-reference}@anchor{50} @@ -4431,7 +4431,7 @@ and to a dynamic library. See the documentation of @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Compilation contexts:: @@ -5137,7 +5137,7 @@ its presence using @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Objects,Types,Compilation contexts,Topic Reference @anchor{topics/objects doc}@anchor{76}@anchor{topics/objects objects}@anchor{77} @@ -5247,7 +5247,7 @@ object’s context is released. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Types,Expressions,Objects,Topic Reference @anchor{topics/types doc}@anchor{79}@anchor{topics/types types}@anchor{7a} @@ -5883,7 +5883,7 @@ Function pointer types can be created using @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Expressions,Creating and using functions,Types,Topic Reference @anchor{topics/expressions doc}@anchor{96}@anchor{topics/expressions expressions}@anchor{97} @@ -6924,7 +6924,7 @@ in C (or, indeed, to @code{PTR + INDEX}). @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Creating and using functions,Function pointers<2>,Expressions,Topic Reference @anchor{topics/functions doc}@anchor{d5}@anchor{topics/functions creating-and-using-functions}@anchor{d6} @@ -7549,7 +7549,7 @@ assembler statements to a function. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Function pointers<2>,Source Locations,Creating and using functions,Topic Reference @anchor{topics/function-pointers doc}@anchor{f2}@anchor{topics/function-pointers function-pointers}@anchor{f3} @@ -7630,7 +7630,7 @@ Each of @cite{param_types} must be non-@cite{void}; @cite{return_type} may be @c @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Source Locations,Compiling a context,Function pointers<2>,Topic Reference @anchor{topics/locations doc}@anchor{f5}@anchor{topics/locations source-locations}@anchor{f6} @@ -7714,7 +7714,7 @@ file, giving you @emph{something} you can step through in the debugger. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Compiling a context,ABI and API compatibility,Source Locations,Topic Reference @anchor{topics/compilation doc}@anchor{f8}@anchor{topics/compilation compiling-a-context}@anchor{f9} @@ -7985,7 +7985,7 @@ against. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node ABI and API compatibility,Performance,Compiling a context,Topic Reference @anchor{topics/compatibility doc}@anchor{101}@anchor{topics/compatibility abi-and-api-compatibility}@anchor{102} @@ -8350,7 +8350,7 @@ embedding assembler instructions: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Performance,Using Assembly Language with libgccjit,ABI and API compatibility,Topic Reference @anchor{topics/performance doc}@anchor{12c}@anchor{topics/performance performance}@anchor{12d} @@ -8633,7 +8633,7 @@ for its presence using @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Using Assembly Language with libgccjit,,Performance,Topic Reference @anchor{topics/asm doc}@anchor{131}@anchor{topics/asm using-assembly-language-with-libgccjit}@anchor{132} @@ -9030,7 +9030,7 @@ the following API calls could be used: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node C++ bindings for libgccjit,Internals,Topic Reference,Top @anchor{cp/index doc}@anchor{135}@anchor{cp/index c-bindings-for-libgccjit}@anchor{136} @@ -9038,7 +9038,7 @@ the following API calls could be used: This document describes the C++ bindings to -libgccjit@footnote{http://gcc.gnu.org/wiki/JIT}, an API for embedding GCC +libgccjit@footnote{https://gcc.gnu.org/wiki/JIT}, an API for embedding GCC inside programs and libraries. The C++ bindings consist of a single header file @code{libgccjit++.h}. @@ -9064,7 +9064,7 @@ Contents: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Tutorial: Tutorial<2>. @@ -9092,7 +9092,7 @@ Contents: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Tutorial part 1; “Hello world”: Tutorial part 1 “Hello world”<2>. @@ -9136,7 +9136,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit++.h> @@ -9263,7 +9263,7 @@ hello world @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 2 Creating a trivial machine code function<2>,Tutorial part 3 Loops and variables<2>,Tutorial part 1 “Hello world”<2>,Tutorial<2> @anchor{cp/intro/tutorial02 doc}@anchor{13b}@anchor{cp/intro/tutorial02 tutorial-part-2-creating-a-trivial-machine-code-function}@anchor{13c} @@ -9606,7 +9606,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit++.h> @@ -9715,7 +9715,7 @@ result: 25 @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 3 Loops and variables<2>,Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,Tutorial part 2 Creating a trivial machine code function<2>,Tutorial<2> @anchor{cp/intro/tutorial03 doc}@anchor{14c}@anchor{cp/intro/tutorial03 tutorial-part-3-loops-and-variables}@anchor{14d} @@ -10164,7 +10164,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see -<http://www.gnu.org/licenses/>. */ +<https://www.gnu.org/licenses/>. */ #include <libgccjit++.h> @@ -10315,7 +10315,7 @@ loop_test returned: 285 @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Tutorial part 4 Adding JIT-compilation to a toy interpreter<2>,,Tutorial part 3 Loops and variables<2>,Tutorial<2> @anchor{cp/intro/tutorial04 doc}@anchor{15e}@anchor{cp/intro/tutorial04 tutorial-part-4-adding-jit-compilation-to-a-toy-interpreter}@anchor{15f} @@ -12119,7 +12119,7 @@ instr9: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Topic Reference<2>,,Tutorial<2>,C++ bindings for libgccjit @anchor{cp/topics/index doc}@anchor{16f}@anchor{cp/topics/index topic-reference}@anchor{170} @@ -12141,7 +12141,7 @@ instr9: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @menu * Compilation contexts: Compilation contexts<2>. @@ -12468,7 +12468,7 @@ its presence using @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Objects<2>,Types<2>,Compilation contexts<2>,Topic Reference<2> @anchor{cp/topics/objects doc}@anchor{1ab}@anchor{cp/topics/objects objects}@anchor{1ac} @@ -12560,7 +12560,7 @@ obj: 4.0 * (float)i @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Types<2>,Expressions<2>,Objects<2>,Topic Reference<2> @anchor{cp/topics/types doc}@anchor{1b7}@anchor{cp/topics/types types}@anchor{1b8} @@ -12828,7 +12828,7 @@ size of the struct is not known), or later specified using @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Expressions<2>,Creating and using functions<2>,Types<2>,Topic Reference<2> @anchor{cp/topics/expressions doc}@anchor{1f6}@anchor{cp/topics/expressions expressions}@anchor{1f7} @@ -13638,7 +13638,7 @@ gccjit::lvalue element = array[0]; @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Creating and using functions<2>,Source Locations<2>,Expressions<2>,Topic Reference<2> @anchor{cp/topics/functions doc}@anchor{2fb}@anchor{cp/topics/functions creating-and-using-functions}@anchor{2fc} @@ -14061,7 +14061,7 @@ create_code (gcc_jit_context *c_ctxt, void *user_data) @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Source Locations<2>,Compiling a context<2>,Creating and using functions<2>,Topic Reference<2> @anchor{cp/topics/locations doc}@anchor{33e}@anchor{cp/topics/locations source-locations}@anchor{33f} @@ -14138,7 +14138,7 @@ file, giving you @emph{something} you can step through in the debugger. @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Compiling a context<2>,Using Assembly Language with libgccjit++,Source Locations<2>,Topic Reference<2> @anchor{cp/topics/compilation doc}@anchor{347}@anchor{cp/topics/compilation compiling-a-context}@anchor{348} @@ -14210,7 +14210,7 @@ This is a thin wrapper around the @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Using Assembly Language with libgccjit++,,Compiling a context<2>,Topic Reference<2> @anchor{cp/topics/asm doc}@anchor{352}@anchor{cp/topics/asm using-assembly-language-with-libgccjit}@anchor{353} @@ -14603,7 +14603,7 @@ the following API calls could be used: @c @c You should have received a copy of the GNU General Public License @c along with this program. If not, see -@c <http://www.gnu.org/licenses/>. +@c <https://www.gnu.org/licenses/>. @node Internals,Indices and tables,C++ bindings for libgccjit,Top @anchor{internals/index doc}@anchor{382}@anchor{internals/index internals}@anchor{383} @@ -14769,11 +14769,11 @@ The jit testsuite detects if @geindex environment variable; RUN_UNDER_VALGRIND @code{RUN_UNDER_VALGRIND} is present in the environment (with any value). If it is present, it runs the test client -code under valgrind@footnote{http://valgrind.org}, +code under valgrind@footnote{https://valgrind.org}, specifcally, the default -memcheck@footnote{http://valgrind.org/docs/manual/mc-manual.html} +memcheck@footnote{https://valgrind.org/docs/manual/mc-manual.html} tool with ---leak-check=full@footnote{http://valgrind.org/docs/manual/mc-manual.html#opt.leak-check}. +--leak-check=full@footnote{https://valgrind.org/docs/manual/mc-manual.html#opt.leak-check}. It automatically parses the output from valgrind, injecting XFAIL results if any issues are found, or PASS results if the output is clean. The output @@ -15556,7 +15556,7 @@ array. See the file for examples. Typically a patch that touches the .rst documentation will also need the texinfo to be regenerated. You can do this with -Sphinx 1.0@footnote{http://sphinx-doc.org/} or later by +Sphinx 1.0@footnote{https://sphinx-doc.org/} or later by running @code{make texinfo} within @code{SRCDIR/gcc/jit/docs}. Don’t do this within the patch sent to the mailing list; it can often be relatively large and inconsequential (e.g. anchor renumbering), rather like generated @@ -15586,7 +15586,7 @@ search @c The Sphinx C domain appears to lack explicit support for enum values, @c so I've been using :c:macro: for them. @c -@c See http://sphinx-doc.org/domains.html#the-c-domain +@c See https://sphinx-doc.org/domains.html#the-c-domain @node Index,,Indices and tables,Top @unnumbered Index diff --git a/gcc/jit/docs/cp/index.rst b/gcc/jit/docs/cp/index.rst index 3bffc98..6857e20 100644 --- a/gcc/jit/docs/cp/index.rst +++ b/gcc/jit/docs/cp/index.rst @@ -13,13 +13,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. C++ bindings for libgccjit ========================== This document describes the C++ bindings to -`libgccjit <http://gcc.gnu.org/wiki/JIT>`_, an API for embedding GCC +`libgccjit <https://gcc.gnu.org/wiki/JIT>`_, an API for embedding GCC inside programs and libraries. The C++ bindings consist of a single header file ``libgccjit++.h``. diff --git a/gcc/jit/docs/cp/intro/index.rst b/gcc/jit/docs/cp/intro/index.rst index df2814e..6a87ad1 100644 --- a/gcc/jit/docs/cp/intro/index.rst +++ b/gcc/jit/docs/cp/intro/index.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Tutorial ======== diff --git a/gcc/jit/docs/cp/intro/tutorial01.rst b/gcc/jit/docs/cp/intro/tutorial01.rst index 866f0af..6c487e7 100644 --- a/gcc/jit/docs/cp/intro/tutorial01.rst +++ b/gcc/jit/docs/cp/intro/tutorial01.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/intro/tutorial02.rst b/gcc/jit/docs/cp/intro/tutorial02.rst index 0b07c6e..be8938e 100644 --- a/gcc/jit/docs/cp/intro/tutorial02.rst +++ b/gcc/jit/docs/cp/intro/tutorial02.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/intro/tutorial03.rst b/gcc/jit/docs/cp/intro/tutorial03.rst index 2c122fc..e313ef2 100644 --- a/gcc/jit/docs/cp/intro/tutorial03.rst +++ b/gcc/jit/docs/cp/intro/tutorial03.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/intro/tutorial04.rst b/gcc/jit/docs/cp/intro/tutorial04.rst index f556cde..1d42f4b 100644 --- a/gcc/jit/docs/cp/intro/tutorial04.rst +++ b/gcc/jit/docs/cp/intro/tutorial04.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/asm.rst b/gcc/jit/docs/cp/topics/asm.rst index 8c36d0a..4a59682 100644 --- a/gcc/jit/docs/cp/topics/asm.rst +++ b/gcc/jit/docs/cp/topics/asm.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/compilation.rst b/gcc/jit/docs/cp/topics/compilation.rst index f82c1e7..7f987a5 100644 --- a/gcc/jit/docs/cp/topics/compilation.rst +++ b/gcc/jit/docs/cp/topics/compilation.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/contexts.rst b/gcc/jit/docs/cp/topics/contexts.rst index af0b64f..6876fef 100644 --- a/gcc/jit/docs/cp/topics/contexts.rst +++ b/gcc/jit/docs/cp/topics/contexts.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/expressions.rst b/gcc/jit/docs/cp/topics/expressions.rst index c569b0d..9f7ef64 100644 --- a/gcc/jit/docs/cp/topics/expressions.rst +++ b/gcc/jit/docs/cp/topics/expressions.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/functions.rst b/gcc/jit/docs/cp/topics/functions.rst index 4ba6f64..addc0fd 100644 --- a/gcc/jit/docs/cp/topics/functions.rst +++ b/gcc/jit/docs/cp/topics/functions.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/index.rst b/gcc/jit/docs/cp/topics/index.rst index 3ff460f..2f888d6 100644 --- a/gcc/jit/docs/cp/topics/index.rst +++ b/gcc/jit/docs/cp/topics/index.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Topic Reference =============== diff --git a/gcc/jit/docs/cp/topics/locations.rst b/gcc/jit/docs/cp/topics/locations.rst index f9e34a5..2a50527 100644 --- a/gcc/jit/docs/cp/topics/locations.rst +++ b/gcc/jit/docs/cp/topics/locations.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/objects.rst b/gcc/jit/docs/cp/topics/objects.rst index ada7167..4dc114f 100644 --- a/gcc/jit/docs/cp/topics/objects.rst +++ b/gcc/jit/docs/cp/topics/objects.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/cp/topics/types.rst b/gcc/jit/docs/cp/topics/types.rst index c847e78..2abdfc0 100644 --- a/gcc/jit/docs/cp/topics/types.rst +++ b/gcc/jit/docs/cp/topics/types.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: cpp diff --git a/gcc/jit/docs/index.rst b/gcc/jit/docs/index.rst index fe3d741..6102b44 100644 --- a/gcc/jit/docs/index.rst +++ b/gcc/jit/docs/index.rst @@ -13,12 +13,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. libgccjit ========= -This document describes `libgccjit <http://gcc.gnu.org/wiki/JIT>`_, an API +This document describes `libgccjit <https://gcc.gnu.org/wiki/JIT>`_, an API for embedding GCC inside programs and libraries. There are actually two APIs for the library: @@ -51,4 +51,4 @@ Indices and tables The Sphinx C domain appears to lack explicit support for enum values, so I've been using :c:macro: for them. - See http://sphinx-doc.org/domains.html#the-c-domain + See https://sphinx-doc.org/domains.html#the-c-domain diff --git a/gcc/jit/docs/internals/index.rst b/gcc/jit/docs/internals/index.rst index 3a4f628..799eb93 100644 --- a/gcc/jit/docs/internals/index.rst +++ b/gcc/jit/docs/internals/index.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Internals ========= @@ -136,12 +136,12 @@ Running under valgrind The jit testsuite detects if :envvar:`RUN_UNDER_VALGRIND` is present in the environment (with any value). If it is present, it runs the test client -code under `valgrind <http://valgrind.org>`_, +code under `valgrind <https://valgrind.org>`_, specifcally, the default -`memcheck <http://valgrind.org/docs/manual/mc-manual.html>`_ +`memcheck <https://valgrind.org/docs/manual/mc-manual.html>`_ tool with `--leak-check=full -<http://valgrind.org/docs/manual/mc-manual.html#opt.leak-check>`_. +<https://valgrind.org/docs/manual/mc-manual.html#opt.leak-check>`_. It automatically parses the output from valgrind, injecting XFAIL results if any issues are found, or PASS results if the output is clean. The output @@ -431,7 +431,7 @@ Every new testcase that doesn't generate errors should also touch Typically a patch that touches the .rst documentation will also need the texinfo to be regenerated. You can do this with -`Sphinx 1.0 <http://sphinx-doc.org/>`_ or later by +`Sphinx 1.0 <https://sphinx-doc.org/>`_ or later by running ``make texinfo`` within ``SRCDIR/gcc/jit/docs``. Don't do this within the patch sent to the mailing list; it can often be relatively large and inconsequential (e.g. anchor renumbering), rather like generated diff --git a/gcc/jit/docs/intro/index.rst b/gcc/jit/docs/intro/index.rst index 98df155..9a47f76 100644 --- a/gcc/jit/docs/intro/index.rst +++ b/gcc/jit/docs/intro/index.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Tutorial ======== diff --git a/gcc/jit/docs/intro/tutorial01.rst b/gcc/jit/docs/intro/tutorial01.rst index c194ac0..e32e121 100644 --- a/gcc/jit/docs/intro/tutorial01.rst +++ b/gcc/jit/docs/intro/tutorial01.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/intro/tutorial02.rst b/gcc/jit/docs/intro/tutorial02.rst index 2ec338b..43ecb8e 100644 --- a/gcc/jit/docs/intro/tutorial02.rst +++ b/gcc/jit/docs/intro/tutorial02.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/intro/tutorial03.rst b/gcc/jit/docs/intro/tutorial03.rst index b0bc797..6ee083e 100644 --- a/gcc/jit/docs/intro/tutorial03.rst +++ b/gcc/jit/docs/intro/tutorial03.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Tutorial part 3: Loops and variables ------------------------------------ diff --git a/gcc/jit/docs/intro/tutorial04.rst b/gcc/jit/docs/intro/tutorial04.rst index 18ce86e..b30cc07 100644 --- a/gcc/jit/docs/intro/tutorial04.rst +++ b/gcc/jit/docs/intro/tutorial04.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Tutorial part 4: Adding JIT-compilation to a toy interpreter ------------------------------------------------------------ diff --git a/gcc/jit/docs/intro/tutorial05.rst b/gcc/jit/docs/intro/tutorial05.rst index 8ba14c2..7c66b78 100644 --- a/gcc/jit/docs/intro/tutorial05.rst +++ b/gcc/jit/docs/intro/tutorial05.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Tutorial part 5: Implementing an Ahead-of-Time compiler ------------------------------------------------------- diff --git a/gcc/jit/docs/topics/asm.rst b/gcc/jit/docs/topics/asm.rst index 0a1e48e..02c1df5 100644 --- a/gcc/jit/docs/topics/asm.rst +++ b/gcc/jit/docs/topics/asm.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/compatibility.rst b/gcc/jit/docs/topics/compatibility.rst index c6c14f0..91b00d9 100644 --- a/gcc/jit/docs/topics/compatibility.rst +++ b/gcc/jit/docs/topics/compatibility.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/compilation.rst b/gcc/jit/docs/topics/compilation.rst index b6ace12..29f8b05 100644 --- a/gcc/jit/docs/topics/compilation.rst +++ b/gcc/jit/docs/topics/compilation.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/contexts.rst b/gcc/jit/docs/topics/contexts.rst index 00fb17e..c51ae364 100644 --- a/gcc/jit/docs/topics/contexts.rst +++ b/gcc/jit/docs/topics/contexts.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/expressions.rst b/gcc/jit/docs/topics/expressions.rst index 0a96872..6860cc6 100644 --- a/gcc/jit/docs/topics/expressions.rst +++ b/gcc/jit/docs/topics/expressions.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/function-pointers.rst b/gcc/jit/docs/topics/function-pointers.rst index 828eda8..8ea08fe 100644 --- a/gcc/jit/docs/topics/function-pointers.rst +++ b/gcc/jit/docs/topics/function-pointers.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/functions.rst b/gcc/jit/docs/topics/functions.rst index 8399345..497caa6 100644 --- a/gcc/jit/docs/topics/functions.rst +++ b/gcc/jit/docs/topics/functions.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/index.rst b/gcc/jit/docs/topics/index.rst index 1af8846..587fb8a 100644 --- a/gcc/jit/docs/topics/index.rst +++ b/gcc/jit/docs/topics/index.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. Topic Reference =============== diff --git a/gcc/jit/docs/topics/locations.rst b/gcc/jit/docs/topics/locations.rst index 8c276e1..2c2139b 100644 --- a/gcc/jit/docs/topics/locations.rst +++ b/gcc/jit/docs/topics/locations.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/objects.rst b/gcc/jit/docs/topics/objects.rst index 0df8076..587133e 100644 --- a/gcc/jit/docs/topics/objects.rst +++ b/gcc/jit/docs/topics/objects.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/performance.rst b/gcc/jit/docs/topics/performance.rst index 92f5899..8255740 100644 --- a/gcc/jit/docs/topics/performance.rst +++ b/gcc/jit/docs/topics/performance.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c diff --git a/gcc/jit/docs/topics/types.rst b/gcc/jit/docs/topics/types.rst index 6260e9a..7de8d38 100644 --- a/gcc/jit/docs/topics/types.rst +++ b/gcc/jit/docs/topics/types.rst @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see - <http://www.gnu.org/licenses/>. + <https://www.gnu.org/licenses/>. .. default-domain:: c @@ -1014,8 +1014,6 @@ void finish_options (struct gcc_options *opts, struct gcc_options *opts_set, location_t loc) { - enum unwind_info_type ui_except; - if (opts->x_dump_base_name && ! opts->x_dump_base_name_prefixed) { @@ -1116,61 +1114,6 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_flag_no_inline = 1; } - /* The optimization to partition hot and cold basic blocks into separate - sections of the .o and executable files does not work (currently) - with exception handling. This is because there is no support for - generating unwind info. If opts->x_flag_exceptions is turned on - we need to turn off the partitioning optimization. */ - - ui_except = targetm_common.except_unwind_info (opts); - - if (opts->x_flag_exceptions - && opts->x_flag_reorder_blocks_and_partition - && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)) - { - if (opts_set->x_flag_reorder_blocks_and_partition) - inform (loc, - "%<-freorder-blocks-and-partition%> does not work " - "with exceptions on this architecture"); - opts->x_flag_reorder_blocks_and_partition = 0; - opts->x_flag_reorder_blocks = 1; - } - - /* If user requested unwind info, then turn off the partitioning - optimization. */ - - if (opts->x_flag_unwind_tables - && !targetm_common.unwind_tables_default - && opts->x_flag_reorder_blocks_and_partition - && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)) - { - if (opts_set->x_flag_reorder_blocks_and_partition) - inform (loc, - "%<-freorder-blocks-and-partition%> does not support " - "unwind info on this architecture"); - opts->x_flag_reorder_blocks_and_partition = 0; - opts->x_flag_reorder_blocks = 1; - } - - /* If the target requested unwind info, then turn off the partitioning - optimization with a different message. Likewise, if the target does not - support named sections. */ - - if (opts->x_flag_reorder_blocks_and_partition - && (!targetm_common.have_named_sections - || (opts->x_flag_unwind_tables - && targetm_common.unwind_tables_default - && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)))) - { - if (opts_set->x_flag_reorder_blocks_and_partition) - inform (loc, - "%<-freorder-blocks-and-partition%> does not work " - "on this architecture"); - opts->x_flag_reorder_blocks_and_partition = 0; - opts->x_flag_reorder_blocks = 1; - } - - /* Pipelining of outer loops is only possible when general pipelining capabilities are requested. */ if (!opts->x_flag_sel_sched_pipelining) @@ -1406,6 +1349,74 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, && debug_info_level >= DINFO_LEVEL_NORMAL && dwarf_debuginfo_p () && !(flag_selective_scheduling || flag_selective_scheduling2)); + + diagnose_options (opts, opts_set, loc); +} + +/* The function diagnoses incompatible combinations for provided options + (OPTS and OPTS_SET) at a given LOCation. The function is called both + when command line is parsed (after the target optimization hook) and + when an optimize/target attribute (or pragma) is used. */ + +void diagnose_options (gcc_options *opts, gcc_options *opts_set, + location_t loc) +{ + /* The optimization to partition hot and cold basic blocks into separate + sections of the .o and executable files does not work (currently) + with exception handling. This is because there is no support for + generating unwind info. If opts->x_flag_exceptions is turned on + we need to turn off the partitioning optimization. */ + + enum unwind_info_type ui_except + = targetm_common.except_unwind_info (opts); + + if (opts->x_flag_exceptions + && opts->x_flag_reorder_blocks_and_partition + && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)) + { + if (opts_set->x_flag_reorder_blocks_and_partition) + inform (loc, + "%<-freorder-blocks-and-partition%> does not work " + "with exceptions on this architecture"); + opts->x_flag_reorder_blocks_and_partition = 0; + opts->x_flag_reorder_blocks = 1; + } + + /* If user requested unwind info, then turn off the partitioning + optimization. */ + + if (opts->x_flag_unwind_tables + && !targetm_common.unwind_tables_default + && opts->x_flag_reorder_blocks_and_partition + && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)) + { + if (opts_set->x_flag_reorder_blocks_and_partition) + inform (loc, + "%<-freorder-blocks-and-partition%> does not support " + "unwind info on this architecture"); + opts->x_flag_reorder_blocks_and_partition = 0; + opts->x_flag_reorder_blocks = 1; + } + + /* If the target requested unwind info, then turn off the partitioning + optimization with a different message. Likewise, if the target does not + support named sections. */ + + if (opts->x_flag_reorder_blocks_and_partition + && (!targetm_common.have_named_sections + || (opts->x_flag_unwind_tables + && targetm_common.unwind_tables_default + && (ui_except == UI_SJLJ || ui_except >= UI_TARGET)))) + { + if (opts_set->x_flag_reorder_blocks_and_partition) + inform (loc, + "%<-freorder-blocks-and-partition%> does not work " + "on this architecture"); + opts->x_flag_reorder_blocks_and_partition = 0; + opts->x_flag_reorder_blocks = 1; + } + + } #define LEFT_COLUMN 27 @@ -428,6 +428,8 @@ extern bool target_handle_option (struct gcc_options *opts, extern void finish_options (struct gcc_options *opts, struct gcc_options *opts_set, location_t loc); +extern void diagnose_options (gcc_options *opts, gcc_options *opts_set, + location_t loc); extern void print_help (struct gcc_options *opts, unsigned int lang_mask, const char *help_option_argument); extern void default_options_optimization (struct gcc_options *opts, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a9529ab..97a46de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,97 @@ +2021-12-27 Patrick Palka <ppalka@redhat.com> + + PR c++/101239 + * g++.dg/template/sfinae32a.C: New test. + +2021-12-27 Patrick Palka <ppalka@redhat.com> + + PR c++/103700 + * g++.dg/template/sfinae32.C: New test. + +2021-12-27 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/pr103762-1a.c: New test. + * gcc.target/i386/pr103762-1b.c: Likewise. + * gcc.target/i386/pr103762-1c.c: Likewise. + +2021-12-27 Uroš Bizjak <ubizjak@gmail.com> + + PR target/95046 + * gfortran.dg/extract_recip_1.f: Adjust testcase. + +2021-12-27 LiaoShihua <shihua@iscas.ac.cn> + + * gcc.target/riscv/pr103302.c: skip if -march=rv32* + +2021-12-26 H.J. Lu <hjl.tools@gmail.com> + + PR target/103785 + * gcc.target/i386/pr103785.c: New test. + +2021-12-26 Francois-Xavier Coudert <fxcoudert@gmail.com> + + PR libfortran/98076 + * gfortran.dg/pr98076.f90: New test. + +2021-12-24 Uroš Bizjak <ubizjak@gmail.com> + + PR target/95046 + PR target/103797 + * gcc.target/i386/pr95046-1.c (test_div): Add. + (dg-options): Add -mno-recip. + +2021-12-24 Iain Sandoe <iain@sandoe.co.uk> + + * gcc.dg/darwin-aligned-globals.c: New test. + * gcc.dg/darwin-comm-1.c: New test. + * gcc.dg/attr-aligned.c: Amend for new alignment values on + Darwin. + * gcc.target/i386/pr89261.c: Likewise. + +2021-12-23 H.J. Lu <hjl.tools@gmail.com> + + * gcc.target/i386/smuldi3_highpart.c: Replace long with long long. + +2021-12-23 Roger Sayle <roger@nextmovesoftware.com> + Uroš Bizjak <ubizjak@gmail.com> + + PR target/103773 + * gcc.target/i386/pr103773-2.c: New test case. + * gcc.target/i386/pr103773.c: New test case. + +2021-12-23 konglin1 <lingling.kong@intel.com> + + * gcc.target/i386/avx512bf16-cvtsbh2ss-1.c: New test. + * gcc.target/i386/avx512bf16-vcvtpbh2ps-1.c: Ditto. + * gcc.target/i386/avx512bf16vl-cvtness2sbh-1.c: Ditto. + * gcc.target/i386/avx512bf16vl-vcvtpbh2ps-1.c: Ditto. + +2021-12-23 liuhongt <hongtao.liu@intel.com> + + * gcc.target/i386/avx512bw-pr103750-1.c: New test. + * gcc.target/i386/avx512bw-pr103750-2.c: New test. + * gcc.target/i386/avx512f-pr103750-1.c: New test. + * gcc.target/i386/avx512f-pr103750-2.c: New test. + * gcc.target/i386/avx512fp16-pr103750-1.c: New test. + * gcc.target/i386/avx512fp16-pr103750-2.c: New test. + +2021-12-22 Harald Anlauf <anlauf@gmx.de> + + PR fortran/103778 + * gfortran.dg/illegal_boz_arg_3.f90: New test. + +2021-12-22 Harald Anlauf <anlauf@gmx.de> + + PR fortran/103776 + * gfortran.dg/select_10.f90: New test. + +2021-12-22 Murray Steele <murray.steele@arm.com> + + * gcc.target/arm/mve/mve.exp: Add new subdirectories. + * gcc.target/arm/mve/general-c/type_redef_1.c: New test. + * gcc.target/arm/mve/general/double_pragmas_1.c: New test. + * gcc.target/arm/mve/general/nomve_1.c: New test. + 2021-12-21 Jiang Haochen <haochen.jiang@intel.com> * gcc.target/i386/bmi-1.c: Add test for new intrinsic. diff --git a/gcc/testsuite/g++.dg/opt/pr103842.C b/gcc/testsuite/g++.dg/opt/pr103842.C new file mode 100644 index 0000000..4fbafe3 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr103842.C @@ -0,0 +1,31 @@ +// PR target/103842 +// { dg-do compile } +// { dg-options "-O3 -std=c++14" } + +void foo (float *); +struct M { + float x[3][3]; + float *operator[](int i) { return x[i]; } + M(); + M(float f, float g) { + x[1][0] = x[1][1] = x[1][2] = f; + x[2][0] = g; + } + void bar(); + M baz() { + M s(x[1][2] - x[1][2], x[1][1] - x[1][1]); + float r = s[2][0]; + if (r) + for (int i = 0; i < 3; ++i) + for (int j = 0; j < 3; ++j) + s[i][j] /= r; + for (int i = 0;;) { + float *t = s[i]; + foo(t); + } + } +}; +void qux() { + M m, i = m.baz(), j = i; + j.bar(); +} diff --git a/gcc/testsuite/g++.dg/template/sfinae32.C b/gcc/testsuite/g++.dg/template/sfinae32.C new file mode 100644 index 0000000..ae1dada --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae32.C @@ -0,0 +1,24 @@ +// PR c++/103700 +// { dg-do compile { target c++11 } } + +template<class T, int N> auto f(T* p) -> decltype(p + N); +template<class T, int N> auto f(T* p) -> decltype(p - N); +template<class T, int N> auto f(T* p) -> decltype(N + p); +template<class T, int N> void f(T* p); + +template<class T> auto g(T* p, int n) -> decltype(p + n); +template<class T> auto g(T* p, int n) -> decltype(p - n); +template<class T> auto g(T* p, int n) -> decltype(n + p); +template<class T> void g(T* p, int n); + +struct Incomplete; + +int main() { + f<Incomplete, 0>(nullptr); + f<Incomplete, 1>(nullptr); + f<Incomplete, -1>(nullptr); + f<Incomplete, 7>(nullptr); + f<Incomplete, -7>(nullptr); + + g<Incomplete>(nullptr, 0); +} diff --git a/gcc/testsuite/g++.dg/template/sfinae32a.C b/gcc/testsuite/g++.dg/template/sfinae32a.C new file mode 100644 index 0000000..e9dbe88 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/sfinae32a.C @@ -0,0 +1,24 @@ +// PR c++/101239 +// { dg-do compile { target c++11 } } + +template<class T, int N> auto f(T* p) -> decltype(p[N]); +template<class T, int N> auto f(T* p) -> decltype(p[-N]); +template<class T, int N> auto f(T* p) -> decltype(N[p]); +template<class T, int N> void f(T* p); + +template<class T> auto g(T* p, int n) -> decltype(p[n]); +template<class T> auto g(T* p, int n) -> decltype(p[-n]); +template<class T> auto g(T* p, int n) -> decltype(n[p]); +template<class T> void g(T* p, int n); + +struct Incomplete; + +int main() { + f<Incomplete, 0>(nullptr); + f<Incomplete, 1>(nullptr); + f<Incomplete, -1>(nullptr); + f<Incomplete, 7>(nullptr); + f<Incomplete, -7>(nullptr); + + g<Incomplete>(nullptr, 0); +} diff --git a/gcc/testsuite/gcc.dg/attr-aligned.c b/gcc/testsuite/gcc.dg/attr-aligned.c index ec54563..a2e11c9 100644 --- a/gcc/testsuite/gcc.dg/attr-aligned.c +++ b/gcc/testsuite/gcc.dg/attr-aligned.c @@ -12,8 +12,12 @@ # define ALIGN_MAX_STATIC 0x1000 /* Excessive alignment for functions and objects with static storage duration that's expected to trigger an error. */ -#elif __MACH__ -# define ALIGN_MAX_STATIC 0x8000 +#elif __APPLE__ +# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 +# define ALIGN_MAX_STATIC 0x8000 +# else +# define ALIGN_MAX_STATIC ALIGN_MAX_HARD +# endif #elif pdp11 # define ALIGN_MAX_STATIC 2 /* Work around a pdp11 ICE (see PR target/87821). */ diff --git a/gcc/testsuite/gcc.dg/darwin-aligned-globals.c b/gcc/testsuite/gcc.dg/darwin-aligned-globals.c new file mode 100644 index 0000000..18b71e7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/darwin-aligned-globals.c @@ -0,0 +1,24 @@ +/* { dg-do compile { target *-*-darwin* } } */ +/* { dg-additional-options "-fcommon" } */ + +/* Test alignment rules which differ for earlier hosts (so we must + work on the principle that this test will be exercised by self- + hosted compilers. */ + +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070 +#define align_OK (1ul << 28) +#define align_BAD (1ul << 29) +#else +#define align_OK (1ul << 15) +#define align_BAD (1ul << 16) +#endif + +/* All non common vars are allowed larger alignment on modern systems. */ +static int xn __attribute__ ((aligned (align_OK))); +static int xi __attribute__ ((aligned (align_OK))) = 5 ; +int gxi __attribute__ ((aligned (align_OK))) = 6 ; + +/* test that we detect bad cases. */ +static int yn __attribute__ ((aligned (align_BAD))); /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */ +static int yi __attribute__ ((aligned (align_BAD))) = 5; /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */ +int yni __attribute__ ((aligned (align_BAD))) = 6; /* { dg-error {requested alignment .[0-9]+. exceeds object file maximum} } */ diff --git a/gcc/testsuite/gcc.dg/darwin-comm-1.c b/gcc/testsuite/gcc.dg/darwin-comm-1.c new file mode 100644 index 0000000..4651998 --- /dev/null +++ b/gcc/testsuite/gcc.dg/darwin-comm-1.c @@ -0,0 +1,5 @@ +/* { dg-do compile { target *-*-darwin[912]* } } */ +/* { dg-options "-fcommon" } */ + +/* In all cases, common has a max alignment of 2^15. */ +int badcommon __attribute__ ((aligned (65536))); /* { dg-error "common variables must have an alignment" } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c new file mode 100644 index 0000000..cd230f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general-c/type_redef_1.c @@ -0,0 +1,67 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */ +/* { dg-add-options arm_v8_1m_mve_fp } */ + +int mve_pred16_t; /* { dg-message "note: previous declaration of 'mve_pred16_t'" } */ +int int8x16_t; /* { dg-message "note: previous declaration of 'int8x16_t'" } */ +int int16x8_t; /* { dg-message "note: previous declaration of 'int16x8_t'" } */ +int int32x4_t; /* { dg-message "note: previous declaration of 'int32x4_t'" } */ +int int64x2_t; /* { dg-message "note: previous declaration of 'int64x2_t'" } */ +int uint8x16_t; /* { dg-message "note: previous declaration of 'uint8x16_t'" } */ +int uint16x8_t; /* { dg-message "note: previous declaration of 'uint16x8_t'" } */ +int uint32x4_t; /* { dg-message "note: previous declaration of 'uint32x4_t'" } */ +int uint64x2_t; /* { dg-message "note: previous declaration of 'uint64x2_t'" } */ +int float16x8_t; /* { dg-message "note: previous declaration of 'float16x8_t'" } */ +int float32x4_t; /* { dg-message "note: previous declaration of 'float32x4_t'" } */ +int int8x16x2_t; /* { dg-message "note: previous declaration of 'int8x16x2_t'" } */ +int int8x16x4_t; /* { dg-message "note: previous declaration of 'int8x16x4_t'" } */ +int int16x8x2_t; /* { dg-message "note: previous declaration of 'int16x8x2_t'" } */ +int int16x8x4_t; /* { dg-message "note: previous declaration of 'int16x8x4_t'" } */ +int int32x4x2_t; /* { dg-message "note: previous declaration of 'int32x4x2_t'" } */ +int int32x4x4_t; /* { dg-message "note: previous declaration of 'int32x4x4_t'" } */ +int int64x2x2_t; /* { dg-message "note: previous declaration of 'int64x2x2_t'" } */ +int int64x2x4_t; /* { dg-message "note: previous declaration of 'int64x2x4_t'" } */ +int uint8x16x2_t; /* { dg-message "note: previous declaration of 'uint8x16x2_t'" } */ +int uint8x16x4_t; /* { dg-message "note: previous declaration of 'uint8x16x4_t'" } */ +int uint16x8x2_t; /* { dg-message "note: previous declaration of 'uint16x8x2_t'" } */ +int uint16x8x4_t; /* { dg-message "note: previous declaration of 'uint16x8x4_t'" } */ +int uint32x4x2_t; /* { dg-message "note: previous declaration of 'uint32x4x2_t'" } */ +int uint32x4x4_t; /* { dg-message "note: previous declaration of 'uint32x4x4_t'" } */ +int uint64x2x2_t; /* { dg-message "note: previous declaration of 'uint64x2x2_t'" } */ +int uint64x2x4_t; /* { dg-message "note: previous declaration of 'uint64x2x4_t'" } */ +int float16x8x2_t; /* { dg-message "note: previous declaration of 'float16x8x2_t'" } */ +int float16x8x4_t; /* { dg-message "note: previous declaration of 'float16x8x4_t'" } */ +int float32x4x2_t; /* { dg-message "note: previous declaration of 'float32x4x2_t'" } */ +int float32x4x4_t; /* { dg-message "note: previous declaration of 'float32x4x4_t'" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {'mve_pred16_t' redeclared} } */ + /* { dg-error {'int8x16_t' redeclared} "" {target *-*-*} .-1 } */ + /* { dg-error {'int16x8_t' redeclared} "" {target *-*-*} .-2 } */ + /* { dg-error {'int32x4_t' redeclared} "" {target *-*-*} .-3 } */ + /* { dg-error {'int64x2_t' redeclared} "" {target *-*-*} .-4 } */ + /* { dg-error {'uint8x16_t' redeclared} "" {target *-*-*} .-5 } */ + /* { dg-error {'uint16x8_t' redeclared} "" {target *-*-*} .-6 } */ + /* { dg-error {'uint32x4_t' redeclared} "" {target *-*-*} .-7 } */ + /* { dg-error {'uint64x2_t' redeclared} "" {target *-*-*} .-8 } */ + /* { dg-error {'float16x8_t' redeclared} "" {target *-*-*} .-9 } */ + /* { dg-error {'float32x4_t' redeclared} "" {target *-*-*} .-10 } */ + /* { dg-error {'int8x16x2_t' redeclared} "" {target *-*-*} .-11 } */ + /* { dg-error {'int8x16x4_t' redeclared} "" {target *-*-*} .-12 } */ + /* { dg-error {'int16x8x2_t' redeclared} "" {target *-*-*} .-13 } */ + /* { dg-error {'int16x8x4_t' redeclared} "" {target *-*-*} .-14 } */ + /* { dg-error {'int32x4x2_t' redeclared} "" {target *-*-*} .-15 } */ + /* { dg-error {'int32x4x4_t' redeclared} "" {target *-*-*} .-16 } */ + /* { dg-error {'int64x2x2_t' redeclared} "" {target *-*-*} .-17 } */ + /* { dg-error {'int64x2x4_t' redeclared} "" {target *-*-*} .-18 } */ + /* { dg-error {'uint8x16x2_t' redeclared} "" {target *-*-*} .-19 } */ + /* { dg-error {'uint8x16x4_t' redeclared} "" {target *-*-*} .-20 } */ + /* { dg-error {'uint16x8x2_t' redeclared} "" {target *-*-*} .-21 } */ + /* { dg-error {'uint16x8x4_t' redeclared} "" {target *-*-*} .-22 } */ + /* { dg-error {'uint32x4x2_t' redeclared} "" {target *-*-*} .-23 } */ + /* { dg-error {'uint32x4x4_t' redeclared} "" {target *-*-*} .-24 } */ + /* { dg-error {'uint64x2x2_t' redeclared} "" {target *-*-*} .-25 } */ + /* { dg-error {'uint64x2x4_t' redeclared} "" {target *-*-*} .-26 } */ + /* { dg-error {'float16x8x2_t' redeclared} "" {target *-*-*} .-27 } */ + /* { dg-error {'float16x8x4_t' redeclared} "" {target *-*-*} .-28 } */ + /* { dg-error {'float32x4x2_t' redeclared} "" {target *-*-*} .-29 } */ + /* { dg-error {'float32x4x4_t' redeclared} "" {target *-*-*} .-30 } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c b/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c new file mode 100644 index 0000000..58466db --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general/double_pragmas_1.c @@ -0,0 +1,8 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ + +/* It doesn't really matter if this produces errors about redefinitions, + but it mustn't trigger an ICE. */ +#pragma GCC arm "arm_mve_types.h" +#pragma GCC arm "arm_mve_types.h" /* { dg-error "duplicate definition of 'arm_mve_types.h'" } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c b/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c new file mode 100644 index 0000000..cdfb974 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/mve/general/nomve_1.c @@ -0,0 +1,3 @@ +/* { dg-options "-mfloat-abi=soft" } */ + +#pragma GCC arm "arm_mve_types.h" /* { dg-error {this definition requires the MVE ISA extension} } */ diff --git a/gcc/testsuite/gcc.target/arm/mve/mve.exp b/gcc/testsuite/gcc.target/arm/mve/mve.exp index a858e52..7cea03d 100644 --- a/gcc/testsuite/gcc.target/arm/mve/mve.exp +++ b/gcc/testsuite/gcc.target/arm/mve/mve.exp @@ -44,6 +44,12 @@ dg-init dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/intrinsics/*.\[cCS\]]] \ "" $DEFAULT_CFLAGS +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/general/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/general-c/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \ "" $DEFAULT_CFLAGS diff --git a/gcc/testsuite/gcc.target/i386/amx-check.h b/gcc/testsuite/gcc.target/i386/amx-check.h index 03616ff..434b0e5 100644 --- a/gcc/testsuite/gcc.target/i386/amx-check.h +++ b/gcc/testsuite/gcc.target/i386/amx-check.h @@ -139,8 +139,27 @@ int check_tile_register (__tile* ref, __tile* target) for (i = 0; i < rows; i++) for (j = 0; j < colsb; j++) - if (ref->buf[i * colsb + j] != target->buf[i * colsb + j]) - return 0; + if (ref->buf[i * colsb + j] != target->buf[i * colsb + j]) + return 0; + + return 1; +} + +/* Compare float tile register value with __tile variable */ +int check_float_tile_register (__tile* ref, __tile* target) +{ + /* Tile register should be stored from tmm to + memory and compare with emulation results. */ + int rows = target->rows; + int colsb = target->colsb / 4; + int i, j; + uint32_t *ref_buf = (uint32_t *) ref->buf; + uint32_t *target_buf = (uint32_t *) target->buf; + + for (i = 0; i < rows; i++) + for (j = 0; j < colsb; j++) + if (abs(ref_buf[i * colsb + j] - target_buf[i * colsb + j]) > 1) + return 0; return 1; } diff --git a/gcc/testsuite/gcc.target/i386/amxbf16-dpbf16ps-2.c b/gcc/testsuite/gcc.target/i386/amxbf16-dpbf16ps-2.c index f7002ca..b00bc13 100644 --- a/gcc/testsuite/gcc.target/i386/amxbf16-dpbf16ps-2.c +++ b/gcc/testsuite/gcc.target/i386/amxbf16-dpbf16ps-2.c @@ -12,15 +12,25 @@ void test_amx_bf16_dpbf16ps (); /* Transformation functions between bf16/float */ static uint16_t make_bf16 (float f) { - uint32_t u = (uint32_t)f; - u = (u >> 16) & 0xffff; - return (uint16_t)u; + union + { + float f; + uint32_t u; + } fu; + fu.f = f; + fu.u = (fu.u >> 16) & 0xffff; + return (uint16_t) fu.u; } static float make_f32 (uint16_t bf) { - uint32_t u = (uint32_t)(bf << 16); - return (float)u; + union + { + float f; + uint32_t u; + } fu; + fu.u = (uint32_t) bf << 16; + return fu.f; } /* Init tile buffer with bf16 pairs */ @@ -54,10 +64,10 @@ void calc_matrix_dpbf16ps (__tile *dst, __tile *src1, __tile *src2) for (t = 0; t < 2; t+=2) { dst_buf[i * N + k] += - (make_f32(src1_buf[i * 4 * N + 4 * j + t]) * - make_f32(src2_buf[j * 4 * K + 4 * k + t])) + - (make_f32(src1_buf[i * 4 * N + 4 * j + t + 1]) * - make_f32(src2_buf[j * 4 * K + 4 * k + t + 1])); + (make_f32(src1_buf[i * 2 * N + 2 * j + t]) * + make_f32(src2_buf[j * 2 * K + 2 * k + t])) + + (make_f32(src1_buf[i * 2 * N + 2 * j + t + 1]) * + make_f32(src2_buf[j * 2 * K + 2 * k + t + 1])); } } @@ -80,6 +90,6 @@ void test_amx_bf16_dpbf16ps () _tile_dpbf16ps (1, 2, 3); _tile_stored (1, dst_ref.buf, _STRIDE); - if (!check_tile_register (&dst_ref, &dst)) + if (!check_float_tile_register (&dst_ref, &dst)) abort(); } diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16-cvtsbh2ss-1.c b/gcc/testsuite/gcc.target/i386/avx512bf16-cvtsbh2ss-1.c new file mode 100644 index 0000000..bf29a69 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bf16-cvtsbh2ss-1.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512bf16 -O2" } */ +/* { dg-final { scan-assembler-times "sall\[ \\t\]+\[^\{\n\]*16" 1 } } */ +/* { dg-final { scan-assembler-times "movl" 1 } } */ + +#include <immintrin.h> + +volatile __bfloat16 x1; +volatile float res; + +void extern +avx512bf16_test (void) +{ + res = _mm_cvtsbh_ss (x1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtpbh2ps-1.c b/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtpbh2ps-1.c new file mode 100644 index 0000000..a2ae4be --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bf16-vcvtpbh2ps-1.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512bf16 -O2" } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\n\]*%zmm\[0-9\](?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %zmm\[0-9]\+, %zmm\[0-9]\+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %zmm\[0-9]\+, %zmm\[0-9]\+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%zmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m256bh x1; +volatile __m512 res; +volatile __mmask16 m16; + +void extern +avx512bf16_test (void) +{ + res = _mm512_cvtpbh_ps (x1); + res = _mm512_mask_cvtpbh_ps (res, m16, x1); + res = _mm512_maskz_cvtpbh_ps (m16, x1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16vl-cvtness2sbh-1.c b/gcc/testsuite/gcc.target/i386/avx512bf16vl-cvtness2sbh-1.c new file mode 100644 index 0000000..8f21b1b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bf16vl-cvtness2sbh-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512bf16 -mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vcvtneps2bf16\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\r]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __bfloat16 res; +volatile float x1; + +void extern +avx512bf16_test (void) +{ + res = _mm_cvtness_sbh (x1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtpbh2ps-1.c b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtpbh2ps-1.c new file mode 100644 index 0000000..98f458b --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bf16vl-vcvtpbh2ps-1.c @@ -0,0 +1,29 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512bf16 -mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\n\]*%ymm\[0-9\](?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %ymm\[0-9]\+, %ymm\[0-9]\+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %ymm\[0-9]\+, %ymm\[0-9]\+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %xmm\[0-9]\+, %xmm\[0-9]\+(?:\n|\[ \\t\]+#)" 2 } } */ +/* { dg-final { scan-assembler-times "vpslld\[ \t]\+\\\$16, %xmm\[0-9]\+, %xmm\[0-9]\+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)" 1 } } */ +/* { dg-final { scan-assembler-times "vpmovsxwd\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}\{z\}(?:\n|\[ \\t\]+#)" 1 } } */ + +#include <immintrin.h> + +volatile __m128bh x1; +volatile __m128 res1; +volatile __m256 res2; +volatile __mmask8 m8; + +void extern +avx512bf16_test (void) +{ + res2 = _mm256_cvtpbh_ps (x1); + res2 = _mm256_mask_cvtpbh_ps (res2, m8, x1); + res2 = _mm256_maskz_cvtpbh_ps (m8, x1); + + res1 = _mm_cvtpbh_ps (x1); + res1 = _mm_mask_cvtpbh_ps (res1, m8, x1); + res1 = _mm_maskz_cvtpbh_ps (m8, x1); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-1.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-1.c new file mode 100644 index 0000000..b1165f0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-1.c @@ -0,0 +1,154 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512bw -mavx512vl" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128i* pi128; +extern __m256i* pi256; +extern __m512i* pi512; + +unsigned char +foo () +{ + __mmask16 mask1 = _mm_cmpeq_epu8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epu8_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo1 () +{ + __mmask16 mask1 = _mm_cmpeq_epu8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epu8_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo2 () +{ + __mmask32 mask1 = _mm256_cmpeq_epu8_mask (pi256[0], pi256[1]); + __mmask32 mask2 = _mm256_cmpeq_epu8_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo3 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo4 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo5 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo6 () +{ + __mmask16 mask1 = _mm256_cmpeq_epu16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epu16_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo7 () +{ + __mmask16 mask1 = _mm256_cmpeq_epu16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epu16_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo8 () +{ + __mmask32 mask1 = _mm512_cmpeq_epu16_mask (pi512[0], pi512[1]); + __mmask32 mask2 = _mm512_cmpeq_epu16_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo () +{ + __mmask16 mask1 = _mm_cmpeq_epi8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epi8_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo1 () +{ + __mmask16 mask1 = _mm_cmpeq_epi8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epi8_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo2 () +{ + __mmask32 mask1 = _mm256_cmpeq_epi8_mask (pi256[0], pi256[1]); + __mmask32 mask2 = _mm256_cmpeq_epi8_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo3 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo4 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo5 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo6 () +{ + __mmask16 mask1 = _mm256_cmpeq_epi16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epi16_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo7 () +{ + __mmask16 mask1 = _mm256_cmpeq_epi16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epi16_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo8 () +{ + __mmask32 mask1 = _mm512_cmpeq_epi16_mask (pi512[0], pi512[1]); + __mmask32 mask2 = _mm512_cmpeq_epi16_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-2.c b/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-2.c new file mode 100644 index 0000000..7303f54 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512bw-pr103750-2.c @@ -0,0 +1,173 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512dq -mavx512bw -mavx512vl" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128i* pi128; +extern __m256i* pi256; +extern __m512i* pi512; + +extern char a, b; +void +foo () +{ + __mmask16 mask1 = _mm_cmpeq_epu8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epu8_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo1 () +{ + __mmask16 mask1 = _mm_cmpeq_epu8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epu8_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo2 () +{ + __mmask32 mask1 = _mm256_cmpeq_epu8_mask (pi256[0], pi256[1]); + __mmask32 mask2 = _mm256_cmpeq_epu8_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask32_u8 (mask1, mask2); +} + +void +foo3 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo4 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo5 () +{ + __mmask8 mask1 = _mm_cmpeq_epu16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu16_mask (pi128[1], pi128[2]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo6 () +{ + __mmask16 mask1 = _mm256_cmpeq_epu16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epu16_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo7 () +{ + __mmask16 mask1 = _mm256_cmpeq_epu16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epu16_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo8 () +{ + __mmask32 mask1 = _mm512_cmpeq_epu16_mask (pi512[0], pi512[1]); + __mmask32 mask2 = _mm512_cmpeq_epu16_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask32_u8 (mask1, mask2); +} + +void +sign_foo () +{ + __mmask16 mask1 = _mm_cmpeq_epi8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epi8_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo1 () +{ + __mmask16 mask1 = _mm_cmpeq_epi8_mask (pi128[0], pi128[1]); + __mmask16 mask2 = _mm_cmpeq_epi8_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo2 () +{ + __mmask32 mask1 = _mm256_cmpeq_epi8_mask (pi256[0], pi256[1]); + __mmask32 mask2 = _mm256_cmpeq_epi8_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask32_u8 (mask1, mask2); +} + +void +sign_foo3 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo4 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo5 () +{ + __mmask8 mask1 = _mm_cmpeq_epi16_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi16_mask (pi128[1], pi128[2]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo6 () +{ + __mmask16 mask1 = _mm256_cmpeq_epi16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epi16_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo7 () +{ + __mmask16 mask1 = _mm256_cmpeq_epi16_mask (pi256[0], pi256[1]); + __mmask16 mask2 = _mm256_cmpeq_epi16_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo8 () +{ + __mmask32 mask1 = _mm512_cmpeq_epi16_mask (pi512[0], pi512[1]); + __mmask32 mask2 = _mm512_cmpeq_epi16_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask32_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr103750-1.c b/gcc/testsuite/gcc.target/i386/avx512f-pr103750-1.c new file mode 100644 index 0000000..613efe0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-pr103750-1.c @@ -0,0 +1,426 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512f -mavx512vl -mavx512bw" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128i* pi128; +extern __m256i* pi256; +extern __m512i* pi512; + +extern __m128* ps128; +extern __m256* ps256; +extern __m512* ps512; + +extern __m128d* pd128; +extern __m256d* pd256; +extern __m512d* pd512; + +unsigned char +foo () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo1 () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo2 () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo3 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo4 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo5 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo6 () +{ + __mmask16 mask1 = _mm512_cmpeq_epu32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epu32_mask (pi512[2], pi512[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo7 () +{ + __mmask16 mask1 = _mm512_cmpeq_epu32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epu32_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo8 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo9 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo10 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo11 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo12 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo13 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +foo14 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +foo15 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +foo16 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo1 () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo2 () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo3 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo4 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo5 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo6 () +{ + __mmask16 mask1 = _mm512_cmpeq_epi32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epi32_mask (pi512[2], pi512[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo7 () +{ + __mmask16 mask1 = _mm512_cmpeq_epi32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epi32_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo8 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo9 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo10 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo11 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo12 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo13 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo14 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo15 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo16 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +float_foo1 () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo2 () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo3 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +float_foo4 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo5 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo6 () +{ + __mmask16 mask1 = _mm512_cmp_ps_mask (ps512[0], ps512[1], 1); + __mmask16 mask2 = _mm512_cmp_ps_mask (ps512[2], ps512[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo7 () +{ + __mmask16 mask1 = _mm512_cmp_ps_mask (ps512[0], ps512[1], 1); + __mmask16 mask2 = _mm512_cmp_ps_mask (ps512[2], ps512[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo8 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +float_foo9 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo10 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo11 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +float_foo12 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo13 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +float_foo14 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +float_foo15 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +float_foo16 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr103750-2.c b/gcc/testsuite/gcc.target/i386/avx512f-pr103750-2.c new file mode 100644 index 0000000..a6c2b06 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512f-pr103750-2.c @@ -0,0 +1,478 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512dq -mavx512vl -mavx512bw" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128i* pi128; +extern __m256i* pi256; +extern __m512i* pi512; + +extern __m128* ps128; +extern __m256* ps256; +extern __m512* ps512; + +extern __m128d* pd128; +extern __m256d* pd256; +extern __m512d* pd512; + +extern char a, b; +void +foo () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo1 () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo2 () +{ + __mmask8 mask1 = _mm_cmpeq_epu32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu32_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo3 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo4 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo5 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu32_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo6 () +{ + __mmask16 mask1 = _mm512_cmpeq_epu32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epu32_mask (pi512[2], pi512[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo7 () +{ + __mmask16 mask1 = _mm512_cmpeq_epu32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epu32_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +foo8 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo9 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo10 () +{ + __mmask8 mask1 = _mm_cmpeq_epu64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epu64_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo11 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo12 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo13 () +{ + __mmask8 mask1 = _mm256_cmpeq_epu64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epu64_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo14 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo15 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +foo16 () +{ + __mmask8 mask1 = _mm512_cmpeq_epu64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epu64_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo1 () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo2 () +{ + __mmask8 mask1 = _mm_cmpeq_epi32_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi32_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo3 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo4 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo5 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi32_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi32_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo6 () +{ + __mmask16 mask1 = _mm512_cmpeq_epi32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epi32_mask (pi512[2], pi512[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo7 () +{ + __mmask16 mask1 = _mm512_cmpeq_epi32_mask (pi512[0], pi512[1]); + __mmask16 mask2 = _mm512_cmpeq_epi32_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo8 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo9 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo10 () +{ + __mmask8 mask1 = _mm_cmpeq_epi64_mask (pi128[0], pi128[1]); + __mmask8 mask2 = _mm_cmpeq_epi64_mask (pi128[2], pi128[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo11 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo12 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo13 () +{ + __mmask8 mask1 = _mm256_cmpeq_epi64_mask (pi256[0], pi256[1]); + __mmask8 mask2 = _mm256_cmpeq_epi64_mask (pi256[2], pi256[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo14 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo15 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo16 () +{ + __mmask8 mask1 = _mm512_cmpeq_epi64_mask (pi512[0], pi512[1]); + __mmask8 mask2 = _mm512_cmpeq_epi64_mask (pi512[2], pi512[3]); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo1 () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo2 () +{ + __mmask8 mask1 = _mm_cmp_ps_mask (ps128[0], ps128[1], 1); + __mmask8 mask2 = _mm_cmp_ps_mask (ps128[2], ps128[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo3 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo4 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo5 () +{ + __mmask8 mask1 = _mm256_cmp_ps_mask (ps256[0], ps256[1], 1); + __mmask8 mask2 = _mm256_cmp_ps_mask (ps256[2], ps256[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo6 () +{ + __mmask16 mask1 = _mm512_cmp_ps_mask (ps512[0], ps512[1], 1); + __mmask16 mask2 = _mm512_cmp_ps_mask (ps512[2], ps512[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +float_foo7 () +{ + __mmask16 mask1 = _mm512_cmp_ps_mask (ps512[0], ps512[1], 1); + __mmask16 mask2 = _mm512_cmp_ps_mask (ps512[2], ps512[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +float_foo8 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo9 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo10 () +{ + __mmask8 mask1 = _mm_cmp_pd_mask (pd128[0], pd128[1], 1); + __mmask8 mask2 = _mm_cmp_pd_mask (pd128[2], pd128[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo11 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo12 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo13 () +{ + __mmask8 mask1 = _mm256_cmp_pd_mask (pd256[0], pd256[1], 1); + __mmask8 mask2 = _mm256_cmp_pd_mask (pd256[2], pd256[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo14 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo15 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +float_foo16 () +{ + __mmask8 mask1 = _mm512_cmp_pd_mask (pd512[0], pd512[1], 1); + __mmask8 mask2 = _mm512_cmp_pd_mask (pd512[2], pd512[3], 1); + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-1.c b/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-1.c new file mode 100644 index 0000000..eaf6d1e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-1.c @@ -0,0 +1,58 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128h* ph128; +extern __m256h* ph256; +extern __m512h* ph512; + +unsigned char +sign_foo3 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + return _kortestz_mask16_u8 (mask1, mask2); +} + +unsigned char +sign_foo4 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo5 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo6 () +{ + __mmask16 mask1 = _mm256_cmp_ph_mask (ph256[0], ph256[1], 1); + __mmask16 mask2 = _mm256_cmp_ph_mask (ph256[2], ph256[3], 1); + return _kortestz_mask32_u8 (mask1, mask2); +} + +unsigned char +sign_foo7 () +{ + __mmask16 mask1 = _mm256_cmp_ph_mask (ph256[0], ph256[1], 1); + __mmask16 mask2 = _mm256_cmp_ph_mask (ph256[2], ph256[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} + +unsigned char +sign_foo8 () +{ + __mmask32 mask1 = _mm512_cmp_ph_mask (ph512[0], ph512[1], 1); + __mmask32 mask2 = _mm512_cmp_ph_mask (ph512[2], ph512[3], 1); + return _kortestz_mask64_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-2.c b/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-2.c new file mode 100644 index 0000000..3d3a033 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avx512fp16-pr103750-2.c @@ -0,0 +1,71 @@ +/* PR target/103750 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -mavx512fp16 -mavx512vl -mavx512dq" } */ +/* { dg-final { scan-assembler-not "kmov" { xfail ia32 } } } */ +/* xfail need to be fixed. */ + +#include <immintrin.h> +extern __m128h* ph128; +extern __m256h* ph256; +extern __m512h* ph512; + +extern char a, b; +void +sign_foo3 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + + a = _kortestz_mask16_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo4 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo5 () +{ + __mmask8 mask1 = _mm_cmp_ph_mask (ph128[0], ph128[1], 1); + __mmask8 mask2 = _mm_cmp_ph_mask (ph128[1], ph128[2], 1); + + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask8_u8 (mask1, mask2); +} + +void +sign_foo6 () +{ + __mmask16 mask1 = _mm256_cmp_ph_mask (ph256[0], ph256[1], 1); + __mmask16 mask2 = _mm256_cmp_ph_mask (ph256[2], ph256[3], 1); + + a = _kortestz_mask32_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo7 () +{ + __mmask16 mask1 = _mm256_cmp_ph_mask (ph256[0], ph256[1], 1); + __mmask16 mask2 = _mm256_cmp_ph_mask (ph256[2], ph256[3], 1); + + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask16_u8 (mask1, mask2); +} + +void +sign_foo8 () +{ + __mmask32 mask1 = _mm512_cmp_ph_mask (ph512[0], ph512[1], 1); + __mmask32 mask2 = _mm512_cmp_ph_mask (ph512[2], ph512[3], 1); + + a = _kortestz_mask64_u8 (mask1, mask2); + b = _kortestz_mask32_u8 (mask1, mask2); +} diff --git a/gcc/testsuite/gcc.target/i386/pr103762-1a.c b/gcc/testsuite/gcc.target/i386/pr103762-1a.c new file mode 100644 index 0000000..c9e75bc --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103762-1a.c @@ -0,0 +1,647 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -std=gnu11 -fgnu89-inline" } */ +/* { dg-final { scan-assembler-not ".quad\[\\t \]+tunable_list" { target lp64 } } } */ +/* { dg-final { scan-assembler-not ".long\[\\t \]+tunable_list" { target { ! lp64 } } } } */ + +typedef unsigned long int size_t; +typedef long long int intmax_t; +typedef unsigned long long int uintmax_t; +typedef unsigned long long int uint64_t; +typedef intmax_t tunable_num_t; +typedef union +{ + tunable_num_t numval; + const char *strval; +} tunable_val_t; +enum +{ + HWCAP_X86_SSE2 = 1 << 0, + HWCAP_X86_64 = 1 << 1, + HWCAP_X86_AVX512_1 = 1 << 2 +}; +typedef void (*tunable_callback_t) (tunable_val_t *); +extern void *__minimal_malloc (size_t n) + __attribute__ ((visibility ("hidden"))); +extern int __libc_enable_secure __attribute__ ((section (".data.rel.ro"))); +extern uint64_t _dl_strtoul (const char *, char **) + __attribute__ ((visibility ("hidden"))); +extern void _dl_fatal_printf (const char *fmt, ...) + __attribute__ ((__format__ (__printf__, 1, 2), __noreturn__)); +typedef enum +{ + glibc_rtld_nns, + glibc_elision_skip_lock_after_retries, + glibc_malloc_trim_threshold, + glibc_malloc_perturb, + glibc_cpu_x86_shared_cache_size, + glibc_pthread_rseq, + glibc_mem_tagging, + glibc_elision_tries, + glibc_elision_enable, + glibc_malloc_hugetlb, + glibc_cpu_x86_rep_movsb_threshold, + glibc_malloc_mxfast, + glibc_rtld_dynamic_sort, + glibc_elision_skip_lock_busy, + glibc_malloc_top_pad, + glibc_cpu_x86_rep_stosb_threshold, + glibc_cpu_x86_non_temporal_threshold, + glibc_cpu_x86_shstk, + glibc_pthread_stack_cache_size, + glibc_cpu_hwcap_mask, + glibc_malloc_mmap_max, + glibc_elision_skip_trylock_internal_abort, + glibc_malloc_tcache_unsorted_limit, + glibc_cpu_x86_ibt, + glibc_cpu_hwcaps, + glibc_elision_skip_lock_internal_abort, + glibc_malloc_arena_max, + glibc_malloc_mmap_threshold, + glibc_cpu_x86_data_cache_size, + glibc_malloc_tcache_count, + glibc_malloc_arena_test, + glibc_pthread_mutex_spin_count, + glibc_rtld_optional_static_tls, + glibc_malloc_tcache_max, + glibc_malloc_check, +} tunable_id_t; +typedef enum +{ + TUNABLE_TYPE_INT_32, + TUNABLE_TYPE_UINT_64, + TUNABLE_TYPE_SIZE_T, + TUNABLE_TYPE_STRING +} tunable_type_code_t; +typedef struct +{ + tunable_type_code_t type_code; + tunable_num_t min; + tunable_num_t max; +} tunable_type_t; +typedef enum +{ + TUNABLE_SECLEVEL_SXID_ERASE = 0, + TUNABLE_SECLEVEL_SXID_IGNORE = 1, + TUNABLE_SECLEVEL_NONE = 2, +} tunable_seclevel_t; +struct _tunable +{ + const char name[42]; + tunable_type_t type; + tunable_val_t val; + _Bool initialized; + tunable_seclevel_t security_level; + const char env_alias[23]; +}; +typedef struct _tunable tunable_t; +extern _Bool unsigned_tunable_type (tunable_type_code_t t); + +static tunable_t tunable_list[] __attribute__ ((section (".data.rel.ro"))) = { + { "glibc" + "." + "rtld" + "." + "nns", + { TUNABLE_TYPE_SIZE_T, 1, 16 }, + { .numval = 4 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "elision" + "." + "skip_lock_after_retries", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + { .numval = 3 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "trim_threshold", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_TRIM_THRESHOLD_" }, + { "glibc" + "." + "malloc" + "." + "perturb", + { TUNABLE_TYPE_INT_32, 0, 0xff }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_PERTURB_" }, + { "glibc" + "." + "cpu" + "." + "x86_shared_cache_size", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "pthread" + "." + "rseq", + { TUNABLE_TYPE_INT_32, 0, 1 }, + { .numval = 1 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "mem" + "." + "tagging", + { TUNABLE_TYPE_INT_32, 0, 255 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + { 0 } }, + { "glibc" + "." + "elision" + "." + "tries", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + { .numval = 3 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "elision" + "." + "enable", + { TUNABLE_TYPE_INT_32, 0, 1 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "hugetlb", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "x86_rep_movsb_threshold", + { TUNABLE_TYPE_SIZE_T, 1, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "mxfast", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + { 0 } }, + { "glibc" + "." + "rtld" + "." + "dynamic_sort", + { TUNABLE_TYPE_INT_32, 1, 2 }, + { .numval = 2 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "elision" + "." + "skip_lock_busy", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + { .numval = 3 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "top_pad", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_TOP_PAD_" }, + { "glibc" + "." + "cpu" + "." + "x86_rep_stosb_threshold", + { TUNABLE_TYPE_SIZE_T, 1, (18446744073709551615UL) }, + { .numval = 2048 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "x86_non_temporal_threshold", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "x86_shstk", + { TUNABLE_TYPE_STRING, 0, 0 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "pthread" + "." + "stack_cache_size", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + { .numval = 41943040 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "hwcap_mask", + { TUNABLE_TYPE_UINT_64, 0, (18446744073709551615UL) }, + { .numval = (HWCAP_X86_64 | HWCAP_X86_AVX512_1) }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + "LD_HWCAP_MASK" }, + { "glibc" + "." + "malloc" + "." + "mmap_max", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_MMAP_MAX_" }, + { "glibc" + "." + "elision" + "." + "skip_trylock_internal_abort", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + { .numval = 3 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "tcache_unsorted_limit", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "x86_ibt", + { TUNABLE_TYPE_STRING, 0, 0 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "cpu" + "." + "hwcaps", + { TUNABLE_TYPE_STRING, 0, 0 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "elision" + "." + "skip_lock_internal_abort", + { TUNABLE_TYPE_INT_32, 0, (2147483647) }, + { .numval = 3 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "arena_max", + { TUNABLE_TYPE_SIZE_T, 1, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_ARENA_MAX" }, + { "glibc" + "." + "malloc" + "." + "mmap_threshold", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_MMAP_THRESHOLD_" }, + { "glibc" + "." + "cpu" + "." + "x86_data_cache_size", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "tcache_count", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "arena_test", + { TUNABLE_TYPE_SIZE_T, 1, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_IGNORE, + "MALLOC_ARENA_TEST" }, + { "glibc" + "." + "pthread" + "." + "mutex_spin_count", + { TUNABLE_TYPE_INT_32, 0, 32767 }, + { .numval = 100 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "rtld" + "." + "optional_static_tls", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + { .numval = 512 }, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "tcache_max", + { TUNABLE_TYPE_SIZE_T, 0, (18446744073709551615UL) }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + { 0 } }, + { "glibc" + "." + "malloc" + "." + "check", + { TUNABLE_TYPE_INT_32, 0, 3 }, + {}, + ((void *)0), + TUNABLE_SECLEVEL_SXID_ERASE, + "MALLOC_CHECK_" }, +}; +extern void __tunables_init (char **); +extern void __tunables_print (void); +extern void __tunable_get_val (tunable_id_t, void *, tunable_callback_t); +extern void __tunable_set_val (tunable_id_t, tunable_val_t *, tunable_num_t *, + tunable_num_t *); +static __inline __attribute__ ((__always_inline__)) _Bool +tunable_val_lt (tunable_num_t lhs, tunable_num_t rhs, _Bool unsigned_cmp) +{ + if (unsigned_cmp) + return (uintmax_t)lhs < (uintmax_t)rhs; + else + return lhs < rhs; +} +static __inline __attribute__ ((__always_inline__)) _Bool +tunable_val_gt (tunable_num_t lhs, tunable_num_t rhs, _Bool unsigned_cmp) +{ + if (unsigned_cmp) + return (uintmax_t)lhs > (uintmax_t)rhs; + else + return lhs > rhs; +} +static __inline __attribute__ ((__always_inline__)) _Bool +tunable_is_name (const char *orig, const char *envname) +{ + for (; *orig != '\0' && *envname != '\0'; envname++, orig++) + if (*orig != *envname) + break; + if (*orig == '\0' && *envname == '=') + return 1; + else + return 0; +} +static char * +tunables_strdup (const char *in) +{ + size_t i = 0; + while (in[i++] != '\0') + ; + char *out = __minimal_malloc (i + 1); + if (out == ((void *)0)) + _dl_fatal_printf ("failed to allocate memory to process tunables\n"); + while (i-- > 0) + out[i] = in[i]; + return out; +} +static char ** +get_next_env (char **envp, char **name, size_t *namelen, char **val, + char ***prev_envp) +{ + while (envp != ((void *)0) && *envp != ((void *)0)) + { + char **prev = envp; + char *envline = *envp++; + int len = 0; + while (envline[len] != '\0' && envline[len] != '=') + len++; + if (envline[len] == '\0') + continue; + *name = envline; + *namelen = len; + *val = &envline[len + 1]; + *prev_envp = prev; + return envp; + } + return ((void *)0); +} +static void +do_tunable_update_val (tunable_t *cur, const tunable_val_t *valp, + const tunable_num_t *minp, const tunable_num_t *maxp) +{ + tunable_num_t val, min, max; + if (cur->type.type_code == TUNABLE_TYPE_STRING) + { + cur->val.strval = valp->strval; + cur->initialized = 1; + return; + } + _Bool unsigned_cmp = unsigned_tunable_type (cur->type.type_code); + val = valp->numval; + min = minp != ((void *)0) ? *minp : cur->type.min; + max = maxp != ((void *)0) ? *maxp : cur->type.max; + if (tunable_val_lt (min, cur->type.min, unsigned_cmp)) + min = cur->type.min; + if (tunable_val_gt (max, cur->type.max, unsigned_cmp)) + max = cur->type.max; + if (tunable_val_gt (min, max, unsigned_cmp)) + { + min = cur->type.min; + max = cur->type.max; + } + if (tunable_val_lt (val, min, unsigned_cmp) + || tunable_val_lt (max, val, unsigned_cmp)) + return; + cur->val.numval = val; + cur->type.min = min; + cur->type.max = max; + cur->initialized = 1; +} +static void +tunable_initialize (tunable_t *cur, const char *strval) +{ + tunable_val_t val; + if (cur->type.type_code != TUNABLE_TYPE_STRING) + val.numval = (tunable_num_t)_dl_strtoul (strval, ((void *)0)); + else + val.strval = strval; + do_tunable_update_val (cur, &val, ((void *)0), ((void *)0)); +} +static void +parse_tunables (char *tunestr, char *valstring) +{ + if (tunestr == ((void *)0) || *tunestr == '\0') + return; + char *p = tunestr; + size_t off = 0; + while (1) + { + char *name = p; + size_t len = 0; + while (p[len] != '=' && p[len] != ':' && p[len] != '\0') + len++; + if (p[len] == '\0') + { + if (__libc_enable_secure) + tunestr[off] = '\0'; + return; + } + if (p[len] == ':') + { + p += len + 1; + continue; + } + p += len + 1; + char *value = &valstring[p - tunestr]; + len = 0; + while (p[len] != ':' && p[len] != '\0') + len++; + for (size_t i = 0; i < sizeof (tunable_list) / sizeof (tunable_t); i++) + { + tunable_t *cur = &tunable_list[i]; + if (tunable_is_name (cur->name, name)) + { + if (__libc_enable_secure) + { + if (cur->security_level != TUNABLE_SECLEVEL_SXID_ERASE) + { + if (off > 0) + tunestr[off++] = ':'; + const char *n = cur->name; + while (*n != '\0') + tunestr[off++] = *n++; + tunestr[off++] = '='; + for (size_t j = 0; j < len; j++) + tunestr[off++] = value[j]; + } + if (cur->security_level != TUNABLE_SECLEVEL_NONE) + break; + } + value[len] = '\0'; + tunable_initialize (cur, value); + break; + } + } + if (p[len] != '\0') + p += len + 1; + } +} +void +__tunables_init (char **envp) +{ + char *envname = ((void *)0); + char *envval = ((void *)0); + size_t len = 0; + char **prev_envp = envp; + while ((envp = get_next_env (envp, &envname, &len, &envval, &prev_envp)) + != ((void *)0)) + { + if (tunable_is_name ("GLIBC_TUNABLES", envname)) + { + char *new_env = tunables_strdup (envname); + if (new_env != ((void *)0)) + parse_tunables (new_env + len + 1, envval); + *prev_envp = new_env; + continue; + } + for (int i = 0; i < sizeof (tunable_list) / sizeof (tunable_t); i++) + { + tunable_t *cur = &tunable_list[i]; + const char *name = cur->env_alias; + if (tunable_is_name (name, envname)) + { + tunable_initialize (cur, envval); + break; + } + } + } +} diff --git a/gcc/testsuite/gcc.target/i386/pr103762-1b.c b/gcc/testsuite/gcc.target/i386/pr103762-1b.c new file mode 100644 index 0000000..391f51c --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103762-1b.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target pie } */ +/* { dg-options "-O2 -std=gnu11 -fgnu89-inline -fpie" } */ +/* { dg-final { scan-assembler-not ".quad\[\\t \]+tunable_list" { target lp64 } } } */ +/* { dg-final { scan-assembler-not ".long\[\\t \]+tunable_list" { target { ! lp64 } } } } */ + +#include "pr103762-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr103762-1c.c b/gcc/testsuite/gcc.target/i386/pr103762-1c.c new file mode 100644 index 0000000..4667b06 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103762-1c.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target fpic } */ +/* { dg-options "-O2 -std=gnu11 -fgnu89-inline -fpic" } */ +/* { dg-final { scan-assembler-not ".quad\[\\t \]+tunable_list" { target lp64 } } } */ +/* { dg-final { scan-assembler-not ".long\[\\t \]+tunable_list" { target { ! lp64 } } } } */ + +#include "pr103762-1a.c" diff --git a/gcc/testsuite/gcc.target/i386/pr103773-2.c b/gcc/testsuite/gcc.target/i386/pr103773-2.c new file mode 100644 index 0000000..9dafebd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103773-2.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-Oz" } */ +short s; +int i; +long long l; + +void s0() { s = 0; } +void sm1() { s = -1; } +void i0() { i = 0; } +void im1() { i = -1; } +void l0() { l = 0; } +void lm1() { l = -1; } + +/* { dg-final { scan-assembler-not "\tmov\[wlq\]\t\\\$0," } } */ +/* { dg-final { scan-assembler-not "\tmov\[wlq\]\t\\\$-1," } } */ +/* { dg-final { scan-assembler "\tandw\t\\\$0," } } */ +/* { dg-final { scan-assembler "\torw\t\\\$-1," } } */ +/* { dg-final { scan-assembler "\torl\t\\\$-1," } } */ + diff --git a/gcc/testsuite/gcc.target/i386/pr103773.c b/gcc/testsuite/gcc.target/i386/pr103773.c new file mode 100644 index 0000000..1e4b8ce --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103773.c @@ -0,0 +1,12 @@ +/* { dg-do run } */ +/* { dg-options "-Oz" } */ + +unsigned long long x; + +int main (void) +{ + __builtin_memset (&x, 0xff, 4); + if (x != 0xffffffff) + __builtin_abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr103785.c b/gcc/testsuite/gcc.target/i386/pr103785.c new file mode 100644 index 0000000..5503b96 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr103785.c @@ -0,0 +1,38 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +#include <stdlib.h> + +struct wrapper_t +{ + long k; + long e; +}; + +struct wrapper_t **table; + +__attribute__ ((weak, regparm (2))) +void +update (long k, long e) +{ + struct wrapper_t *elmt; + + elmt = table[k % 3079]; + if (elmt == 0) + return; + elmt->e = e; +} + +int +main () +{ + table = (struct wrapper_t **) malloc (20 * sizeof (struct wrapper_t *)); + for (int i = 0; i < 20; i++) + table[i] = (struct wrapper_t *) calloc (sizeof (struct wrapper_t), 1); + if (table[10]->e != 0) + abort (); + update (10, 20); + if (table[10]->e != 20) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/i386/pr89261.c b/gcc/testsuite/gcc.target/i386/pr89261.c index c5c4273..b599d49 100644 --- a/gcc/testsuite/gcc.target/i386/pr89261.c +++ b/gcc/testsuite/gcc.target/i386/pr89261.c @@ -5,6 +5,7 @@ typedef double __v2df __attribute__ ((vector_size (16), aligned (1 << 28))); __v2df foo = { 1.0, 2.0 }; -/* { dg-error {alignment of 'foo' is greater than maximum object file alignment 32768} "" { target *-*-darwin* } .-1 } */ +/* { dg-error {alignment of 'foo' is greater than maximum object file alignment 32768} "" { target { *-*-darwin[89]* *-*-darwin10* } } .-1 } */ /* { dg-final { scan-assembler "\.align\[ \t]+268435456" { target { ! *-*-darwin* } } } } */ +/* { dg-final { scan-assembler "\.align\[ \t]+28" { target { *-*-darwin1[1-9]* *-*-darwin2* } } } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr95046-1.c b/gcc/testsuite/gcc.target/i386/pr95046-1.c index bcc8bb5..2a0e6db 100644 --- a/gcc/testsuite/gcc.target/i386/pr95046-1.c +++ b/gcc/testsuite/gcc.target/i386/pr95046-1.c @@ -1,6 +1,6 @@ /* PR target/95046 */ /* { dg-do compile { target { ! ia32 } } } */ -/* { dg-options "-O3 -ffast-math -msse2" } */ +/* { dg-options "-O3 -ffast-math -msse2 -mno-recip" } */ float r[2], a[2], b[2]; @@ -33,6 +33,15 @@ test_mult (void) /* { dg-final { scan-assembler "\tv?mulps" } } */ void +test_div (void) +{ + for (int i = 0; i < 2; i++) + r[i] = a[i] / b[i]; +} + +/* { dg-final { scan-assembler "\tv?divps" } } */ + +void test_min (void) { for (int i = 0; i < 2; i++) diff --git a/gcc/testsuite/gcc.target/i386/smuldi3_highpart.c b/gcc/testsuite/gcc.target/i386/smuldi3_highpart.c index 8bbd5f5..cd8ea41 100644 --- a/gcc/testsuite/gcc.target/i386/smuldi3_highpart.c +++ b/gcc/testsuite/gcc.target/i386/smuldi3_highpart.c @@ -2,7 +2,7 @@ /* { dg-options "-O2" } */ typedef int __attribute ((mode(TI))) ti_t; -long foo(long x) +long long foo(long long x) { return ((ti_t)x * 19065) >> 72; } diff --git a/gcc/testsuite/gcc.target/riscv/pr103302.c b/gcc/testsuite/gcc.target/riscv/pr103302.c index 822c408..cfaa222 100644 --- a/gcc/testsuite/gcc.target/riscv/pr103302.c +++ b/gcc/testsuite/gcc.target/riscv/pr103302.c @@ -1,4 +1,4 @@ -/* { dg-do run } */ +/* { dg-do run { target int128 } } */ /* { dg-options "-Og -fharden-compares -fno-tree-dce -fno-tree-fre " } */ typedef unsigned char u8; diff --git a/gcc/testsuite/gfortran.dg/extract_recip_1.f b/gcc/testsuite/gfortran.dg/extract_recip_1.f index f70157c..74d42a4 100644 --- a/gcc/testsuite/gfortran.dg/extract_recip_1.f +++ b/gcc/testsuite/gfortran.dg/extract_recip_1.f @@ -1,5 +1,5 @@ ! { dg-do compile } -! { dg-options "-Ofast -fdump-tree-optimized-raw" } +! { dg-options "-Ofast -fno-tree-vectorize -fdump-tree-optimized-raw" } SUBROUTINE F(N,X,Y,Z,A,B) DIMENSION X(4,4), Y(4), Z(4) diff --git a/gcc/testsuite/gfortran.dg/illegal_boz_arg_3.f90 b/gcc/testsuite/gfortran.dg/illegal_boz_arg_3.f90 new file mode 100644 index 0000000..59fefa9 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/illegal_boz_arg_3.f90 @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR fortran/103778 + +program p + use iso_c_binding, only : c_sizeof + integer, parameter :: a = c_sizeof(z'1') ! { dg-error "cannot appear" } +end diff --git a/gcc/testsuite/gfortran.dg/pr98076.f90 b/gcc/testsuite/gfortran.dg/pr98076.f90 new file mode 100644 index 0000000..d1288a4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr98076.f90 @@ -0,0 +1,293 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_int } +! +! Check that we can print large integer values + +program test + implicit none + ! 128-bit integer kind + integer, parameter :: k = selected_int_kind(38) + + character(len=39) :: s + character(len=100) :: buffer + integer(kind=k) :: n + integer :: i + + ! Random checks + do i = 1, 1000 + call random_digits(s) + read(s,*) n + write(buffer,'(I0.38)') n + print *, s + print *, buffer + if (adjustl(buffer) /= adjustl(s)) stop 2 + end do + + ! Systematic check + call check(0_k, "0") + call check(1_k, "1") + call check(9_k, "9") + call check(10_k, "10") + call check(11_k, "11") + call check(99_k, "99") + call check(100_k, "100") + call check(101_k, "101") + call check(999_k, "999") + call check(1000_k, "1000") + call check(1001_k, "1001") + call check(9999_k, "9999") + call check(10000_k, "10000") + call check(10001_k, "10001") + call check(99999_k, "99999") + call check(100000_k, "100000") + call check(100001_k, "100001") + call check(999999_k, "999999") + call check(1000000_k, "1000000") + call check(1000001_k, "1000001") + call check(9999999_k, "9999999") + call check(10000000_k, "10000000") + call check(10000001_k, "10000001") + call check(99999999_k, "99999999") + call check(100000000_k, "100000000") + call check(100000001_k, "100000001") + call check(999999999_k, "999999999") + call check(1000000000_k, "1000000000") + call check(1000000001_k, "1000000001") + call check(9999999999_k, "9999999999") + call check(10000000000_k, "10000000000") + call check(10000000001_k, "10000000001") + call check(99999999999_k, "99999999999") + call check(100000000000_k, "100000000000") + call check(100000000001_k, "100000000001") + call check(999999999999_k, "999999999999") + call check(1000000000000_k, "1000000000000") + call check(1000000000001_k, "1000000000001") + call check(9999999999999_k, "9999999999999") + call check(10000000000000_k, "10000000000000") + call check(10000000000001_k, "10000000000001") + call check(99999999999999_k, "99999999999999") + call check(100000000000000_k, "100000000000000") + call check(100000000000001_k, "100000000000001") + call check(999999999999999_k, "999999999999999") + call check(1000000000000000_k, "1000000000000000") + call check(1000000000000001_k, "1000000000000001") + call check(9999999999999999_k, "9999999999999999") + call check(10000000000000000_k, "10000000000000000") + call check(10000000000000001_k, "10000000000000001") + call check(99999999999999999_k, "99999999999999999") + call check(100000000000000000_k, "100000000000000000") + call check(100000000000000001_k, "100000000000000001") + call check(999999999999999999_k, "999999999999999999") + call check(1000000000000000000_k, "1000000000000000000") + call check(1000000000000000001_k, "1000000000000000001") + call check(9999999999999999999_k, "9999999999999999999") + call check(10000000000000000000_k, "10000000000000000000") + call check(10000000000000000001_k, "10000000000000000001") + call check(99999999999999999999_k, "99999999999999999999") + call check(100000000000000000000_k, "100000000000000000000") + call check(100000000000000000001_k, "100000000000000000001") + call check(999999999999999999999_k, "999999999999999999999") + call check(1000000000000000000000_k, "1000000000000000000000") + call check(1000000000000000000001_k, "1000000000000000000001") + call check(9999999999999999999999_k, "9999999999999999999999") + call check(10000000000000000000000_k, "10000000000000000000000") + call check(10000000000000000000001_k, "10000000000000000000001") + call check(99999999999999999999999_k, "99999999999999999999999") + call check(100000000000000000000000_k, "100000000000000000000000") + call check(100000000000000000000001_k, "100000000000000000000001") + call check(999999999999999999999999_k, "999999999999999999999999") + call check(1000000000000000000000000_k, "1000000000000000000000000") + call check(1000000000000000000000001_k, "1000000000000000000000001") + call check(9999999999999999999999999_k, "9999999999999999999999999") + call check(10000000000000000000000000_k, "10000000000000000000000000") + call check(10000000000000000000000001_k, "10000000000000000000000001") + call check(99999999999999999999999999_k, "99999999999999999999999999") + call check(100000000000000000000000000_k, "100000000000000000000000000") + call check(100000000000000000000000001_k, "100000000000000000000000001") + call check(999999999999999999999999999_k, "999999999999999999999999999") + call check(1000000000000000000000000000_k, "1000000000000000000000000000") + call check(1000000000000000000000000001_k, "1000000000000000000000000001") + call check(9999999999999999999999999999_k, "9999999999999999999999999999") + call check(10000000000000000000000000000_k, "10000000000000000000000000000") + call check(10000000000000000000000000001_k, "10000000000000000000000000001") + call check(99999999999999999999999999999_k, "99999999999999999999999999999") + call check(100000000000000000000000000000_k, "100000000000000000000000000000") + call check(100000000000000000000000000001_k, "100000000000000000000000000001") + call check(999999999999999999999999999999_k, "999999999999999999999999999999") + call check(1000000000000000000000000000000_k, "1000000000000000000000000000000") + call check(1000000000000000000000000000001_k, "1000000000000000000000000000001") + call check(9999999999999999999999999999999_k, "9999999999999999999999999999999") + call check(10000000000000000000000000000000_k, "10000000000000000000000000000000") + call check(10000000000000000000000000000001_k, "10000000000000000000000000000001") + call check(99999999999999999999999999999999_k, "99999999999999999999999999999999") + call check(100000000000000000000000000000000_k, "100000000000000000000000000000000") + call check(100000000000000000000000000000001_k, "100000000000000000000000000000001") + call check(999999999999999999999999999999999_k, "999999999999999999999999999999999") + call check(1000000000000000000000000000000000_k, "1000000000000000000000000000000000") + call check(1000000000000000000000000000000001_k, "1000000000000000000000000000000001") + call check(9999999999999999999999999999999999_k, "9999999999999999999999999999999999") + call check(10000000000000000000000000000000000_k, "10000000000000000000000000000000000") + call check(10000000000000000000000000000000001_k, "10000000000000000000000000000000001") + call check(99999999999999999999999999999999999_k, "99999999999999999999999999999999999") + call check(100000000000000000000000000000000000_k, "100000000000000000000000000000000000") + call check(100000000000000000000000000000000001_k, "100000000000000000000000000000000001") + call check(999999999999999999999999999999999999_k, "999999999999999999999999999999999999") + call check(1000000000000000000000000000000000000_k, "1000000000000000000000000000000000000") + call check(1000000000000000000000000000000000001_k, "1000000000000000000000000000000000001") + call check(9999999999999999999999999999999999999_k, "9999999999999999999999999999999999999") + call check(10000000000000000000000000000000000000_k, "10000000000000000000000000000000000000") + call check(10000000000000000000000000000000000001_k, "10000000000000000000000000000000000001") + call check(99999999999999999999999999999999999999_k, "99999999999999999999999999999999999999") + call check(100000000000000000000000000000000000000_k, "100000000000000000000000000000000000000") + call check(100000000000000000000000000000000000001_k, "100000000000000000000000000000000000001") + call check(109999999999999999999999999999999999999_k, "109999999999999999999999999999999999999") + + call check(-1_k, "-1") + call check(-9_k, "-9") + call check(-10_k, "-10") + call check(-11_k, "-11") + call check(-99_k, "-99") + call check(-100_k, "-100") + call check(-101_k, "-101") + call check(-999_k, "-999") + call check(-1000_k, "-1000") + call check(-1001_k, "-1001") + call check(-9999_k, "-9999") + call check(-10000_k, "-10000") + call check(-10001_k, "-10001") + call check(-99999_k, "-99999") + call check(-100000_k, "-100000") + call check(-100001_k, "-100001") + call check(-999999_k, "-999999") + call check(-1000000_k, "-1000000") + call check(-1000001_k, "-1000001") + call check(-9999999_k, "-9999999") + call check(-10000000_k, "-10000000") + call check(-10000001_k, "-10000001") + call check(-99999999_k, "-99999999") + call check(-100000000_k, "-100000000") + call check(-100000001_k, "-100000001") + call check(-999999999_k, "-999999999") + call check(-1000000000_k, "-1000000000") + call check(-1000000001_k, "-1000000001") + call check(-9999999999_k, "-9999999999") + call check(-10000000000_k, "-10000000000") + call check(-10000000001_k, "-10000000001") + call check(-99999999999_k, "-99999999999") + call check(-100000000000_k, "-100000000000") + call check(-100000000001_k, "-100000000001") + call check(-999999999999_k, "-999999999999") + call check(-1000000000000_k, "-1000000000000") + call check(-1000000000001_k, "-1000000000001") + call check(-9999999999999_k, "-9999999999999") + call check(-10000000000000_k, "-10000000000000") + call check(-10000000000001_k, "-10000000000001") + call check(-99999999999999_k, "-99999999999999") + call check(-100000000000000_k, "-100000000000000") + call check(-100000000000001_k, "-100000000000001") + call check(-999999999999999_k, "-999999999999999") + call check(-1000000000000000_k, "-1000000000000000") + call check(-1000000000000001_k, "-1000000000000001") + call check(-9999999999999999_k, "-9999999999999999") + call check(-10000000000000000_k, "-10000000000000000") + call check(-10000000000000001_k, "-10000000000000001") + call check(-99999999999999999_k, "-99999999999999999") + call check(-100000000000000000_k, "-100000000000000000") + call check(-100000000000000001_k, "-100000000000000001") + call check(-999999999999999999_k, "-999999999999999999") + call check(-1000000000000000000_k, "-1000000000000000000") + call check(-1000000000000000001_k, "-1000000000000000001") + call check(-9999999999999999999_k, "-9999999999999999999") + call check(-10000000000000000000_k, "-10000000000000000000") + call check(-10000000000000000001_k, "-10000000000000000001") + call check(-99999999999999999999_k, "-99999999999999999999") + call check(-100000000000000000000_k, "-100000000000000000000") + call check(-100000000000000000001_k, "-100000000000000000001") + call check(-999999999999999999999_k, "-999999999999999999999") + call check(-1000000000000000000000_k, "-1000000000000000000000") + call check(-1000000000000000000001_k, "-1000000000000000000001") + call check(-9999999999999999999999_k, "-9999999999999999999999") + call check(-10000000000000000000000_k, "-10000000000000000000000") + call check(-10000000000000000000001_k, "-10000000000000000000001") + call check(-99999999999999999999999_k, "-99999999999999999999999") + call check(-100000000000000000000000_k, "-100000000000000000000000") + call check(-100000000000000000000001_k, "-100000000000000000000001") + call check(-999999999999999999999999_k, "-999999999999999999999999") + call check(-1000000000000000000000000_k, "-1000000000000000000000000") + call check(-1000000000000000000000001_k, "-1000000000000000000000001") + call check(-9999999999999999999999999_k, "-9999999999999999999999999") + call check(-10000000000000000000000000_k, "-10000000000000000000000000") + call check(-10000000000000000000000001_k, "-10000000000000000000000001") + call check(-99999999999999999999999999_k, "-99999999999999999999999999") + call check(-100000000000000000000000000_k, "-100000000000000000000000000") + call check(-100000000000000000000000001_k, "-100000000000000000000000001") + call check(-999999999999999999999999999_k, "-999999999999999999999999999") + call check(-1000000000000000000000000000_k, "-1000000000000000000000000000") + call check(-1000000000000000000000000001_k, "-1000000000000000000000000001") + call check(-9999999999999999999999999999_k, "-9999999999999999999999999999") + call check(-10000000000000000000000000000_k, "-10000000000000000000000000000") + call check(-10000000000000000000000000001_k, "-10000000000000000000000000001") + call check(-99999999999999999999999999999_k, "-99999999999999999999999999999") + call check(-100000000000000000000000000000_k, "-100000000000000000000000000000") + call check(-100000000000000000000000000001_k, "-100000000000000000000000000001") + call check(-999999999999999999999999999999_k, "-999999999999999999999999999999") + call check(-1000000000000000000000000000000_k, "-1000000000000000000000000000000") + call check(-1000000000000000000000000000001_k, "-1000000000000000000000000000001") + call check(-9999999999999999999999999999999_k, "-9999999999999999999999999999999") + call check(-10000000000000000000000000000000_k, "-10000000000000000000000000000000") + call check(-10000000000000000000000000000001_k, "-10000000000000000000000000000001") + call check(-99999999999999999999999999999999_k, "-99999999999999999999999999999999") + call check(-100000000000000000000000000000000_k, "-100000000000000000000000000000000") + call check(-100000000000000000000000000000001_k, "-100000000000000000000000000000001") + call check(-999999999999999999999999999999999_k, "-999999999999999999999999999999999") + call check(-1000000000000000000000000000000000_k, "-1000000000000000000000000000000000") + call check(-1000000000000000000000000000000001_k, "-1000000000000000000000000000000001") + call check(-9999999999999999999999999999999999_k, "-9999999999999999999999999999999999") + call check(-10000000000000000000000000000000000_k, "-10000000000000000000000000000000000") + call check(-10000000000000000000000000000000001_k, "-10000000000000000000000000000000001") + call check(-99999999999999999999999999999999999_k, "-99999999999999999999999999999999999") + call check(-100000000000000000000000000000000000_k, "-100000000000000000000000000000000000") + call check(-100000000000000000000000000000000001_k, "-100000000000000000000000000000000001") + call check(-999999999999999999999999999999999999_k, "-999999999999999999999999999999999999") + call check(-1000000000000000000000000000000000000_k, "-1000000000000000000000000000000000000") + call check(-1000000000000000000000000000000000001_k, "-1000000000000000000000000000000000001") + call check(-9999999999999999999999999999999999999_k, "-9999999999999999999999999999999999999") + call check(-10000000000000000000000000000000000000_k, "-10000000000000000000000000000000000000") + call check(-10000000000000000000000000000000000001_k, "-10000000000000000000000000000000000001") + call check(-99999999999999999999999999999999999999_k, "-99999999999999999999999999999999999999") + call check(-100000000000000000000000000000000000000_k, "-100000000000000000000000000000000000000") + call check(-100000000000000000000000000000000000001_k, "-100000000000000000000000000000000000001") + call check(-109999999999999999999999999999999999999_k, "-109999999999999999999999999999999999999") + +contains + + subroutine check (i, str) + implicit none + integer(kind=k), intent(in), value :: i + character(len=*), intent(in) :: str + + character(len=100) :: buffer + write(buffer,*) i + if (adjustl(buffer) /= adjustl(str)) stop 1 + end subroutine + + subroutine random_digits (str) + implicit none + integer, parameter :: l = 38 + character(len=l+1) :: str + real :: r + integer :: i, d + + str = "" + do i = 2, l+1 + call random_number(r) + d = floor(r * 10) + str(i:i) = achar(48 + d) + end do + + call random_number(r) + if (r > 0.5) then + str(1:1) = '-' + end if + end subroutine +end diff --git a/gcc/testsuite/gfortran.dg/select_10.f90 b/gcc/testsuite/gfortran.dg/select_10.f90 new file mode 100644 index 0000000..2d9b017 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_10.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! PR fortran/103776 - ICE in gfc_compare_string +! Contributed by G.Steinmetz + +program p + integer :: n + select case (n) + case ([1]) ! { dg-error "must be scalar" } + end select + select case (n) + case (:[2]) ! { dg-error "must be scalar" } + end select + select case (n) + case (['1']) ! { dg-error "must be scalar" } + end select + select case (n) + case (['1']:2) ! { dg-error "must be scalar" } + end select + select case (n) + case(['1']:['2']) ! { dg-error "must be scalar" } + end select + select case (n) + case(1:['2']) ! { dg-error "must be scalar" } + end select +end diff --git a/gcc/toplev.c b/gcc/toplev.c index 99276bd..6727c9f 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1718,6 +1718,8 @@ process_options (bool no_backend) if (flag_large_source_files) line_table->default_range_bits = 0; + diagnose_options (&global_options, &global_options_set, UNKNOWN_LOCATION); + /* Please don't change global_options after this point, those changes won't be reflected in optimization_{default,current}_node. */ } @@ -13530,7 +13530,7 @@ verify_type (const_tree t) tree ct = TYPE_CANONICAL (t); if (!ct) ; - else if (TYPE_CANONICAL (t) != ct) + else if (TYPE_CANONICAL (ct) != ct) { error ("%<TYPE_CANONICAL%> has different %<TYPE_CANONICAL%>"); debug_tree (ct); |