glsl: Retire unused modes for lower_64bit_integer_instructions.
Unused since 424ac809bf
("i965: Do int64 lowering in NIR")
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14249>
This commit is contained in:
@@ -4441,10 +4441,6 @@ builtin_builder::create_builtins()
|
||||
generate_ir::imod64(mem_ctx, integer_functions_supported),
|
||||
NULL);
|
||||
|
||||
add_function("__builtin_sign64",
|
||||
generate_ir::sign64(mem_ctx, integer_functions_supported),
|
||||
NULL);
|
||||
|
||||
add_function("__builtin_udiv64",
|
||||
generate_ir::udiv64(mem_ctx, integer_functions_supported),
|
||||
NULL);
|
||||
@@ -4453,10 +4449,6 @@ builtin_builder::create_builtins()
|
||||
generate_ir::umod64(mem_ctx, integer_functions_supported),
|
||||
NULL);
|
||||
|
||||
add_function("__builtin_umul64",
|
||||
generate_ir::umul64(mem_ctx, integer_functions_supported),
|
||||
NULL);
|
||||
|
||||
add_function("countLeadingZeros",
|
||||
_countLeadingZeros(shader_integer_functions2,
|
||||
glsl_type::uint_type),
|
||||
|
@@ -68,12 +68,6 @@ umod64(void *mem_ctx, builtin_available_predicate avail);
|
||||
ir_function_signature *
|
||||
imod64(void *mem_ctx, builtin_available_predicate avail);
|
||||
|
||||
ir_function_signature *
|
||||
umul64(void *mem_ctx, builtin_available_predicate avail);
|
||||
|
||||
ir_function_signature *
|
||||
sign64(void *mem_ctx, builtin_available_predicate avail);
|
||||
|
||||
ir_function_signature *
|
||||
udivmod64(void *mem_ctx, builtin_available_predicate avail);
|
||||
|
||||
|
@@ -1,60 +1,4 @@
|
||||
ir_function_signature *
|
||||
umul64(void *mem_ctx, builtin_available_predicate avail)
|
||||
{
|
||||
ir_function_signature *const sig =
|
||||
new(mem_ctx) ir_function_signature(glsl_type::uvec2_type, avail);
|
||||
ir_factory body(&sig->body, mem_ctx);
|
||||
sig->is_defined = true;
|
||||
|
||||
exec_list sig_parameters;
|
||||
|
||||
ir_variable *const r0001 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "a", ir_var_function_in);
|
||||
sig_parameters.push_tail(r0001);
|
||||
ir_variable *const r0002 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "b", ir_var_function_in);
|
||||
sig_parameters.push_tail(r0002);
|
||||
ir_variable *const r0003 = new(mem_ctx) ir_variable(glsl_type::uvec2_type, "result", ir_var_auto);
|
||||
body.emit(r0003);
|
||||
body.emit(assign(r0003, imul_high(swizzle_x(r0001), swizzle_x(r0002)), 0x02));
|
||||
|
||||
body.emit(assign(r0003, mul(swizzle_x(r0001), swizzle_x(r0002)), 0x01));
|
||||
|
||||
ir_expression *const r0004 = mul(swizzle_x(r0001), swizzle_y(r0002));
|
||||
ir_expression *const r0005 = mul(swizzle_y(r0001), swizzle_x(r0002));
|
||||
ir_expression *const r0006 = add(r0004, r0005);
|
||||
body.emit(assign(r0003, add(swizzle_y(r0003), r0006), 0x02));
|
||||
|
||||
body.emit(ret(r0003));
|
||||
|
||||
sig->replace_parameters(&sig_parameters);
|
||||
return sig;
|
||||
}
|
||||
ir_function_signature *
|
||||
sign64(void *mem_ctx, builtin_available_predicate avail)
|
||||
{
|
||||
ir_function_signature *const sig =
|
||||
new(mem_ctx) ir_function_signature(glsl_type::ivec2_type, avail);
|
||||
ir_factory body(&sig->body, mem_ctx);
|
||||
sig->is_defined = true;
|
||||
|
||||
exec_list sig_parameters;
|
||||
|
||||
ir_variable *const r0007 = new(mem_ctx) ir_variable(glsl_type::ivec2_type, "a", ir_var_function_in);
|
||||
sig_parameters.push_tail(r0007);
|
||||
ir_variable *const r0008 = new(mem_ctx) ir_variable(glsl_type::ivec2_type, "result", ir_var_auto);
|
||||
body.emit(r0008);
|
||||
body.emit(assign(r0008, rshift(swizzle_y(r0007), body.constant(int(31))), 0x02));
|
||||
|
||||
ir_expression *const r0009 = bit_or(swizzle_x(r0007), swizzle_y(r0007));
|
||||
ir_expression *const r000A = nequal(r0009, body.constant(int(0)));
|
||||
ir_expression *const r000B = expr(ir_unop_b2i, r000A);
|
||||
body.emit(assign(r0008, bit_or(swizzle_y(r0008), r000B), 0x01));
|
||||
|
||||
body.emit(ret(r0008));
|
||||
|
||||
sig->replace_parameters(&sig_parameters);
|
||||
return sig;
|
||||
}
|
||||
ir_function_signature *
|
||||
udivmod64(void *mem_ctx, builtin_available_predicate avail)
|
||||
{
|
||||
ir_function_signature *const sig =
|
||||
|
@@ -2489,8 +2489,6 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio
|
||||
* those functions so that they can be tested.
|
||||
*/
|
||||
if (parser->extension_list->MESA_shader_integer_functions) {
|
||||
add_builtin_define(parser, "__have_builtin_builtin_sign64", 1);
|
||||
add_builtin_define(parser, "__have_builtin_builtin_umul64", 1);
|
||||
add_builtin_define(parser, "__have_builtin_builtin_udiv64", 1);
|
||||
add_builtin_define(parser, "__have_builtin_builtin_umod64", 1);
|
||||
add_builtin_define(parser, "__have_builtin_builtin_idiv64", 1);
|
||||
|
@@ -8,28 +8,6 @@
|
||||
#extension GL_ARB_gpu_shader_int64: require
|
||||
#extension GL_ARB_shading_language_420pack: require
|
||||
|
||||
uvec2
|
||||
umul64(uvec2 a, uvec2 b)
|
||||
{
|
||||
uvec2 result;
|
||||
|
||||
umulExtended(a.x, b.x, result.y, result.x);
|
||||
result.y += a.x * b.y + a.y * b.x;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
ivec2
|
||||
sign64(ivec2 a)
|
||||
{
|
||||
ivec2 result;
|
||||
|
||||
result.y = a.y >> 31;
|
||||
result.x = result.y | int((a.x | a.y) != 0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
uvec4
|
||||
udivmod64(uvec2 n, uvec2 d)
|
||||
{
|
||||
|
@@ -59,11 +59,9 @@ struct gl_shader_program;
|
||||
#define SQRT_TO_ABS_SQRT 0x200000
|
||||
#define MUL64_TO_MUL_AND_MUL_HIGH 0x400000
|
||||
|
||||
/* Opertaions for lower_64bit_integer_instructions() */
|
||||
#define MUL64 (1U << 0)
|
||||
#define SIGN64 (1U << 1)
|
||||
#define DIV64 (1U << 2)
|
||||
#define MOD64 (1U << 3)
|
||||
/* Operations for lower_64bit_integer_instructions() */
|
||||
#define DIV64 (1U << 0)
|
||||
#define MOD64 (1U << 1)
|
||||
|
||||
/**
|
||||
* \see class lower_packing_builtins_visitor
|
||||
|
@@ -29,11 +29,11 @@
|
||||
* called __builtin_foo with the same number of parameters that takes uvec2
|
||||
* sources and produces uvec2 results. An operation like
|
||||
*
|
||||
* uint64_t(x) * uint64_t(y)
|
||||
* uint64_t(x) / uint64_t(y)
|
||||
*
|
||||
* becomes
|
||||
*
|
||||
* packUint2x32(__builtin_umul64(unpackUint2x32(x), unpackUint2x32(y)));
|
||||
* packUint2x32(__builtin_udiv64(unpackUint2x32(x), unpackUint2x32(y)));
|
||||
*/
|
||||
|
||||
#include "main/macros.h"
|
||||
@@ -353,12 +353,6 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
|
||||
assert(ir != NULL);
|
||||
|
||||
switch (ir->operation) {
|
||||
case ir_unop_sign:
|
||||
if (lowering(SIGN64)) {
|
||||
*rvalue = handle_op(ir, "__builtin_sign64", generate_ir::sign64);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_div:
|
||||
if (lowering(DIV64)) {
|
||||
if (ir->type->base_type == GLSL_TYPE_UINT64) {
|
||||
@@ -379,12 +373,6 @@ lower_64bit_visitor::handle_rvalue(ir_rvalue **rvalue)
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_binop_mul:
|
||||
if (lowering(MUL64)) {
|
||||
*rvalue = handle_op(ir, "__builtin_umul64", generate_ir::umul64);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user