Skip to content
Snippets Groups Projects
Commit 645b471d authored by Marek Olšák's avatar Marek Olšák
Browse files

radeonsi: use minnum and maxnum LLVM intrinsics for MIN and MAX opcodes


So far it has been compiled into pretty ugly code (8 instructions or so
for either opcode).

Reviewed-by: default avatarTom Stellard <thomas.stellard@amd.com>
parent 21577571
No related merge requests found
......@@ -2737,6 +2737,13 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader)
bld_base->op_actions[TGSI_OPCODE_EMIT].emit = si_llvm_emit_vertex;
bld_base->op_actions[TGSI_OPCODE_ENDPRIM].emit = si_llvm_emit_primitive;
if (HAVE_LLVM >= 0x0306) {
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";
}
si_shader_ctx.radeon_bld.load_system_value = declare_system_value;
si_shader_ctx.tokens = sel->tokens;
tgsi_parse_init(&si_shader_ctx.parse, si_shader_ctx.tokens);
......
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