nouveau: set lower_sub = true
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 27 Sep 2019 10:12:25 +0000 (12:12 +0200)
committerDaniel Schürmann <daniel@schuermann.dev>
Mon, 30 Sep 2019 09:44:10 +0000 (09:44 +0000)
Subtractions are already implemented as additions anyway.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c

index 95b60d2c7d0d95ccadbb47a1ff32ac2b8410bef3..bcabeacbbadd1d7bf5446b65ec27604391b5d2d7 100644 (file)
@@ -451,9 +451,6 @@ Converter::getOperation(nir_op op)
       return OP_SIN;
    case nir_op_fsqrt:
       return OP_SQRT;
-   case nir_op_fsub:
-   case nir_op_isub:
-      return OP_SUB;
    case nir_op_ftrunc:
       return OP_TRUNC;
    case nir_op_ixor:
@@ -2817,8 +2814,6 @@ Converter::visit(nir_alu_instr *insn)
    case nir_op_ushr:
    case nir_op_fsin:
    case nir_op_fsqrt:
-   case nir_op_fsub:
-   case nir_op_isub:
    case nir_op_ftrunc:
    case nir_op_ishl:
    case nir_op_ixor: {
index 997193aac4a5363f24d7a2c9feda425cb06625d5..557139494d4e4b9fb534a26f86a7dcb0f4f696c0 100644 (file)
@@ -901,6 +901,7 @@ static const nir_shader_compiler_options nir_options = {
    .lower_fpow = false,
    .lower_uadd_carry = true,
    .lower_usub_borrow = true,
+   .lower_sub = true,
    .lower_ffract = true,
    .lower_pack_half_2x16 = true,
    .lower_pack_unorm_2x16 = true,
index a78b6222c6bbf3b6fcb3c50856f5247866b8f2ed..435c3058a8941fc11c61c620aaf450510df65553 100644 (file)
@@ -939,7 +939,7 @@ static const nir_shader_compiler_options nir_options = {
    .lower_usub_borrow = true, // TODO
    .lower_mul_high = false,
    .lower_negate = false,
-   .lower_sub = false, // TODO
+   .lower_sub = true,
    .lower_scmp = true, // TODO: not implemented yet
    .lower_idiv = true,
    .lower_isign = false, // TODO