mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
radeonsi: move LLVM ALU codegen into radeonsi
Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
This commit is contained in:
parent
41754f743f
commit
4e5d076fcf
6 changed files with 1056 additions and 992 deletions
|
|
@ -110,11 +110,6 @@ LLVMValueRef radeon_llvm_bound_index(struct radeon_llvm_context *ctx,
|
|||
LLVMValueRef index,
|
||||
unsigned num);
|
||||
|
||||
void radeon_llvm_emit_prepare_cube_coords(struct lp_build_tgsi_context *bld_base,
|
||||
struct lp_build_emit_data *emit_data,
|
||||
LLVMValueRef *coords_arg,
|
||||
LLVMValueRef *derivs_arg);
|
||||
|
||||
void radeon_llvm_context_init(struct radeon_llvm_context *ctx,
|
||||
const char *triple,
|
||||
const struct tgsi_shader_info *info,
|
||||
|
|
@ -131,10 +126,6 @@ unsigned radeon_llvm_reg_index_soa(unsigned index, unsigned chan);
|
|||
void radeon_llvm_finalize_module(struct radeon_llvm_context *ctx,
|
||||
bool run_verifier);
|
||||
|
||||
void build_tgsi_intrinsic_nomem(const struct lp_build_tgsi_action *action,
|
||||
struct lp_build_tgsi_context *bld_base,
|
||||
struct lp_build_emit_data *emit_data);
|
||||
|
||||
LLVMValueRef radeon_llvm_emit_fetch_64bit(struct lp_build_tgsi_context *bld_base,
|
||||
enum tgsi_opcode_type type,
|
||||
LLVMValueRef ptr,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -15,6 +15,8 @@ C_SOURCES := \
|
|||
si_public.h \
|
||||
si_shader.c \
|
||||
si_shader.h \
|
||||
si_shader_internal.h \
|
||||
si_shader_tgsi_alu.c \
|
||||
si_state.c \
|
||||
si_state_draw.c \
|
||||
si_state_shaders.c \
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "tgsi/tgsi_util.h"
|
||||
#include "tgsi/tgsi_dump.h"
|
||||
|
||||
#include "si_shader_internal.h"
|
||||
#include "si_pipe.h"
|
||||
#include "sid.h"
|
||||
|
||||
|
|
@ -4659,7 +4660,7 @@ static void tex_fetch_args(
|
|||
target == TGSI_TEXTURE_CUBE_ARRAY ||
|
||||
target == TGSI_TEXTURE_SHADOWCUBE ||
|
||||
target == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
|
||||
radeon_llvm_emit_prepare_cube_coords(bld_base, emit_data, coords, derivs);
|
||||
si_prepare_cube_coords(bld_base, emit_data, coords, derivs);
|
||||
|
||||
if (opcode == TGSI_OPCODE_TXD)
|
||||
for (int i = 0; i < num_deriv_channels * 2; i++)
|
||||
|
|
@ -6510,6 +6511,7 @@ static void si_init_shader_ctx(struct si_shader_context *ctx,
|
|||
&ctx->radeon_bld, "amdgcn--",
|
||||
(shader && shader->selector) ? &shader->selector->info : NULL,
|
||||
(shader && shader->selector) ? shader->selector->tokens : NULL);
|
||||
si_shader_context_init_alu(&ctx->radeon_bld.soa.bld_base);
|
||||
ctx->tm = tm;
|
||||
ctx->screen = sscreen;
|
||||
if (shader && shader->selector)
|
||||
|
|
@ -6593,11 +6595,6 @@ static void si_init_shader_ctx(struct si_shader_context *ctx,
|
|||
bld_base->op_actions[TGSI_OPCODE_EMIT].emit = si_llvm_emit_vertex;
|
||||
bld_base->op_actions[TGSI_OPCODE_ENDPRIM].emit = si_llvm_emit_primitive;
|
||||
bld_base->op_actions[TGSI_OPCODE_BARRIER].emit = si_llvm_emit_barrier;
|
||||
|
||||
bld_base->op_actions[TGSI_OPCODE_MAX].emit = build_tgsi_intrinsic_nomem;
|
||||
bld_base->op_actions[TGSI_OPCODE_MAX].intr_name = "llvm.maxnum.f32";
|
||||
bld_base->op_actions[TGSI_OPCODE_MIN].emit = build_tgsi_intrinsic_nomem;
|
||||
bld_base->op_actions[TGSI_OPCODE_MIN].intr_name = "llvm.minnum.f32";
|
||||
}
|
||||
|
||||
int si_compile_tgsi_shader(struct si_screen *sscreen,
|
||||
|
|
|
|||
37
src/gallium/drivers/radeonsi/si_shader_internal.h
Normal file
37
src/gallium/drivers/radeonsi/si_shader_internal.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright 2016 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
* license, and/or sell copies of the Software, and to permit persons to whom
|
||||
* the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef SI_SHADER_PRIVATE_H
|
||||
#define SI_SHADER_PRIVATE_H
|
||||
|
||||
#include "si_shader.h"
|
||||
#include "gallivm/lp_bld_init.h"
|
||||
#include "gallivm/lp_bld_tgsi.h"
|
||||
|
||||
void si_shader_context_init_alu(struct lp_build_tgsi_context *bld_base);
|
||||
void si_prepare_cube_coords(struct lp_build_tgsi_context *bld_base,
|
||||
struct lp_build_emit_data *emit_data,
|
||||
LLVMValueRef *coords_arg,
|
||||
LLVMValueRef *derivs_arg);
|
||||
|
||||
#endif
|
||||
1012
src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
Normal file
1012
src/gallium/drivers/radeonsi/si_shader_tgsi_alu.c
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue