[Beignet] [PATCH 7/7] Backend: for BDW and after, According to BSpec no need to split CMP when src is DW DF
rander
rander.wang at intel.com
Tue Mar 7 02:25:00 UTC 2017
Signed-off-by: rander <rander.wang at intel.com>
---
backend/src/backend/gen8_encoder.cpp | 5 +++++
backend/src/backend/gen_encoder.cpp | 4 ++++
backend/src/backend/gen_encoder.hpp | 1 +
3 files changed, 10 insertions(+)
diff --git a/backend/src/backend/gen8_encoder.cpp b/backend/src/backend/gen8_encoder.cpp
index a33fbac..cbee83f 100644
--- a/backend/src/backend/gen8_encoder.cpp
+++ b/backend/src/backend/gen8_encoder.cpp
@@ -883,4 +883,9 @@ namespace gbe
msg_length,
response_length);
}
+
+ /* for BDW and after, no need to split CMP when src is DW*/
+ bool Gen8Encoder::needToSplitCmpBySrcType(GenEncoder *p, GenRegister src0, GenRegister src1) {
+ return false;
+ }
} /* End of the name space. */
diff --git a/backend/src/backend/gen_encoder.cpp b/backend/src/backend/gen_encoder.cpp
index 03ce0e2..217a2d8 100644
--- a/backend/src/backend/gen_encoder.cpp
+++ b/backend/src/backend/gen_encoder.cpp
@@ -192,6 +192,10 @@ namespace gbe
if (isSrcDstDiffSpan(dst, src0) == true) return true;
if (isSrcDstDiffSpan(dst, src1) == true) return true;
+ return p->needToSplitCmpBySrcType(p, src0, src1);
+ }
+
+ bool GenEncoder::needToSplitCmpBySrcType(GenEncoder *p, GenRegister src0, GenRegister src1) {
if (src0.type == GEN_TYPE_D || src0.type == GEN_TYPE_UD || src0.type == GEN_TYPE_F)
return true;
if (src1.type == GEN_TYPE_D || src1.type == GEN_TYPE_UD || src1.type == GEN_TYPE_F)
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index 3e45c81..040b94a 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -162,6 +162,7 @@ namespace gbe
void BRD(GenRegister src);
/*! Compare instructions */
void CMP(uint32_t conditional, GenRegister src0, GenRegister src1, GenRegister dst = GenRegister::null());
+ virtual bool needToSplitCmpBySrcType(GenEncoder *p, GenRegister src0, GenRegister src1);
/*! Select with embedded compare (like sel.le ...) */
void SEL_CMP(uint32_t conditional, GenRegister dst, GenRegister src0, GenRegister src1);
/*! EOT is used to finish GPGPU threads */
--
2.7.4
More information about the Beignet
mailing list