[Beignet] [PATCH 14/27] Overload all the alu1 and alu1withtemp functions.

junyan.he at inbox.com junyan.he at inbox.com
Tue Jan 6 02:01:41 PST 2015


From: Junyan He <junyan.he at linux.intel.com>

Signed-off-by: Junyan He <junyan.he at linux.intel.com>
---
 backend/src/backend/gen8_context.cpp | 20 ++++++++++++++++++++
 backend/src/backend/gen8_context.hpp |  2 ++
 backend/src/backend/gen_context.hpp  |  4 ++--
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/backend/src/backend/gen8_context.cpp b/backend/src/backend/gen8_context.cpp
index 276b8c5..d9eb6bf 100644
--- a/backend/src/backend/gen8_context.cpp
+++ b/backend/src/backend/gen8_context.cpp
@@ -51,6 +51,26 @@ namespace gbe
     this->sel = GBE_NEW(Selection8, *this);
   }
 
+  void Gen8Context::emitUnaryInstruction(const SelectionInstruction &insn)
+  {
+    switch (insn.opcode) {
+      case SEL_OP_CONVI64_TO_I:
+
+      default:
+        GenContext::emitUnaryInstruction(insn);
+    }
+  }
+
+  void Gen8Context::emitUnaryWithTempInstruction(const SelectionInstruction &insn)
+  {
+    switch (insn.opcode) {
+      case SEL_OP_CONVI_TO_I64:
+
+      default:
+        GenContext::emitUnaryWithTempInstruction(insn);
+    }
+  }
+
   void Gen8Context::packLongVec(GenRegister unpacked, GenRegister packed, uint32_t simd)
   {
     GBE_ASSERT(packed.subnr == 0);
diff --git a/backend/src/backend/gen8_context.hpp b/backend/src/backend/gen8_context.hpp
index d9e547b..a3c3aff 100644
--- a/backend/src/backend/gen8_context.hpp
+++ b/backend/src/backend/gen8_context.hpp
@@ -48,6 +48,8 @@ namespace gbe
     /*! Get the pointer argument size for curbe alloc */
     virtual uint32_t getPointerSize(void) { return 8; }
 
+    virtual void emitUnaryInstruction(const SelectionInstruction &insn);
+    virtual void emitUnaryWithTempInstruction(const SelectionInstruction &insn);
     virtual void emitWrite64Instruction(const SelectionInstruction &insn);
     virtual void emitRead64Instruction(const SelectionInstruction &insn);
   protected:
diff --git a/backend/src/backend/gen_context.hpp b/backend/src/backend/gen_context.hpp
index 317257b..43d4e75 100644
--- a/backend/src/backend/gen_context.hpp
+++ b/backend/src/backend/gen_context.hpp
@@ -124,8 +124,8 @@ namespace gbe
 
     /*! Final Gen ISA emission helper functions */
     void emitLabelInstruction(const SelectionInstruction &insn);
-    void emitUnaryInstruction(const SelectionInstruction &insn);
-    void emitUnaryWithTempInstruction(const SelectionInstruction &insn);
+    virtual void emitUnaryInstruction(const SelectionInstruction &insn);
+    virtual void emitUnaryWithTempInstruction(const SelectionInstruction &insn);
     void emitBinaryInstruction(const SelectionInstruction &insn);
     void emitBinaryWithTempInstruction(const SelectionInstruction &insn);
     void emitTernaryInstruction(const SelectionInstruction &insn);
-- 
1.9.1



More information about the Beignet mailing list