rs6000: More factoring of overload processing
commitb28b92bc008776c8b517841f99ba6a31bf7751d2
authorBill Schmidt <wschmidt@linux.ibm.com>
Thu, 3 Feb 2022 02:55:36 +0000 (2 20:55 -0600)
committerBill Schmidt <wschmidt@linux.ibm.com>
Fri, 4 Feb 2022 19:43:23 +0000 (4 13:43 -0600)
tree13c9053575d9ca8a283d68f737a2e575a16c6b4a
parent8cb748a31cd8c7ac9c88b6abc38ce077dd462a7a
rs6000: More factoring of overload processing

This patch continues the refactoring started with r12-6014.  I had previously
noted that the resolve_vec* routines can be further simplified by processing
the argument list earlier, so that all routines can use the arrays of arguments
and types.  I found that this was useful for some of the routines, but not for
all of them.

For several of the special-cased overloads, we don't specify all of the
possible type combinations in rs6000-overload.def, because the types don't
matter for the expansion we do.  For these, we can't use generic error message
handling when the number of arguments is incorrect, because the result is
misleading error messages that indicate argument types are wrong.

So this patch goes halfway and improves the factoring on the remaining special
cases, but leaves vec_splats, vec_promote, vec_extract, vec_insert, and
vec_step alone.

2022-02-02  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/rs6000-c.cc (resolve_vec_mul): Accept args and types
parameters instead of arglist and nargs.  Simplify accordingly.  Remove
unnecessary test for argument count mismatch.
(resolve_vec_cmpne): Likewise.
(resolve_vec_adde_sube): Likewise.
(resolve_vec_addec_subec): Likewise.
(altivec_resolve_overloaded_builtin): Move overload special handling
after the gathering of arguments into args[] and types[] and the test
for correct number of arguments.  Don't perform the test for correct
number of arguments for certain special cases.  Call the other special
cases with args and types instead of arglist and nargs.
gcc/config/rs6000/rs6000-c.cc