[Beignet] [PATCH 1/2] Backend: Change disable compact to compact version

Xiuli Pan xiuli.pan at intel.com
Wed Jul 13 03:00:56 UTC 2016


From: Pan Xiuli <xiuli.pan at intel.com>

This chagne is basic for gen8+ instruction compact.

Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
 backend/src/backend/gen8_encoder.hpp     | 2 +-
 backend/src/backend/gen_encoder.hpp      | 2 +-
 backend/src/backend/gen_insn_compact.cpp | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/backend/src/backend/gen8_encoder.hpp b/backend/src/backend/gen8_encoder.hpp
index 8c447ea..12b3765 100644
--- a/backend/src/backend/gen8_encoder.hpp
+++ b/backend/src/backend/gen8_encoder.hpp
@@ -55,7 +55,7 @@ namespace gbe
     virtual void setDst(GenNativeInstruction *insn, GenRegister dest);
     virtual void setSrc0(GenNativeInstruction *insn, GenRegister reg);
     virtual void setSrc1(GenNativeInstruction *insn, GenRegister reg);
-    virtual bool disableCompact() { return true; }
+    virtual uint32_t getCompactVersion() { return 8; }
     virtual void alu3(uint32_t opcode, GenRegister dst,
                        GenRegister src0, GenRegister src1, GenRegister src2);
     virtual bool canHandleLong(uint32_t opcode, GenRegister dst, GenRegister src0,
diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp
index 4979305..0f835ca 100644
--- a/backend/src/backend/gen_encoder.hpp
+++ b/backend/src/backend/gen_encoder.hpp
@@ -261,7 +261,7 @@ namespace gbe
     virtual void setSrc0(GenNativeInstruction *insn, GenRegister reg) = 0;
     virtual void setSrc1(GenNativeInstruction *insn, GenRegister reg) = 0;
     GenCompactInstruction *nextCompact(uint32_t opcode);
-    virtual bool disableCompact() { return false; }
+    virtual uint32_t getCompactVersion() { return 7; }
     GenNativeInstruction *next(uint32_t opcode);
     uint32_t n_instruction(void) const { return store.size(); }
     virtual bool canHandleLong(uint32_t opcode, GenRegister dst, GenRegister src0,
diff --git a/backend/src/backend/gen_insn_compact.cpp b/backend/src/backend/gen_insn_compact.cpp
index d692fff..7be33ba 100644
--- a/backend/src/backend/gen_insn_compact.cpp
+++ b/backend/src/backend/gen_insn_compact.cpp
@@ -440,7 +440,7 @@ namespace gbe {
   }
 
   bool compactAlu1(GenEncoder *p, uint32_t opcode, GenRegister dst, GenRegister src, uint32_t condition, bool split) {
-    if(p->disableCompact())
+    if(p->getCompactVersion() == 8)
       return false;
 
     if(split) {
@@ -478,7 +478,7 @@ namespace gbe {
   }
 
   bool compactAlu2(GenEncoder *p, uint32_t opcode, GenRegister dst, GenRegister src0, GenRegister src1, uint32_t condition, bool split) {
-    if(p->disableCompact())
+    if(p->getCompactVersion() == 8)
       return false;
 
     if(split) {
-- 
2.5.0



More information about the Beignet mailing list