From: Marek Olšák Date: Tue, 7 Nov 2017 02:43:38 +0000 (+0100) Subject: radeonsi: use ac_get_llvm_processor_name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81f81fdb54001903078af7df6c9e8f2d4ff46294;p=mesa.git radeonsi: use ac_get_llvm_processor_name Reviewed-by: Nicolai Hähnle --- diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c index 675926ea679..fb2bc118743 100644 --- a/src/amd/common/ac_llvm_util.c +++ b/src/amd/common/ac_llvm_util.c @@ -74,7 +74,7 @@ LLVMTargetRef ac_get_llvm_target(const char *triple) return target; } -static const char *ac_get_llvm_processor_name(enum radeon_family family) +const char *ac_get_llvm_processor_name(enum radeon_family family) { switch (family) { case CHIP_TAHITI: diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h index cc4fe3bd632..d4b3915ffa9 100644 --- a/src/amd/common/ac_llvm_util.h +++ b/src/amd/common/ac_llvm_util.h @@ -58,6 +58,8 @@ enum ac_target_machine_options { AC_TM_SUPPORTS_SPILL = (1 << 0), AC_TM_SISCHED = (1 << 1), }; + +const char *ac_get_llvm_processor_name(enum radeon_family family); LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options); LLVMTargetRef ac_get_llvm_target(const char *triple); diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c index 478f626b299..aa72187c570 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.c +++ b/src/gallium/drivers/radeon/r600_pipe_common.c @@ -33,6 +33,7 @@ #include "vl/vl_decoder.h" #include "vl/vl_video_buffer.h" #include "radeon/radeon_video.h" +#include "amd/common/ac_llvm_util.h" #include "amd/common/sid.h" #include #include @@ -996,40 +997,6 @@ static int r600_get_video_param(struct pipe_screen *screen, } } -const char *si_get_llvm_processor_name(enum radeon_family family) -{ - switch (family) { - case CHIP_TAHITI: return "tahiti"; - case CHIP_PITCAIRN: return "pitcairn"; - case CHIP_VERDE: return "verde"; - case CHIP_OLAND: return "oland"; - case CHIP_HAINAN: return "hainan"; - case CHIP_BONAIRE: return "bonaire"; - case CHIP_KABINI: return "kabini"; - case CHIP_KAVERI: return "kaveri"; - case CHIP_HAWAII: return "hawaii"; - case CHIP_MULLINS: - return "mullins"; - case CHIP_TONGA: return "tonga"; - case CHIP_ICELAND: return "iceland"; - case CHIP_CARRIZO: return "carrizo"; - case CHIP_FIJI: - return "fiji"; - case CHIP_STONEY: - return "stoney"; - case CHIP_POLARIS10: - return "polaris10"; - case CHIP_POLARIS11: - case CHIP_POLARIS12: /* same as polaris11 */ - return "polaris11"; - case CHIP_VEGA10: - case CHIP_RAVEN: - return "gfx900"; - default: - return ""; - } -} - static unsigned get_max_threads_per_block(struct r600_common_screen *screen, enum pipe_shader_ir ir_type) { @@ -1064,7 +1031,7 @@ static int r600_get_compute_param(struct pipe_screen *screen, else triple = "amdgcn-mesa-mesa3d"; - gpu = si_get_llvm_processor_name(rscreen->family); + gpu = ac_get_llvm_processor_name(rscreen->family); if (ret) { sprintf(ret, "%s-%s", gpu, triple); } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index a7fec373fcf..f803ee46339 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -717,7 +717,6 @@ void si_screen_clear_buffer(struct r600_common_screen *rscreen, struct pipe_reso uint64_t offset, uint64_t size, unsigned value); struct pipe_resource *si_resource_create_common(struct pipe_screen *screen, const struct pipe_resource *templ); -const char *si_get_llvm_processor_name(enum radeon_family family); void si_need_dma_space(struct r600_common_context *ctx, unsigned num_dw, struct r600_resource *dst, struct r600_resource *src); void si_save_cs(struct radeon_winsys *ws, struct radeon_winsys_cs *cs, diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 649a72e0fcf..e96380ce40a 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -155,7 +155,7 @@ si_create_llvm_target_machine(struct si_screen *sscreen) sscreen->b.debug_flags & DBG(SI_SCHED) ? ",+si-scheduler" : ""); return LLVMCreateTargetMachine(ac_get_llvm_target(triple), triple, - si_get_llvm_processor_name(sscreen->b.family), + ac_get_llvm_processor_name(sscreen->b.family), features, LLVMCodeGenLevelDefault, LLVMRelocDefault, @@ -907,7 +907,7 @@ static void si_handle_env_var_force_family(struct si_screen *sscreen) return; for (i = CHIP_TAHITI; i < CHIP_LAST; i++) { - if (!strcmp(family, si_get_llvm_processor_name(i))) { + if (!strcmp(family, ac_get_llvm_processor_name(i))) { /* Override family and chip_class. */ sscreen->b.family = sscreen->b.info.family = i;