[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-03-30 Thread Carl Love via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

--- Comment #1 from Carl Love  ---
Created attachment 98163
  --> https://bugs.kde.org/attachment.cgi?id=98163&action=edit
Patch 2 of 5 to add VEX support for the POWER ISA 3.0 instructions

This patch add support to emulate more of the ISA 3.0 instruction in Valgrind.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-03-30 Thread Carl Love via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

--- Comment #2 from Carl Love  ---
Created attachment 98164
  --> https://bugs.kde.org/attachment.cgi?id=98164&action=edit
Patch 2 of 5 to add testsuite support for the POWER ISA 3.0 instructions

This patch adds test suite support for the instructions added in the first
patch.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-03-31 Thread Will Schmidt via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

Will Schmidt  changed:

   What|Removed |Added

 CC||will_schm...@vnet.ibm.com

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-07 Thread Julian Seward via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

--- Comment #3 from Julian Seward  ---
(In reply to Carl Love from comment #1)
> Created attachment 98163 [details]
> Patch 2 of 5 to add VEX support for the POWER ISA 3.0 instructions


--- a/VEX/priv/guest_ppc_toIR.c
+++ b/VEX/priv/guest_ppc_toIR.c
@@ -13138,6 +13138,680 @@ static Bool dis_av_procctl ( UInt theInstr )

+  int i;

Please use the "house" types (Int) rather than the raw C type (int).
Here and throughout.


+ binop( Iop_64HLtoV128,
+mkU64( 0x ),
+mkU64( 0x ) ) ) );

The ppc back end knows how to generate a 128 bit all-ones-value into a
vector register.  So just replace all that with mkV128(0x).  See
the very end of iselVecExpr_wrk in host_ppc_isel.c.  (This appears more
than once in the source code.)


On the whole it looks ok.  My only concern is that it seems rather
repetitive in places.  I wonder if you couldn't shorten it up a bit
by writing a few subroutines?  For example, this idiom seems to
occur several times

+binop( Iop_Xor32,
+   binop( Iop_Xor32,
+  mkexpr( something1 ),
+  mkexpr( something2 ) ),
+   binop( Iop_Xor32,
+  mkexpr( something3 ),
+  mkexpr( something4 ) ) ) );

and also

+
+binop( Iop_64HLtoV128,
+   binop( Iop_32HLto64,
+  mkexpr( something0 ),
+  mkexpr( something1 ) ),
+   binop( Iop_32HLto64,
+  mkexpr( something2 ),
+  mkexpr( something3 ) )

For the latter, you could borrow breakupV128to32s and mkV128from32s
from guest_amd64_toIR.c.  Just as an example of making this stuff a bit
more concise.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-07 Thread Julian Seward via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

--- Comment #4 from Julian Seward  ---
(In reply to Carl Love from comment #2)
> Created attachment 98164 [details]
> Patch 2 of 5 to add testsuite support for the POWER ISA 3.0 instructions

Looks fine to me.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-08 Thread Carl Love via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

Carl Love  changed:

   What|Removed |Added

  Attachment #98163|0   |1
is obsolete||

--- Comment #5 from Carl Love  ---
Created attachment 98295
  --> https://bugs.kde.org/attachment.cgi?id=98295&action=edit
Updated VEX support patch

The patch was updated to address Julian's comments.  
>   + binop( Iop_64HLtoV128, 
> + mkU64( 0x ),  
> + mkU64( 0x ) ) ) );
>  The ppc back end knows how to generate a 128 bit all-ones-value into a 
> vector register. So  
>   just replace all that with mkV128(0x)

Done

> My only concern is that it seems rather repetitive in places. I wonder if you 
> couldn't shorten
> it up a bit by writing a few subroutines?

The following functions were added and used in multiple places to make the code
more readable.

static inline IRExpr* mkXOr4_32( IRTemp t0, IRTemp t1, 
 
IRTemp t2, 
 
IRTemp t3)
{
   return binop( Iop_Xor32, 
 binop( Iop_Xor32, mkexpr( t0 ), mkexpr( t1 ) ),
 binop( Iop_Xor32, mkexpr( t2 ), mkexpr( t3 ) ) );  
}   

static inline IRExpr* mkOr3_V128( IRTemp t0, IRTemp t1, IRTemp t2) 
{   
   return binop( Iop_OrV128,   
 mkexpr( t0 ),   
 binop( Iop_OrV128, mkexpr( t1 ), mkexpr( t2 ) ) );  
}

static inline IRExpr* mkOr4_V128( IRTemp t0, IRTemp t1, IRTemp t2,
  IRTemp t3 ) 
{ 
   return binop( Iop_OrV128, 
binop( Iop_OrV128, mkexpr( t0 ), mkexpr( t1 ) ), 
 binop( Iop_OrV128, mkexpr( t2 ), mkexpr( t3 ) ) ); 
}   

static inline IRExpr* mkOr4_V128_expr( IRExpr* t0, IRExpr* t1, IRExpr* t2,
  IRExpr* t3 )  
{   
   /* arguments are already expressions */  
   return binop( Iop_OrV128,
   binop( Iop_OrV128, ( t0 ), ( t1 ) ), 
   binop( Iop_OrV128, ( t2 ), ( t3 ) ) );   
}   

static IRExpr* extract_field_from_vector( IRTemp vB, IRExpr* index, UInt mask) 
{ 
   /* vB is a vector, extract bits starting at index to size of mask */ 
   return unop( Iop_V128to64,   
binop( Iop_AndV128, 
binop( Iop_ShrV128, 
 mkexpr( vB ),  
 unop( Iop_64to8,   
 binop( Iop_Mul64, index,   
 mkU64( 8 ) ) )
),  
  binop( Iop_64HLtoV128, 
  mkU64( 0x0 ), 
  mkU64( mask ) ) ) );  
} 

The updated patch is attached for additional review.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-26 Thread Julian Seward via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

--- Comment #6 from Julian Seward  ---
(In reply to Carl Love from comment #5)
> Created attachment 98295 [details]
> Updated VEX support patch

Looks fine to me; ok to land.

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-26 Thread Carl Love via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

Carl Love  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

-- 
You are receiving this mail because:
You are watching all bug changes.


[valgrind] [Bug 361207] Valgrind does not support the IBM POWER ISA 3.0 instructions, part 2

2016-04-26 Thread Carl Love via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=361207

Carl Love  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Carl Love  ---
Committed the VEX support in VEX commit 3217
Committed the valgrind support (test suite) in commit 15870

-- 
You are receiving this mail because:
You are watching all bug changes.