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_resolver_func: 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 resolver function. make_dispatcher_decl: 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. is_function_default_version: Returns true if decl is multi-versioned and DECL is the default function, that is it is not tagged with target specific optimization. attr_strcmp: Comparator function to be used in qsort routine to sort attribute specification strings to "target". sorted_attr_string: 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 "_". <xxx>_function_versions: 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: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797