aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-range.cc
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2022-07-15 10:26:48 +0100
committerChristophe Lyon <christophe.lyon@arm.com>2023-05-03 16:58:26 +0200
commit6f59caf1c36dbed083ac535861b579bd44bf1740 (patch)
treed05c09318fe61853331c4448298661e81cbfadc5 /gcc/gimple-range.cc
parent9d7c64fa996fc32dc2ae5c9af7f83c3a3e08f34a (diff)
downloadgcc-6f59caf1c36dbed083ac535861b579bd44bf1740.zip
gcc-6f59caf1c36dbed083ac535861b579bd44bf1740.tar.gz
gcc-6f59caf1c36dbed083ac535861b579bd44bf1740.tar.bz2
arm: [MVE intrinsics] Add new framework
This patch introduces the new MVE intrinsics framework, heavily inspired by the SVE one in the aarch64 port. Like the MVE intrinsic types implementation, the intrinsics framework defines functions via a new pragma in arm_mve.h. A boolean parameter is used to pass true when __ARM_MVE_PRESERVE_USER_NAMESPACE is defined, and false when it is not, allowing for non-prefixed intrinsic functions to be conditionally defined. Future patches will build on this framework by adding new intrinsic functions and adding the features needed to support them. Differences compared to the aarch64/SVE port include: - when present, the predicate argument is the last one with MVE (the first one with SVE) - when using merging predicates ("_m" suffix), the "inactive" argument (if any) is inserted in the first position - when using merging predicates ("_m" suffix), some function do not have the "inactive" argument, so we maintain an exception-list - MVE intrinsics dealing with floating-point require the FP extension, while SVE may support different extensions - regarding global state, MVE does not have any prefetch intrinsic, so we do not need a flag for this - intrinsic names can be prefixed with "__arm", depending on whether preserve_user_namespace is true or false - parse_signature: the maximum number of arguments is now a parameter, this helps detecting an overflow with a new assert. - suffixes and overloading can be controlled using explicit_mode_suffix_p and skip_overload_p in addition to explicit_type_suffix_p At this implemtation stage, there are some limitations compared to aarch64/SVE, which are removed later in the series: - "offset" mode is not supported yet - gimple folding is not implemented 2022-09-08 Murray Steele <murray.steele@arm.com> Christophe Lyon <christophe.lyon@arm.com> gcc/ChangeLog: * config.gcc: Add arm-mve-builtins-base.o and arm-mve-builtins-shapes.o to extra_objs. * config/arm/arm-builtins.cc (arm_builtin_decl): Handle MVE builtin numberspace. (arm_expand_builtin): Likewise (arm_check_builtin_call): Likewise (arm_describe_resolver): Likewise. * config/arm/arm-builtins.h (enum resolver_ident): Add arm_mve_resolver. * config/arm/arm-c.cc (arm_pragma_arm): Handle new pragma. (arm_resolve_overloaded_builtin): Handle MVE builtins. (arm_register_target_pragmas): Register arm_check_builtin_call. * config/arm/arm-mve-builtins.cc (class registered_function): New class. (struct registered_function_hasher): New struct. (pred_suffixes): New table. (mode_suffixes): New table. (type_suffix_info): New table. (TYPES_float16): New. (TYPES_all_float): New. (TYPES_integer_8): New. (TYPES_integer_8_16): New. (TYPES_integer_16_32): New. (TYPES_integer_32): New. (TYPES_signed_16_32): New. (TYPES_signed_32): New. (TYPES_all_signed): New. (TYPES_all_unsigned): New. (TYPES_all_integer): New. (TYPES_all_integer_with_64): New. (DEF_VECTOR_TYPE): New. (DEF_DOUBLE_TYPE): New. (DEF_MVE_TYPES_ARRAY): New. (all_integer): New. (all_integer_with_64): New. (float16): New. (all_float): New. (all_signed): New. (all_unsigned): New. (integer_8): New. (integer_8_16): New. (integer_16_32): New. (integer_32): New. (signed_16_32): New. (signed_32): New. (register_vector_type): Use void_type_node for mve.fp-only types when mve.fp is not enabled. (register_builtin_tuple_types): Likewise. (handle_arm_mve_h): New function.. (matches_type_p): Likewise.. (report_out_of_range): Likewise. (report_not_enum): Likewise. (report_missing_float): Likewise. (report_non_ice): Likewise. (check_requires_float): Likewise. (function_instance::hash): Likewise (function_instance::call_properties): Likewise. (function_instance::reads_global_state_p): Likewise. (function_instance::modifies_global_state_p): Likewise. (function_instance::could_trap_p): Likewise. (function_instance::has_inactive_argument): Likewise. (registered_function_hasher::hash): Likewise. (registered_function_hasher::equal): Likewise. (function_builder::function_builder): Likewise. (function_builder::~function_builder): Likewise. (function_builder::append_name): Likewise. (function_builder::finish_name): Likewise. (function_builder::get_name): Likewise. (add_attribute): Likewise. (function_builder::get_attributes): Likewise. (function_builder::add_function): Likewise. (function_builder::add_unique_function): Likewise. (function_builder::add_overloaded_function): Likewise. (function_builder::add_overloaded_functions): Likewise. (function_builder::register_function_group): Likewise. (function_call_info::function_call_info): Likewise. (function_resolver::function_resolver): Likewise. (function_resolver::get_vector_type): Likewise. (function_resolver::get_scalar_type_name): Likewise. (function_resolver::get_argument_type): Likewise. (function_resolver::scalar_argument_p): Likewise. (function_resolver::report_no_such_form): Likewise. (function_resolver::lookup_form): Likewise. (function_resolver::resolve_to): Likewise. (function_resolver::infer_vector_or_tuple_type): Likewise. (function_resolver::infer_vector_type): Likewise. (function_resolver::require_vector_or_scalar_type): Likewise. (function_resolver::require_vector_type): Likewise. (function_resolver::require_matching_vector_type): Likewise. (function_resolver::require_derived_vector_type): Likewise. (function_resolver::require_derived_scalar_type): Likewise. (function_resolver::require_integer_immediate): Likewise. (function_resolver::require_scalar_type): Likewise. (function_resolver::check_num_arguments): Likewise. (function_resolver::check_gp_argument): Likewise. (function_resolver::finish_opt_n_resolution): Likewise. (function_resolver::resolve_unary): Likewise. (function_resolver::resolve_unary_n): Likewise. (function_resolver::resolve_uniform): Likewise. (function_resolver::resolve_uniform_opt_n): Likewise. (function_resolver::resolve): Likewise. (function_checker::function_checker): Likewise. (function_checker::argument_exists_p): Likewise. (function_checker::require_immediate): Likewise. (function_checker::require_immediate_enum): Likewise. (function_checker::require_immediate_range): Likewise. (function_checker::check): Likewise. (gimple_folder::gimple_folder): Likewise. (gimple_folder::fold): Likewise. (function_expander::function_expander): Likewise. (function_expander::direct_optab_handler): Likewise. (function_expander::get_fallback_value): Likewise. (function_expander::get_reg_target): Likewise. (function_expander::add_output_operand): Likewise. (function_expander::add_input_operand): Likewise. (function_expander::add_integer_operand): Likewise. (function_expander::generate_insn): Likewise. (function_expander::use_exact_insn): Likewise. (function_expander::use_unpred_insn): Likewise. (function_expander::use_pred_x_insn): Likewise. (function_expander::use_cond_insn): Likewise. (function_expander::map_to_rtx_codes): Likewise. (function_expander::expand): Likewise. (resolve_overloaded_builtin): Likewise. (check_builtin_call): Likewise. (gimple_fold_builtin): Likewise. (expand_builtin): Likewise. (gt_ggc_mx): Likewise. (gt_pch_nx): Likewise. (gt_pch_nx): Likewise. * config/arm/arm-mve-builtins.def(s8): Define new type suffix. (s16): Likewise. (s32): Likewise. (s64): Likewise. (u8): Likewise. (u16): Likewise. (u32): Likewise. (u64): Likewise. (f16): Likewise. (f32): Likewise. (n): New mode. (offset): New mode. * config/arm/arm-mve-builtins.h (MAX_TUPLE_SIZE): New constant. (CP_READ_FPCR): Likewise. (CP_RAISE_FP_EXCEPTIONS): Likewise. (CP_READ_MEMORY): Likewise. (CP_WRITE_MEMORY): Likewise. (enum units_index): New enum. (enum predication_index): New. (enum type_class_index): New. (enum mode_suffix_index): New enum. (enum type_suffix_index): New. (struct mode_suffix_info): New struct. (struct type_suffix_info): New. (struct function_group_info): Likewise. (class function_instance): Likewise. (class registered_function): Likewise. (class function_builder): Likewise. (class function_call_info): Likewise. (class function_resolver): Likewise. (class function_checker): Likewise. (class gimple_folder): Likewise. (class function_expander): Likewise. (get_mve_pred16_t): Likewise. (find_mode_suffix): New function. (class function_base): Likewise. (class function_shape): Likewise. (function_instance::operator==): New function. (function_instance::operator!=): Likewise. (function_instance::vectors_per_tuple): Likewise. (function_instance::mode_suffix): Likewise. (function_instance::type_suffix): Likewise. (function_instance::scalar_type): Likewise. (function_instance::vector_type): Likewise. (function_instance::tuple_type): Likewise. (function_instance::vector_mode): Likewise. (function_call_info::function_returns_void_p): Likewise. (function_base::call_properties): Likewise. * config/arm/arm-protos.h (enum arm_builtin_class): Add ARM_BUILTIN_MVE. (handle_arm_mve_h): New. (resolve_overloaded_builtin): New. (check_builtin_call): New. (gimple_fold_builtin): New. (expand_builtin): New. * config/arm/arm.cc (TARGET_GIMPLE_FOLD_BUILTIN): Define as arm_gimple_fold_builtin. (arm_gimple_fold_builtin): New function. * config/arm/arm_mve.h: Use new arm_mve.h pragma. * config/arm/predicates.md (arm_any_register_operand): New predicate. * config/arm/t-arm: (arm-mve-builtins.o): Add includes. (arm-mve-builtins-shapes.o): New target. (arm-mve-builtins-base.o): New target. * config/arm/arm-mve-builtins-base.cc: New file. * config/arm/arm-mve-builtins-base.def: New file. * config/arm/arm-mve-builtins-base.h: New file. * config/arm/arm-mve-builtins-functions.h: New file. * config/arm/arm-mve-builtins-shapes.cc: New file. * config/arm/arm-mve-builtins-shapes.h: New file. Co-authored-by: Christophe Lyon <christophe.lyon@arm.com
Diffstat (limited to 'gcc/gimple-range.cc')
0 files changed, 0 insertions, 0 deletions