This is the mail archive of the
mailing list for the GCC project.
GCC target_clone support
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: GCC mailing list <gcc at gcc dot gnu dot org>, Segher Boessenkool <segher at kernel dot crashing dot org>, David Edelsohn <dje dot gcc at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, Uros Bizjak <ubizjak at gmail dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Richard Biener <rguenther at suse dot de>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Earnshaw <richard dot earnshaw at arm dot com>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Nick Clifton <nickc at redhat dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Bernd Schmidt <bschmidt at redhat dot com>, Jeff Law <law at redhat dot com>, Hartmut Penner <hepenner at us dot ibm dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, Andreas Krebbel <Andreas dot Krebbel at de dot ibm dot com>, Evgeny Stupachenko <evstupac at gmail dot com>, Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Date: Fri, 5 May 2017 14:18:59 -0400
- Subject: GCC target_clone support
- Authentication-results: sourceware.org; auth=none
I'm in the middle of adding support for the target_clone attribute to the
PowerPC. At the moment, the x86_64/i386 port is the only port that supports
target_clone. I added the arm/s390 port maintainers to this query, because
those ports might also consider supporting target_clones in the future.
In doing the work, I noticed that some of the functions called by the target
hooks that were fairly generic, and we might want to move these functions into
common code? Would people object if I put out a patch to move these functions
to common code?
I also have a question on the functionality of target_clone that I will address
in a separate message.
So far, the list of generic code that could be moved to common code to allow
other ports to add target_clone support include:
Make the resolver function decl to dispatch the versions of a
multi-versioned function, DEFAULT_DECL. Create an empty basic block in
the resolver and store the pointer in EMPTY_BB. Return the decl of the
Make a dispatcher declaration for the multi-versioned function DECL.
Calls to DECL function will be replaced with calls to the dispatcher by
the front-end. Return the decl created.
Returns true if decl is multi-versioned and DECL is the default
function, that is it is not tagged with target specific optimization.
Comparator function to be used in qsort routine to sort attribute
specification strings to "target".
ARGLIST is the argument to target attribute. This function tokenizes
the comma separated arguments, sorts them and returns a string which is
a unique identifier for the comma separated arguments. It also
replaces non-identifier characters "=,-" with "_".
This function returns true if FN1 and FN2 are versions of the same
function, that is, the target strings of the function decls are
different. This assumes that FN1 and FN2 have the same signature.
This is the TARGET_OPTION_FUNCTION_VERSIONS target hook, and it is the
same between the x86 and ppc.
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: firstname.lastname@example.org, phone: +1 (978) 899-4797