And I suspect "it depends."

Are the operands already in cache? Must the processor do a read-to-write switch 
on a cache line? What instructions came before? What come after? What is the 
preceding and succeeding usage of the register? What is the impact on the 
i-cache of 8 bytes versus 6?

Me, I would tend to write IC/STC assuming I had a register to spare. I have 
what is probably a negatively prejudiced attitude toward MVC.

I certainly agree that MVC is clearer. A maintenance programmer five years from 
now does not have to wonder "is that register really available? Is any 
subsequent routine counting on that value in the register?"

And as Chris implies, unless the code will be doing this millions of times per 
day, who cares? Do whatever floats your boat.
        
Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Robin Vowels
Sent: Monday, October 16, 2017 7:03 AM
To: [email protected]
Subject: Re: One Byte MVC Versus IC/STC

From: "David S." <[email protected]>
Sent: Thursday, December 17, 2015 6:10 AM


>> > "... a good reason why small MVCs run slower than LG/STG pairs ...
>> > overhead at the beginning of an MVC ... check if the operands are 
>> > on
> 'good'
>> > boundaries ... check for operand overlap ... length check ...
> [meanwhile] the
>> >  LG/STG is far on its way.  Anyone writing a length-1 MVC instead 
>> > of an IC/STC would be laughed out of their code review.
>>
>> Rubbish.
>> KISS.
>> A move of length 1 is clear and unequivocal.
>> And it's only one line.
> 
> Nevertheless, IC/STC is what the newer mainframe compilers generate 
> for a one-byte move.  For the reasons given, it's less work for the 
> system than an MVC.

It's a question of what is easiest and simplest for the programmer.
Machines are supposed to do the work for us, not the other way around.

Why write two lines when one will do the job?

Reply via email to