backend: refine the local copy propagation.

Submitted by rander on June 13, 2017, 7:07 a.m.

Details

Message ID 1497337679-25815-1-git-send-email-rander.wang@intel.com
State New
Headers show
Series "backend: refine the local copy propagation." ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

rander June 13, 2017, 7:07 a.m.
src modifier is not supported by some instructions.
	so return false when it exists. This fix piglit %
	failed

Signed-off-by: rander.wang <rander.wang@intel.com>
---
 .../src/backend/gen_insn_selection_optimize.cpp    | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

Patch hide | download patch | download mbox

diff --git a/backend/src/backend/gen_insn_selection_optimize.cpp b/backend/src/backend/gen_insn_selection_optimize.cpp
index 07547ec..730db5e 100644
--- a/backend/src/backend/gen_insn_selection_optimize.cpp
+++ b/backend/src/backend/gen_insn_selection_optimize.cpp
@@ -189,6 +189,38 @@  namespace gbe
     if (insn.opcode == SEL_OP_BSWAP) //should remove once bswap issue is fixed
       return false;
 
+    //the src modifier is not supported by the following instructions
+    if(info->replacement.negation || info->replacement.absolute)
+    {
+      switch(insn.opcode)
+      {
+        case SEL_OP_MATH:
+        {
+          switch(insn.extra.function)
+          {
+            case GEN_MATH_FUNCTION_INT_DIV_QUOTIENT:
+            case GEN_MATH_FUNCTION_INT_DIV_REMAINDER:
+            case GEN_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER:
+              return false;
+            default:
+              break;
+          }
+
+          break;
+        }
+        case SEL_OP_CBIT:
+        case SEL_OP_FBH:
+        case SEL_OP_FBL:
+        case SEL_OP_BRC:
+        case SEL_OP_BRD:
+        case SEL_OP_BFREV:
+        case SEL_OP_LZD:
+          return false;
+        default:
+          break;
+      }
+    }
+
     if (insn.isWrite() || insn.isRead()) //register in selection vector
       return false;
 

Comments

Addc also can't use src modifier.
All instruction selection opcode used addc need also return false, such as hadd.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> rander.wang

> Sent: Tuesday, June 13, 2017 15:08

> To: beignet@freedesktop.org

> Cc: Wang, Rander <rander.wang@intel.com>

> Subject: [Beignet] [PATCH] backend: refine the local copy propagation.

> 

> 	src modifier is not supported by some instructions.

> 	so return false when it exists. This fix piglit %

> 	failed

> 

> Signed-off-by: rander.wang <rander.wang@intel.com>

> ---

>  .../src/backend/gen_insn_selection_optimize.cpp    | 32

> ++++++++++++++++++++++

>  1 file changed, 32 insertions(+)

> 

> diff --git a/backend/src/backend/gen_insn_selection_optimize.cpp

> b/backend/src/backend/gen_insn_selection_optimize.cpp

> index 07547ec..730db5e 100644

> --- a/backend/src/backend/gen_insn_selection_optimize.cpp

> +++ b/backend/src/backend/gen_insn_selection_optimize.cpp

> @@ -189,6 +189,38 @@ namespace gbe

>      if (insn.opcode == SEL_OP_BSWAP) //should remove once bswap issue is

> fixed

>        return false;

> 

> +    //the src modifier is not supported by the following instructions

> +    if(info->replacement.negation || info->replacement.absolute)

> +    {

> +      switch(insn.opcode)

> +      {

> +        case SEL_OP_MATH:

> +        {

> +          switch(insn.extra.function)

> +          {

> +            case GEN_MATH_FUNCTION_INT_DIV_QUOTIENT:

> +            case GEN_MATH_FUNCTION_INT_DIV_REMAINDER:

> +            case

> GEN_MATH_FUNCTION_INT_DIV_QUOTIENT_AND_REMAINDER:

> +              return false;

> +            default:

> +              break;

> +          }

> +

> +          break;

> +        }

> +        case SEL_OP_CBIT:

> +        case SEL_OP_FBH:

> +        case SEL_OP_FBL:

> +        case SEL_OP_BRC:

> +        case SEL_OP_BRD:

> +        case SEL_OP_BFREV:

> +        case SEL_OP_LZD:

> +          return false;

> +        default:

> +          break;

> +      }

> +    }

> +

>      if (insn.isWrite() || insn.isRead()) //register in selection vector

>        return false;

> 

> --

> 2.7.4

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/beignet