[Beignet] [PATCH] improve disassembing load/store IR instructions

Homer Hsing homer.xing at intel.com
Wed Jun 5 23:28:31 PDT 2013


comment data operator and address operator

before changing, disassembly code is:
  load {%1} %2
  store %1 {%2}

after changing, disassembly code is:
  load to(%1) addr(%2)
  store addr(%1) from(%2)

Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 backend/src/ir/instruction.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/backend/src/ir/instruction.cpp b/backend/src/ir/instruction.cpp
index a57c204..0492a1c 100644
--- a/backend/src/ir/instruction.cpp
+++ b/backend/src/ir/instruction.cpp
@@ -894,20 +894,20 @@ namespace ir {
     INLINE void LoadInstruction::out(std::ostream &out, const Function &fn) const {
       this->outOpcode(out);
       out << "." << type << "." << addrSpace << (dwAligned ? "." : ".un") << "aligned";
-      out << " {";
+      out << " to(";
       for (uint32_t i = 0; i < valueNum; ++i)
         out << "%" << this->getDst(fn, i) << (i != (valueNum-1u) ? " " : "");
-      out << "}";
-      out << " %" << this->getSrc(fn, 0);
+      out << ")";
+      out << " addr(%" << this->getSrc(fn, 0) << ")";
     }
 
     INLINE void StoreInstruction::out(std::ostream &out, const Function &fn) const {
       this->outOpcode(out);
       out << "." << type << "." << addrSpace << (dwAligned ? "." : ".un") << "aligned";
-      out << " %" << this->getSrc(fn, 0) << " {";
+      out << " addr(%" << this->getSrc(fn, 0) << ") from(";
       for (uint32_t i = 0; i < valueNum; ++i)
         out << "%" << this->getSrc(fn, i+1) << (i != (valueNum-1u) ? " " : "");
-      out << "}";
+      out << ")";
     }
 
     INLINE void LabelInstruction::out(std::ostream &out, const Function &fn) const {
-- 
1.8.1.2



More information about the Beignet mailing list