aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-03-24gccrs: Fix an issue with ForeverStack::dfs_ribOwen Avery1-3/+2
gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx (ForeverStack::dfs_rib): Fix const implementation. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-24gccrs: Add option_env! supportLiam Naddell8-1/+234
gcc/rust/ChangeLog: * expand/rust-macro-builtins-utility.cc: Add macro expansion for option_env with eager expansion * expand/rust-macro-builtins.cc: Add option_env to builtin list * expand/rust-macro-builtins.h: Add option_env handler to header file * resolve/rust-late-name-resolver-2.0.cc: Prevent NR2.0 from recursing into lang-item segments gcc/testsuite/ChangeLog: * rust/compile/macros/builtin/option_env1.rs: Add success case for option_env * rust/compile/macros/builtin/option_env2.rs: Add failure case for option_env * rust/execute/torture/builtin_macro_option_env.rs: Add execution case for option_env
2025-03-24gccrs: ast: Add new Expr::KindsArthur Cohen2-0/+41
Collapses all of the OperatorExprs into Expr instead of first having to check for OperatorExpr and then check for each OperatorExpr::Kind. gcc/rust/ChangeLog: * ast/rust-ast.h: Add new Expr::Kinds. * ast/rust-expr.h: Implement missing get_expr_kind(), Add get_function_expr_ptr()
2025-03-24gccrs: add support for ref literal patternsPhilip Herron4-8/+52
Fixes Rust-GCC#3174 gcc/rust/ChangeLog: * backend/rust-compile-pattern.cc (CompilePatternBindings::visit): make recursive * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): handle ref flag gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 cant handle this * rust/compile/issue-3174.rs: New test. Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2025-03-24gccrs: lang-items: Add From::fromArthur Cohen2-0/+5
gcc/rust/ChangeLog: * util/rust-lang-item.h: Declare it. * util/rust-lang-item.cc: Use it.
2025-03-24gccrs: add new -frust-overflow-checks flag to control overflow checksPhilip Herron2-16/+21
This will be crucial for more complex gimple debugging to make it easier to follow the code vs the original rust code. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): disable overflow checks * lang.opt: new flag Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2025-03-24gccrs: Remove some passing test from exclude filePierre-Emmanuel Patry1-5/+2
Those tests are now passing. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove some tests. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Compile unit struct with constructorPierre-Emmanuel Patry1-0/+5
gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Do not use query system for unit struct but compile it's constructor instead. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Resolved item type shall be differentiated laterPierre-Emmanuel Patry1-2/+4
We need to query all namespaces and error out at a later stage if the retrieved item is wrong. gcc/rust/ChangeLog: * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait): Query all namespaces. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Make foreverstack debug string constPierre-Emmanuel Patry2-6/+6
Those function should not change anything within the foreverstack, it can therefore be made const. gcc/rust/ChangeLog: * resolve/rust-forever-stack.h: Make debug functions const. * resolve/rust-forever-stack.hxx: Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Clone expr instead of taking itPierre-Emmanuel Patry1-4/+5
We're reusing the value, it could therefore not be taken be should be cloned. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Clone expr instead of taking it. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Remove some tests from nr2 exclusion filePierre-Emmanuel Patry1-11/+0
Those test are now passing. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove passing tests. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Remove query mode on CompileItemPierre-Emmanuel Patry2-8/+4
Query mode was a hack to catch up some compile errors early, it was deemed to be removed at some time. Recent changes to NR1 highlighted an incompatibility with it hence it's removal. gcc/rust/ChangeLog: * backend/rust-compile-item.h: Remove query mode. * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Add unit struct to name namespace in old resolverPierre-Emmanuel Patry1-8/+15
We missed the name namespace for unit struct in the old resolver. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-toplevel.h: Add struct to name namespace. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Add debug dump to old name resolverPierre-Emmanuel Patry1-0/+35
It might be necessary to compare both name resolution' internal states during the transition. This new debug representation could help with that. gcc/rust/ChangeLog: * resolve/rust-name-resolver.h: Add new degug dump for old name resolver. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Labels shall be pushed within label namespacePierre-Emmanuel Patry4-14/+14
Labels were using the wrong namespace. gcc/rust/ChangeLog: * resolve/rust-ast-resolve-expr.cc (ResolveExpr::visit): Change label push function from type rib to label rib. * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise. (ResolveItem::visit): Likewise. (ResolveExternItem::visit): Likewise. * resolve/rust-ast-resolve-stmt.h: Likewise. * resolve/rust-ast-resolve.cc (NameResolution::go): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: backend: Improve handling of lang-item PathInExpressionsArthur Cohen2-48/+84
gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Call into resolve_path_like instead. (ResolvePathRef::resolve_path_like): New. (ResolvePathRef::resolve): Call into resolve_with_node_id. * backend/rust-compile-resolve-path.h: Declare new functions and document them.
2025-03-24gccrs: ast: Add Path::is_lang_item()Arthur Cohen1-0/+2
gcc/rust/ChangeLog: * ast/rust-path.h: New function.
2025-03-24gccrs: marklive: Fix handling for lang item PathInExpressions.Arthur Cohen1-4/+12
gcc/rust/ChangeLog: * checks/lints/rust-lint-marklive.cc (MarkLive::visit): Adapt to lang items.
2025-03-24gccrs: hir: Adapt visitors to lang item PathInExpressionsArthur Cohen2-15/+85
gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (ResolvePathRef::visit): Adapt visitor to lang item HIR::PathInExpressions. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::visit): Likewise.
2025-03-24gccrs: hir: Add LangItem paths to PathPattern classArthur Cohen3-8/+104
gcc/rust/ChangeLog: * hir/tree/rust-hir-path.h: Adapt PathPattern to accept lang-item paths. * hir/tree/rust-hir-path.cc: Assert we are dealing with a segmented path, create lang-item constructors. * hir/tree/rust-hir.cc (PathPattern::convert_to_simple_path): Likewise.
2025-03-24gccrs: ast: More visitors to allow lang item paths in expressionsArthur Cohen7-35/+53
gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Adapt visitor to lang item PathInExpressions. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Likewise. * expand/rust-cfg-strip.cc (CfgStrip::visit): Likewise. * expand/rust-expand-visitor.cc (ExpandVisitor::visit): Likewise. * hir/rust-ast-lower.cc (ASTLoweringExprWithBlock::visit): Likewise. (ASTLowerPathInExpression::visit): Likewise. * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Likewise.
2025-03-24gccrs: lang-items: Add LangItem::IsEnumVariantArthur Cohen2-1/+13
gcc/rust/ChangeLog: * util/rust-lang-item.cc (LangItem::IsEnumVariant): New function. * util/rust-lang-item.h: Declare it.
2025-03-24gccrs: mappings: Improve error message for get_lang_item_nodeArthur Cohen1-2/+2
gcc/rust/ChangeLog: * util/rust-hir-map.cc (Mappings::get_lang_item_node): Better formatting when a lang item does not exist when it should.
2025-03-24gccrs: lang-items: Collect enum variants as lang itemsArthur Cohen2-0/+10
gcc/rust/ChangeLog: * ast/rust-collect-lang-items.h: Declare visitor. * ast/rust-collect-lang-items.cc (CollectLangItems::visit): New.
2025-03-24gccrs: catch missing guard for optional resultPhilip Herron2-7/+2
When we lookup here it returns an optional which can lead to a crash because it needs a guard if it has a value. gcc/rust/ChangeLog: * backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): add guard gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: these tests now work it seems Signed-off-by: Philip Herron <herron.philip@googlemail.com>
2025-03-24gccrs: Infer crate name after file openingDylan Gardner2-29/+34
Fixes #3129. gcc/rust/ChangeLog: * rust-session-manager.cc (Session::handle_crate_name): Remove crate name inference (Session::compile_crate): Add crate name inference and error if inferred name is empty. Remove CompileOptions::get_instance () that returned a local copy of the options. Rename crate_name_changed to crate_name_found to match semantics. (rust_crate_name_validation_test): Test inferring ".rs" name * rust-session-manager.h: Modify handle_crate_name definition to include filename.
2025-03-24gccrs: Add captures for ClosureExprInnerTyped with nr2Pierre-Emmanuel Patry2-2/+16
Captures were only processed for regular ClosureExprInner. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add ClosureExprInnerTyped visit implementation. (add_captures): Add a function to avoid code duplication. * resolve/rust-late-name-resolver-2.0.h: Add function prototype. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Add environment capture to NR2Pierre-Emmanuel Patry6-1/+61
The compiler was still relying on NR1 for closure captures when using nr2 even though the resolver was not used and thus it's state empty. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add environment collection. * resolve/rust-late-name-resolver-2.0.h: Add function prototype. * resolve/rust-name-resolver.cc (Resolver::get_captures): Add assertion to prevent NR2 usage with nr1 capture functions. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Use nr2 captures. * util/rust-hir-map.cc (Mappings::add_capture): Add function to register capture for a given closure. (Mappings::lookup_captures): Add a function to lookup all captures available for a given closure. * util/rust-hir-map.h: Add function prototypes. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: Check for type paths nr2.0 can't handle yetOwen Avery2-0/+23
Some of our tests only work with name resolution 2.0 because the latter misinterprets type paths. This change should cause the compiler to error out if it would otherwise misinterpret a type path. A fix for type path resolution isn't included in this comment, since doing so would make it harder to track the meaningfulness of test regressions. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Error out if a type path has multiple segments, as we currently ignore every segment except the last. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Add entries. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
2025-03-24gccrs: backend: Allow anything as a match scrutineeArthur Cohen1-5/+1
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (check_match_scrutinee): Allow anything to be used as a match scrutinee, not just ADTs.
2025-03-24gccrs: lang-items: Add Result and Try lang itemsArthur Cohen3-0/+64
gcc/rust/ChangeLog: * util/rust-lang-item.h: Add handling for Result::Ok, Result::Err, Try, Try::into_result, Try::from_ok, Try::from_err. * util/rust-lang-item.cc: Likewise. gcc/testsuite/ChangeLog: * rust/compile/try-trait.rs: New test.
2025-03-24gccrs: Fix rust breakage with nr2Pierre-Emmanuel Patry7-42/+143
Nr2 did not emit the correct error message for break identifier "rust". gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add "rust" identifier detection akin to nr1. (funny_ice_finalizer): Copy ICE finalizer from nr1. * resolve/rust-late-name-resolver-2.0.h: Add funny_error member context state. * Make-lang.in: Add new translation unit for new ice finalizer. * resolve/rust-ast-resolve-expr.cc: Move ice finalizer to it's own file. * resolve/rust-ice-finalizer.cc: New file. * resolve/rust-ice-finalizer.h: New file. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove break-rust3.rs from exclude list. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
2025-03-24gccrs: derive(Copy): Improve bounds when deriving CopyArthur Cohen1-2/+7
gcc/rust/ChangeLog: * expand/rust-derive-copy.cc: Always add an extra Copy bound on generic Copy impls.
2025-03-24gccrs: derive(Clone): Use lang item bounds on AssertParamIsCopyArthur Cohen2-7/+6
gcc/rust/ChangeLog: * expand/rust-derive-clone.cc (DeriveClone::visit_union): Use lang items for Copy and Sized bounds. gcc/testsuite/ChangeLog: * rust/compile/derive_macro6.rs: Add lang item attribute to Copy trait.
2025-03-24gccrs: derive(Clone): Add Clone bound on generated impl blocksArthur Cohen1-6/+11
gcc/rust/ChangeLog: * expand/rust-derive-clone.cc: Add extra bound when deriving generic Clone
2025-03-24gccrs: ast-builder: Add extra parameter for TypeParam builderArthur Cohen2-2/+8
gcc/rust/ChangeLog: * ast/rust-ast-builder.cc (Builder::new_type_param): Add optional extra trait bounds. * ast/rust-ast-builder.h: Likewise.
2025-03-24gccrs: hir-dump: Improve handling of typepathsegments that are lang items.Arthur Cohen1-1/+4
gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::do_typepathsegment): Add handling for lang items.
2025-03-24gccrs: lang-item:Add LangItem::Kind::RECEIVERlishin3-0/+19
Add and implement a lang item (receiver) in source code. gcc/rust/ChangeLog: * util/rust-lang-item.cc: Add receiver to map. * util/rust-lang-item.h: Define LangItem::Kind::RECEIVER. gcc/testsuite/ChangeLog: * rust/compile/issue-2954.rs: New test. Signed-off-by: lishin <lishin1008@gmail.com>
2025-03-24gccrs: typecheck: Add basic handling for applying auto trait boundsArthur Cohen8-43/+46
gcc/rust/ChangeLog: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Register auto traits in mappings. * util/rust-hir-map.cc (Mappings::insert_auto_trait): New. (Mappings::get_auto_traits): New. * util/rust-hir-map.h: Declare them. * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Add auto trait bounds when scanning. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Some parts of nr2.0 can't handle auto traits yet. * rust/compile/auto_traits3.rs: Removed in favor of... * rust/compile/auto_traits2.rs: ...this one. * rust/compile/auto_traits4.rs: New test.
2025-03-24gccrs: typecheck: Separate assemble_builtin_candidate in twoArthur Cohen2-3/+10
This paves the way for adding trait bounds that aren't necessarily Sized. gcc/rust/ChangeLog: * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::add_trait_bound): New function. * typecheck/rust-hir-type-bounds.h: Declare it. (TypeBoundsProbe::assemble_builtin_candidate): Call into add_trait_bound.
2025-03-24libstdc++: Ensure that std::vector<bool> allocator has bool value_typeJonathan Wakely2-1/+5
This is the subject of LWG 4228 which notes that libstdc++ doesn't enforce this requirement. That's just a bug because I forgot to add it to vector<bool> when adding it elsewhere. For consistency with the other containers we should not allow incorrect allocator types for strict -std=c++NN modes, but it is very late to make that change for GCC 15 so this only enables the assertion for C++20 (where it's required). For GCC 16 we can enable it for strict modes too. libstdc++-v3/ChangeLog: * include/bits/stl_bvector.h (vector<bool, A>): Enforce the C++20 requirement that the allocator's value_type matches the container. * testsuite/23_containers/vector/bool/cons/from_range.cc: Fix incorrect allocator type. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>
2025-03-24arm: testsuite: tighten scan-assembler in unaligned-memcpy-4.cRichard Earnshaw1-1/+1
The scan-assembler-not pattern in this test was too broad and matched the 'unaligned' from the .file directive from the file name. Tighten it to require a leading comment character. gcc/testsuite: * gcc.target/arm/unaligned-memcpy-4.c: Tighten scan-assembler-not pattern.
2025-03-24Add 'libgomp.c++/pr96835-1{,-O0}.C', 'libgomp.oacc-c++/pr96835-1.C' [PR96835]Thomas Schwinge3-0/+54
PR libgomp/96835 libgomp/ * testsuite/libgomp.c++/pr96835-1.C: New. * testsuite/libgomp.c++/pr96835-1-O0.C: Likewise. * testsuite/libgomp.oacc-c++/pr96835-1.C: Likewise.
2025-03-24Add 'libgomp.c++/pr101544-1{,-O0}.C', 'libgomp.oacc-c++/pr101544-1.C' [PR101544]Thomas Schwinge3-0/+94
PR target/101544 libgomp/ * testsuite/libgomp.c++/pr101544-1.C: New. * testsuite/libgomp.c++/pr101544-1-O0.C: Likewise. * testsuite/libgomp.oacc-c++/pr101544-1.C: Likewise.
2025-03-24nvptx: In offloading compilation, special-case certain host-setup symbol ↵Thomas Schwinge2-2/+33
aliases [PR101544] Namely, use PTX '.alias' even for (default) '-mno-alias' if the host made the C++ "base and complete [cd]tor aliases". PR target/101544 gcc/ * config/nvptx/nvptx.cc (nvptx_asm_output_def_from_decls) [ACCEL_COMPILER]: Special-case certain host-setup symbol aliases. * varasm.cc (do_assemble_alias) [ACCEL_COMPILER]: Adjust.
2025-03-24nvptx: Default at least to '-mptx=6.3'Thomas Schwinge10-17/+20
gcc/ * config/nvptx/nvptx.cc (default_ptx_version_option): Default at least to '-mptx=6.3'. * doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'. gcc/testsuite/ * gcc.target/nvptx/march-map=sm_30.c: Adjust. * gcc.target/nvptx/march-map=sm_32.c: Likewise. * gcc.target/nvptx/march-map=sm_35.c: Likewise. * gcc.target/nvptx/march-map=sm_37.c: Likewise. * gcc.target/nvptx/march-map=sm_50.c: Likewise. * gcc.target/nvptx/march=sm_30.c: Likewise. * gcc.target/nvptx/march=sm_35.c: Likewise. * gcc.target/nvptx/march=sm_37.c: Likewise.
2025-03-24i386: Raise deprecate warning for -mavx10.1-256/512 and -mevex512 while add ↵Haochen Jiang45-88/+102
-mavx10.1 back with 512 bit alias When AVX10.1 options are added into GCC 14, E-core is supposed to support up to 256 bit vector width, while P-core up to 512 bit vector width. Therefore, we added avx10.1-256 and avx10.1-512 options into compiler since there will be real platforms with 256 bit only support. At the same time, for old platforms could also compile a 256 bit only binary, we introduced -mno-evex512 to disable 512 bit vector. However, all the future platforms will now support 512 bit vector width, including P-core and E-core. It will result in no need for split the option for vector width. Therefore, we will remove them in this patch. Unlike AVX10.2 options, AVX10.1 options has been there in a major release, so we have to raise a deprecate warning in GCC 15 and remove them in GCC 16. At the same time, to align with avx10.2 options, we will add just removed avx10.1 option back with warning to mention its behavior change. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Change to FEATURE_AVX10_1. * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_AVX10_1_512_SET): Renamed to ... (OPTION_MASK_ISA2_AVX10_1_SET): ... this. (OPTION_MASK_ISA2_AVX10_2_SET): Use renamed macro. (OPTION_MASK_ISA2_AVX10_1_UNSET): Ditto. (ix86_handle_option): Ditto. (processor_alias_table): Use P_PROC_AVX10_1. * common/config/i386/i386-cpuinfo.h (enum feature_priority): Rename from AVX10_1_512 to AVX10_1. (enum processor_features): Ditto. * common/config/i386/i386-isas.h: Add avx10.1. * config/i386/driver-i386.cc (host_detect_local_cpu): Use renamed enum. * config/i386/i386-c.cc (ix86_target_macros_internal): Rename to avx10.1. * config/i386/i386-isa.def (AVX10_1_512): Rename to ... (AVX10_1): ... this. * config/i386/i386-options.cc (isa2_opts): Rename to avx10.1. (ix86_valid_target_attribute_inner_p): Add avx10.1. (ix86_option_override_internal): Rename to AVX10_1. Revise warnings to mention behavior change for option combination in GCC 16. * config/i386/i386.h (PTA_DIAMONDRAPIDS): Use AVX10_1. * config/i386/i386.opt: Add avx10.1. Add deprecate warnings for mevex512 and mavx10.1-256/512. * config/i386/i386.opt.urls: Add avx10.1. * doc/extend.texi: Ditto. * doc/sourcebuild.texi: Ditto. gcc/testsuite/ChangeLog: * gcc.target/i386/avx10-check.h: Change to avx10.1. * gcc.target/i386/avx10_1-1.c: Add warning check. * gcc.target/i386/avx10_1-10.c: Ditto. * gcc.target/i386/avx10_1-11.c: Ditto. * gcc.target/i386/avx10_1-12.c: Ditto. * gcc.target/i386/avx10_1-13.c: Ditto. * gcc.target/i386/avx10_1-15.c: Ditto. * gcc.target/i386/avx10_1-16.c: Ditto. * gcc.target/i386/avx10_1-18.c: Ditto. * gcc.target/i386/avx10_1-19.c: Ditto. * gcc.target/i386/avx10_1-2.c: Ditto. * gcc.target/i386/avx10_1-20.c: Ditto. * gcc.target/i386/avx10_1-21.c: Ditto. * gcc.target/i386/avx10_1-22.c: Ditto. * gcc.target/i386/avx10_1-23.c: Ditto. * gcc.target/i386/avx10_1-26.c: Ditto. * gcc.target/i386/avx10_1-3.c: Ditto. * gcc.target/i386/avx10_1-4.c: Ditto. * gcc.target/i386/avx10_1-7.c: Ditto. * gcc.target/i386/avx10_1-8.c: Ditto. * gcc.target/i386/avx10_1-9.c: Ditto. * gcc.target/i386/noevex512-1.c: Ditto. * gcc.target/i386/noevex512-2.c: Ditto. * gcc.target/i386/pr111068.c: Ditto. * gcc.target/i386/pr111907.c: Ditto. * gcc.target/i386/pr117240_avx512f.c: Ditto. * gcc.target/i386/pr117304-1.c: Ditto. * gcc.target/i386/pr117946.c: Ditto. * gcc.target/i386/avx10_1-24.c: Removed. * gcc.target/i386/avx10_1-25.c: Removed. * gcc.target/i386/avx10_1-5.c: Removed. * gcc.target/i386/avx10_1-6.c: Removed.
2025-03-24i386: Remove avx10.2-256 and avx10.2-512 optionsHaochen Jiang34-730/+639
When AVX10.2 options are added into GCC 15, E-core is supposed to support up to 256 bit vector width, while P-core up to 512 bit vector width. Therefore, we added avx10.2-256 and avx10.2-512 options into compiler since there will be real platforms with 256 bit only support. However, all the future platforms will now support 512 bit vector width, including P-core and E-core. It will result in no need for split the option for vector width. Therefore, we will remove them in this patch. gcc/ChangeLog: * common/config/i386/cpuinfo.h (get_available_features): Revise the logic AVX10 version. * common/config/i386/i386-common.cc (OPTION_MASK_ISA2_AVX10_2_256_SET): Removed. (OPTION_MASK_ISA2_AVX10_2_512_SET): Ditto. (OPTION_MASK_ISA2_AVX10_2_SET): New. (OPTION_MASK_ISA2_AMX_AVX512_SET): Use AVX10.2 macro. (OPTION_MASK_ISA2_AVX10_2_UNSET): Ditto. (ix86_handle_option): Remove avx10.2-256 part. Adjust avx10.2. * common/config/i386/i386-cpuinfo.h (enum processor_features): Remove FEATURE_AVX10_2_256 and skip the value for it. Change the name from FEATURE_AVX10_2_512 to FEATURE_AVX10_2. * common/config/i386/i386-isas.h: Remove avx10.2-256/512. * config/i386/avx10_2-512bf16intrin.h: Use avx10.2 instead of avx10.2-256/512. * config/i386/avx10_2-512convertintrin.h: Ditto. * config/i386/avx10_2-512mediaintrin.h: Ditto. * config/i386/avx10_2-512minmaxintrin.h: Ditto. * config/i386/avx10_2-512satcvtintrin.h: Ditto. * config/i386/avx10_2bf16intrin.h: Ditto. * config/i386/avx10_2convertintrin.h: Ditto. * config/i386/avx10_2mediaintrin.h: Ditto. * config/i386/avx10_2minmaxintrin.h: Ditto. * config/i386/avx10_2satcvtintrin.h: Ditto. * config/i386/movrsintrin.h: Ditto. * config/i386/sm4intrin.h: Ditto. * config/i386/cpuid.h (bit_AVX10_256): Removed. (bit_AVX10_512): Ditto. * config/i386/driver-i386.cc (host_detect_local_cpu): Adjust Diamond Rapids and -march=native condition. * config/i386/i386-builtin.def (BDESC): Use AVX10.2 macro instead of AVX10.2-256/512. * config/i386/i386-c.cc (ix86_target_macros_internal): Ditto. * config/i386/i386-expand.cc (ix86_expand_branch): Use TARGET_AVX10_2 instead of specifying vector size. (ix86_prepare_fp_compare_args): Ditto. (ix86_expand_fp_compare): Ditto. (ix86_ssecom_setcc): Ditto. (ix86_expand_sse_comi): Ditto. (ix86_expand_sse_comi_round): Ditto. (ix86_check_builtin_isa_match): Ditto. * config/i386/i386.cc (ix86_fp_compare_code_to_integer): Ditto. (ix86_get_mask_mode): Ditto. * config/i386/i386.h (SSE_FLOAT_MODE_SSEMATH_OR_HFBF_P): Ditto. * config/i386/i386.md: Ditto. * config/i386/mmx.md: Ditto. * config/i386/sse.md: Ditto. * config/i386/predicates.md: Ditto. * config/i386/i386-isa.def (AVX10_2_256): Removed. (AVX10_2_512): Removed. (AVX10_2): New. * config/i386/i386-options.cc (isa2_opts): Remove avx10.2-256/512. (ix86_valid_target_attribute_inner_p): Ditto. (PTA_DIAMONDRAPIDS): Use PTA_AVX10_2. * config/i386/i386.opt: Remove avx10.2-256/512. * config/i386/i386.opt.urls: Ditto. * doc/extend.texi: Ditto. * doc/invoke.texi: Ditto. * doc/sourcebuild.texi: Ditto.
2025-03-24i386: Adjust AVX10.2 testcases optionsHaochen Jiang212-414/+397
Before we change AVX10.2 options in GCC 15, we need to adjust all related test options to -mavx10.2 to avoid breakage. Since -mavx10.2 is now 512 bit and will be the final option we will use. It will also be an one-time change for these tests on options. gcc/testsuite/ChangeLog: * g++.dg/other/i386-2.C: Use -mavx10.2. * g++.dg/other/i386-3.C: Ditto. * gcc.target/i386/avx-1.c: Ditto. * gcc.target/i386/avx10_2-512-bf16-1.c: Ditto. * gcc.target/i386/avx10_2-512-bf16-vector-cmp-1.c: Ditto. * gcc.target/i386/avx10_2-512-bf16-vector-fma-1.c: Ditto. * gcc.target/i386/avx10_2-512-bf16-vector-operations-1.c: Ditto. * gcc.target/i386/avx10_2-512-bf16-vector-smaxmin-1.c: Ditto. * gcc.target/i386/avx10_2-512-convert-1.c: Ditto. * gcc.target/i386/avx10_2-512-media-1.c: Ditto. * gcc.target/i386/avx10_2-512-minmax-1.c: Ditto. * gcc.target/i386/avx10_2-512-movrs-1.c: Ditto. * gcc.target/i386/avx10_2-512-satcvt-1.c: Ditto. * gcc.target/i386/avx10_2-512-vaddbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcmpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvt2ph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvt2ph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvt2ph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvt2ph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvt2ps2phx-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbiasph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbiasph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbiasph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtbiasph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvthf82ph-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvtps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttpd2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vcvttps2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-512-vdivbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vdpphps-2.c: Ditto. * gcc.target/i386/avx10_2-512-vfmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vfmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vfnmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vfnmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vfpclassbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vgetexpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vgetmantbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vminbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vminmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vminmaxpd-2.c: Ditto. * gcc.target/i386/avx10_2-512-vminmaxph-2.c: Ditto. * gcc.target/i386/avx10_2-512-vminmaxps-2.c: Ditto. * gcc.target/i386/avx10_2-512-vmpsadbw-2.c: Ditto. * gcc.target/i386/avx10_2-512-vmulbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbssd-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbssds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbsud-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbsuds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbuud-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpbuuds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwsud-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwsuds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwusd-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwusds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwuud-2.c: Ditto. * gcc.target/i386/avx10_2-512-vpdpwuuds-2.c: Ditto. * gcc.target/i386/avx10_2-512-vrcpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vreducebf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vrndscalebf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vrsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vscalefbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-512-vsubbf16-2.c: Ditto. * gcc.target/i386/avx10_2-bf16-1.c: Ditto. * gcc.target/i386/avx10_2-bf16-vector-cmp-1.c: Ditto. * gcc.target/i386/avx10_2-bf16-vector-fma-1.c: Ditto. * gcc.target/i386/avx10_2-bf16-vector-operations-1.c: Ditto. * gcc.target/i386/avx10_2-bf16-vector-smaxmin-1.c: Ditto. * gcc.target/i386/avx10_2-builtin-1.c: Ditto. * gcc.target/i386/avx10_2-builtin-2.c: Ditto. * gcc.target/i386/avx10_2-comibf-1.c: Ditto. * gcc.target/i386/avx10_2-comibf-2.c: Ditto. * gcc.target/i386/avx10_2-comibf-3.c: Ditto. * gcc.target/i386/avx10_2-comibf-4.c: Ditto. * gcc.target/i386/avx10_2-compare-1.c: Ditto. * gcc.target/i386/avx10_2-compare-1b.c: Ditto. * gcc.target/i386/avx10_2-convert-1.c: Ditto. * gcc.target/i386/avx10_2-media-1.c: Ditto. * gcc.target/i386/avx10_2-minmax-1.c: Ditto. * gcc.target/i386/avx10_2-movrs-1.c: Ditto. * gcc.target/i386/avx10_2-partial-bf16-vector-fast-math-1.c: Ditto. * gcc.target/i386/avx10_2-partial-bf16-vector-fma-1.c: Ditto. * gcc.target/i386/avx10_2-partial-bf16-vector-operations-1.c: Ditto. * gcc.target/i386/avx10_2-partial-bf16-vector-smaxmin-1.c: Ditto. * gcc.target/i386/avx10_2-satcvt-1.c: Ditto. * gcc.target/i386/avx10_2-vaddbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vcmpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vcomisbf16-1.c: Ditto. * gcc.target/i386/avx10_2-vcomisbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvt2ps2phx-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtbiasph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvthf82ph-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2bf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2bf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2hf8-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2hf8s-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvtps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttbf162ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttbf162iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttpd2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttph2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttph2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2dqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2ibs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2iubs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2qqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2udqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttps2uqqs-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttsd2sis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttsd2usis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttss2sis-2.c: Ditto. * gcc.target/i386/avx10_2-vcvttss2usis-2.c: Ditto. * gcc.target/i386/avx10_2-vdivbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vdpphps-2.c: Ditto. * gcc.target/i386/avx10_2-vfmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfnmaddXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfnmsubXXXbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vfpclassbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vgetexpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vgetmantbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxpd-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxph-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxps-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxsd-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxsh-2.c: Ditto. * gcc.target/i386/avx10_2-vminmaxss-2.c: Ditto. * gcc.target/i386/avx10_2-vmovd-1.c: Ditto. * gcc.target/i386/avx10_2-vmovd-2.c: Ditto. * gcc.target/i386/avx10_2-vmovw-1.c: Ditto. * gcc.target/i386/avx10_2-vmovw-2.c: Ditto. * gcc.target/i386/avx10_2-vmpsadbw-2.c: Ditto. * gcc.target/i386/avx10_2-vmulbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbssd-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbssds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbsud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbsuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbuud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpbuuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwsud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwsuds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwusd-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwusds-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwuud-2.c: Ditto. * gcc.target/i386/avx10_2-vpdpwuuds-2.c: Ditto. * gcc.target/i386/avx10_2-vrcpbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vreducebf16-2.c: Ditto. * gcc.target/i386/avx10_2-vrndscalebf16-2.c: Ditto. * gcc.target/i386/avx10_2-vrsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vscalefbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vsqrtbf16-2.c: Ditto. * gcc.target/i386/avx10_2-vsubbf16-2.c: Ditto. * gcc.target/i386/funcspec-56.inc: Ditto. * gcc.target/i386/part-vect-vec_cmpbf.c: Ditto. * gcc.target/i386/pr117495.c: Ditto. * gcc.target/i386/pr118815.c: Ditto. * gcc.target/i386/sm4-avx10_2-1.c: Ditto. * gcc.target/i386/sm4-avx10_2-512-1.c: Ditto. * gcc.target/i386/sm4key4-avx10_2-512-2.c: Ditto. * gcc.target/i386/sm4rnds4-avx10_2-512-2.c: Ditto. * gcc.target/i386/sse-12.c: Ditto. * gcc.target/i386/sse-13.c: Ditto. * gcc.target/i386/sse-14.c: Ditto. * gcc.target/i386/sse-22.c: Ditto. * gcc.target/i386/sse-23.c: Ditto. * gcc.target/i386/vnniint16-auto-vectorize-3.c: Ditto. * gcc.target/i386/vnniint16-auto-vectorize-4.c: Ditto. * gcc.target/i386/vnniint8-auto-vectorize-3.c: Ditto. * gcc.target/i386/vnniint8-auto-vectorize-4.c: Ditto. * gcc.target/i386/avx10-check.h: Remove avx10.2-512 and use avx10.2. * gcc.target/i386/sm4-check.h: Ditto. * lib/target-supports.exp: Ditto.