]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 425820 - Failure to recognize vpcmpeqq as a dependency breaking idiom.
authorJulian Seward <jseward@acm.org>
Sat, 19 Sep 2020 10:05:26 +0000 (12:05 +0200)
committerJulian Seward <jseward@acm.org>
Sat, 19 Sep 2020 10:05:26 +0000 (12:05 +0200)
In the IR optimiser (ir_opt.c): Recognise the following IROps as
dependency-breaking ops that generate an all-ones output: Iop_CmpEQ16x4
Iop_CmpEQ32x2 Iop_CmpEQ64x2 Iop_CmpEQ8x32 Iop_CmpEQ16x16 Iop_CmpEQ64x4.  I
think this fixes all the known cases for sizes 32 bits to 256 bits.  It also
fixes bug 425820.

VEX/priv/ir_opt.c

index c5b7a2feaaf7fca389cab36e5fa0c8c762a7bfdc..930fd49dd816b165316c1f0d629d31dd9092763d 100644 (file)
@@ -1292,13 +1292,19 @@ static IRExpr* mkOnesOfPrimopResultType ( IROp op )
       case Iop_Or32:
          return IRExpr_Const(IRConst_U32(0xFFFFFFFF));
       case Iop_CmpEQ8x8:
+      case Iop_CmpEQ16x4:
+      case Iop_CmpEQ32x2:
       case Iop_Or64:
          return IRExpr_Const(IRConst_U64(0xFFFFFFFFFFFFFFFFULL));
       case Iop_CmpEQ8x16:
       case Iop_CmpEQ16x8:
       case Iop_CmpEQ32x4:
+      case Iop_CmpEQ64x2:
          return IRExpr_Const(IRConst_V128(0xFFFF));
+      case Iop_CmpEQ8x32:
+      case Iop_CmpEQ16x16:
       case Iop_CmpEQ32x8:
+      case Iop_CmpEQ64x4:
          return IRExpr_Const(IRConst_V256(0xFFFFFFFF));
       default:
          ppIROp(op);
@@ -2402,13 +2408,23 @@ static IRExpr* fold_Expr_WRK ( IRExpr** env, IRExpr* e )
                }
                break;
 
+            // in total 32 bits
             case Iop_CmpEQ32:
+            // in total 64 bits
             case Iop_CmpEQ64:
             case Iop_CmpEQ8x8:
+            case Iop_CmpEQ16x4:
+            case Iop_CmpEQ32x2:
+            // in total 128 bits
             case Iop_CmpEQ8x16:
             case Iop_CmpEQ16x8:
             case Iop_CmpEQ32x4:
+            case Iop_CmpEQ64x2:
+            // in total 256 bits
+            case Iop_CmpEQ8x32:
+            case Iop_CmpEQ16x16:
             case Iop_CmpEQ32x8:
+            case Iop_CmpEQ64x4:
                if (sameIRExprs(env, e->Iex.Binop.arg1, e->Iex.Binop.arg2)) {
                   e2 = mkOnesOfPrimopResultType(e->Iex.Binop.op);
                   break;