rs6000: Handle overloads during program parsing
Although this patch looks quite large, the changes are fairly minimal. Most of it is duplicating the large function that does the overload resolution using the automatically generated data structures instead of the old hand-generated ones. This doesn't make the patch terribly easy to review, unfortunately. Just be aware that generally we aren't changing the logic and functionality of overload handling. 2021-09-16 Bill Schmidt <wschmidt@linux.ibm.com> gcc/ * config/rs6000/rs6000-c.c (rs6000-builtins.h): New include. (altivec_resolve_new_overloaded_builtin): New forward decl. (rs6000_new_builtin_type_compatible): New function. (altivec_resolve_overloaded_builtin): Call altivec_resolve_new_overloaded_builtin. (altivec_build_new_resolved_builtin): New function. (altivec_resolve_new_overloaded_builtin): Likewise. * config/rs6000/rs6000-call.c (rs6000_new_builtin_is_supported): Likewise. * config/rs6000/rs6000-gen-builtins.c (write_decls): Remove _p from name of rs6000_new_builtin_is_supported.
This commit is contained in:
parent
2e2e65a46d
commit
93b5a66710
3 changed files with 1132 additions and 1 deletions
File diff suppressed because it is too large
Load diff
|
@ -12971,6 +12971,59 @@ rs6000_gimple_fold_builtin (gimple_stmt_iterator *gsi)
|
|||
return false;
|
||||
}
|
||||
|
||||
/* Check whether a builtin function is supported in this target
|
||||
configuration. */
|
||||
bool
|
||||
rs6000_new_builtin_is_supported (enum rs6000_gen_builtins fncode)
|
||||
{
|
||||
switch (rs6000_builtin_info_x[(size_t) fncode].enable)
|
||||
{
|
||||
case ENB_ALWAYS:
|
||||
return true;
|
||||
case ENB_P5:
|
||||
return TARGET_POPCNTB;
|
||||
case ENB_P6:
|
||||
return TARGET_CMPB;
|
||||
case ENB_P7:
|
||||
return TARGET_POPCNTD;
|
||||
case ENB_P7_64:
|
||||
return TARGET_POPCNTD && TARGET_POWERPC64;
|
||||
case ENB_P8:
|
||||
return TARGET_DIRECT_MOVE;
|
||||
case ENB_P8V:
|
||||
return TARGET_P8_VECTOR;
|
||||
case ENB_P9:
|
||||
return TARGET_MODULO;
|
||||
case ENB_P9_64:
|
||||
return TARGET_MODULO && TARGET_POWERPC64;
|
||||
case ENB_P9V:
|
||||
return TARGET_P9_VECTOR;
|
||||
case ENB_P10:
|
||||
return TARGET_POWER10;
|
||||
case ENB_P10_64:
|
||||
return TARGET_POWER10 && TARGET_POWERPC64;
|
||||
case ENB_ALTIVEC:
|
||||
return TARGET_ALTIVEC;
|
||||
case ENB_VSX:
|
||||
return TARGET_VSX;
|
||||
case ENB_CELL:
|
||||
return TARGET_ALTIVEC && rs6000_cpu == PROCESSOR_CELL;
|
||||
case ENB_IEEE128_HW:
|
||||
return TARGET_FLOAT128_HW;
|
||||
case ENB_DFP:
|
||||
return TARGET_DFP;
|
||||
case ENB_CRYPTO:
|
||||
return TARGET_CRYPTO;
|
||||
case ENB_HTM:
|
||||
return TARGET_HTM;
|
||||
case ENB_MMA:
|
||||
return TARGET_MMA;
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
gcc_unreachable ();
|
||||
}
|
||||
|
||||
/* Expand an expression EXP that calls a built-in function,
|
||||
with result going to TARGET if that's convenient
|
||||
(and in mode MODE if that's convenient).
|
||||
|
|
|
@ -2314,7 +2314,7 @@ write_decls (void)
|
|||
|
||||
fprintf (header_file, "extern void rs6000_init_generated_builtins ();\n\n");
|
||||
fprintf (header_file,
|
||||
"extern bool rs6000_new_builtin_is_supported_p "
|
||||
"extern bool rs6000_new_builtin_is_supported "
|
||||
"(rs6000_gen_builtins);\n");
|
||||
fprintf (header_file,
|
||||
"extern tree rs6000_builtin_decl (unsigned, "
|
||||
|
|
Loading…
Add table
Reference in a new issue