This thread has been really informative. I am going to put this to use. I
have code that is executing a million or so ~8K MVCLs a day. I have other
things on my plate at the moment but I will replace that with an MVC loop at
some point.

It seems to me like the ideal way to do this would be to have not two stages
(MVC for 256 and EX'ed MVC) but rather three cases: A loop with a
"hard-coded" or "unrolled" string of 16 MVC's that moved 4K blocks and
incremented registers by 4K on each iteration; followed by a loop of
256-byte MVCs; followed by an EX'ed MVC for 1 to 255 bytes. (Obviously each
step would be optional depending on the exact count.)

Thoughts?

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of David Crayford
Sent: Tuesday, May 31, 2011 8:32 PM
To: [email protected]
Subject: Re: What is the current feeling for MVC loop vs. MVCL?

On 1/06/2011 12:13 AM, Kirk Wolf wrote:
> The IBM C compiler would generate an MVC loop.   So, that's how IBM feels
I
> guess.
>

And when the length is a constant it generates multiple MVC instructions to
eliminate branches. Kind of like loop unrolling.

*
*    char input[528];
*
*    memcpy( output, input, sizeof input );
MVC      (*)void(256,r1,0),input(r4,1508)
MVC      (*)void(256,r1,256),input(r4,1764)
MVC      (*)void(16,r1,512),input(r4,2020)

And if you increase the size of the buffer it generates a loop with loop
unrolling (if that makes sense). There seems to be a HWM where it drops into
a loop.

*
*    char input[10000];
*
*    memcpy( output, input, sizeof input );
LA       r0,5
LA       r6,2176(r4,)
@2L4     DS       0H
MVC      (*)void(256,r1,0),input(r6,0)
MVC      (*)void(256,r1,256),input(r6,256)
MVC      (*)void(256,r1,512),input(r6,512)
MVC      (*)void(256,r1,768),input(r6,768)
MVC      (*)void(256,r1,1024),input(r6,1024)
MVC      (*)void(256,r1,1280),input(r6,1280)
MVC      (*)void(256,r1,1536),input(r6,1536)
LA       r1,(*)void(,r1,1792)
LA       r6,input(,r6,1792)
BRCT     r0,@2L4
MVC      (*)void(256,r1,0),input(r6,0)
MVC      (*)void(256,r1,256),input(r6,256)
MVC      (*)void(256,r1,512),input(r6,512)
MVC      (*)void(256,r1,768),input(r6,768)
MVC      (*)void(16,r1,1024),input(r6,1024)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to