Skip to content
Snippets Groups Projects
Commit 917d03e4 authored by Yangyu Chen's avatar Yangyu Chen Committed by Kito Cheng
Browse files

RISC-V: Implement TARGET_GENERATE_VERSION_DISPATCHER_BODY and...

RISC-V: Implement TARGET_GENERATE_VERSION_DISPATCHER_BODY and TARGET_GET_FUNCTION_VERSIONS_DISPATCHER

This patch implements the TARGET_GENERATE_VERSION_DISPATCHER_BODY and
TARGET_GET_FUNCTION_VERSIONS_DISPATCHER for RISC-V. This is used to
generate the dispatcher function and get the dispatcher function for
function multiversioning.

This patch copies many codes from commit 0cfde688 ("[aarch64]
Add function multiversioning support") and modifies them to fit the
RISC-V port. A key difference is the data structure of feature bits in
RISC-V C-API is a array of unsigned long long, while in AArch64 is not
a array. So we need to generate the array reference for each feature
bits element in the dispatcher function.

Signed-off-by: default avatarYangyu Chen <cyy@cyyself.name>

gcc/ChangeLog:

	* config/riscv/riscv.cc (add_condition_to_bb): New function.
	(dispatch_function_versions): New function.
	(get_suffixed_assembler_name): New function.
	(make_resolver_func): New function.
	(riscv_generate_version_dispatcher_body): New function.
	(riscv_get_function_versions_dispatcher): New function.
	(TARGET_GENERATE_VERSION_DISPATCHER_BODY): Implement it.
	(TARGET_GET_FUNCTION_VERSIONS_DISPATCHER): Implement it.
parent 0c77c4b0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment