On Thu, Jan 12, 2012 at 6:59 PM, Farley, Peter x23353
<[email protected]> wrote:

> EX is indeed expensive, but my guess (untested) is that an EXecuted MVC for 
> small lengths (not only under 256 but even less) is probably still more 
> efficient than MVCL for those lengths, and *definitely* more efficient than 
> MVCLE.  My prior experiences in replacing MVCL/CLCL's with multiple MVC/CLC's 
> and even MVC/CLC loops for "small" areas (FSVO "small") is that MVCL/CLCL 
> loses almost every time.

I have a regular need for a CLC over 0..8 byte (a kind of "pseudo
wildcard" pattern where a trailing * specifies matching of the
preceding substring).

Since it's already Friday here, this is what I came up with after some
experiments (forgive my SPM accent, I trust the intentions are clear).
I'm open for ideas...

LA      R1,OP2+L'OP2        Beyond string in case no spaces
TRT     OP2,SPACE           Find first ' ' in pattern
CR      R1,R3
COND    NOTEQUAL,DECR,R1    Point at last non-blank, if any
CLI     0(R1),C'*'
IF      NOTEQUAL
  CLC   OP1,OP2             No '*' - just compare them
ELSE    ,
  SR    R1,R3               Compute length before '*'
  IF    NOTZERO
    DECR      R1
    INLINEX   R1,CLC,OP1(0),OP2
  FI    ,
FI      ,

The INLINEX is my macro and generates (in case of the CLC) this
      INLINEX   R1,CLC,OP1(0),OP2
+INLINEX0338    CLC  OP1(0),OP2
+INLINEY0338    EX R1,INLINEX0338

>From what we could tell, the CLC is still warm when EX hits it.

Slower alternative was a computed branch to do the 9 cases. With our
usage mix, the extra test to use a plain CLC over 8 byte seems to pay
off.

Reply via email to