diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 28b9a6eb8ea..46301741b55 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3148,9 +3148,6 @@ typedef struct nir_shader_compiler_options { /* lower b/fall_equalN/b/fany_nequalN (ex:fany_nequal4 to sne+fdot4+fsat) */ bool lower_vector_cmp; - /** enables rules to lower idiv by power-of-two: */ - bool lower_idiv; - /** enable rules to avoid bit ops */ bool lower_bitops; diff --git a/src/compiler/nir/nir_opt_algebraic.py b/src/compiler/nir/nir_opt_algebraic.py index be836f954ed..2bb9b41fb15 100644 --- a/src/compiler/nir/nir_opt_algebraic.py +++ b/src/compiler/nir/nir_opt_algebraic.py @@ -103,8 +103,8 @@ optimizations = [ (('umod', a, 1), 0), (('imod', a, 1), 0), (('udiv', a, '#b(is_pos_power_of_two)'), ('ushr', a, ('find_lsb', b)), '!options->lower_bitops'), - (('idiv', a, '#b(is_pos_power_of_two)'), ('imul', ('isign', a), ('ushr', ('iabs', a), ('find_lsb', b))), 'options->lower_idiv'), - (('idiv', a, '#b(is_neg_power_of_two)'), ('ineg', ('imul', ('isign', a), ('ushr', ('iabs', a), ('find_lsb', ('iabs', b))))), 'options->lower_idiv'), + (('idiv', a, '#b(is_pos_power_of_two)'), ('imul', ('isign', a), ('ushr', ('iabs', a), ('find_lsb', b))), '!options->lower_bitops'), + (('idiv', a, '#b(is_neg_power_of_two)'), ('ineg', ('imul', ('isign', a), ('ushr', ('iabs', a), ('find_lsb', ('iabs', b))))), '!options->lower_bitops'), (('umod', a, '#b(is_pos_power_of_two)'), ('iand', a, ('isub', b, 1))), (('~fneg', ('fneg', a)), a), diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp index 64453edf19b..9141b149581 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp @@ -3236,7 +3236,6 @@ nvir_nir_shader_compiler_options(int chipset) op.lower_sub = true; op.lower_scmp = true; // TODO: not implemented yet op.lower_vector_cmp = false; - op.lower_idiv = true; op.lower_bitops = false; op.lower_isign = (chipset >= NVISA_GV100_CHIPSET); op.lower_fsign = (chipset >= NVISA_GV100_CHIPSET); diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index 9dc00cf1aef..5380fbb7056 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -1187,7 +1187,6 @@ const struct nir_shader_compiler_options r600_nir_fs_options = { .lower_flrp64 = true, .lower_fpow = true, .lower_fdiv = true, - .lower_idiv = true, .lower_isign = true, .lower_fsign = true, .lower_fmod = true, @@ -1212,7 +1211,6 @@ const struct nir_shader_compiler_options r600_nir_options = { .lower_flrp64 = true, .lower_fpow = true, .lower_fdiv = true, - .lower_idiv = true, .lower_fmod = true, .lower_doubles_options = nir_lower_fp64_full_software, .lower_int64_options = 0, diff --git a/src/panfrost/bifrost/bifrost_compile.h b/src/panfrost/bifrost/bifrost_compile.h index 15b90788133..b4182f28860 100644 --- a/src/panfrost/bifrost/bifrost_compile.h +++ b/src/panfrost/bifrost/bifrost_compile.h @@ -38,7 +38,6 @@ static const nir_shader_compiler_options bifrost_nir_options = { .lower_ffract = true, .lower_fmod = true, .lower_fdiv = true, - .lower_idiv = true, .lower_isign = true, .lower_fpow = true, .lower_find_lsb = true, diff --git a/src/panfrost/midgard/midgard_compile.h b/src/panfrost/midgard/midgard_compile.h index b4c5a07056f..ffdfb90598c 100644 --- a/src/panfrost/midgard/midgard_compile.h +++ b/src/panfrost/midgard/midgard_compile.h @@ -46,7 +46,6 @@ static const nir_shader_compiler_options midgard_nir_options = { .lower_ffract = true, .lower_fmod = true, .lower_fdiv = true, - .lower_idiv = true, .lower_isign = true, .lower_fpow = true, .lower_find_lsb = true,