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

Zhigang Gong zhigang.gong at linux.intel.com
Thu Jun 6 01:17:34 PDT 2013


Homer,

I personally don't think the previous version is not clear. First operator
is destination and the second operator is source.
And use {%x} to indicate it's a value, and without {} indicates it's an
address pointer. It's clear enough for me.

Any strong reason why we need to change to the new style?

> -----Original Message-----
> From: beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org
>
[mailto:beignet-bounces+zhigang.gong=linux.intel.com at lists.freedesktop.org]
> On Behalf Of Homer Hsing
> Sent: Thursday, June 06, 2013 2:29 PM
> To: beignet at lists.freedesktop.org
> Cc: Homer Hsing
> Subject: [Beignet] [PATCH] improve disassembing load/store IR instructions
> 
> 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
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list