"Avoid instructions (executable code) and operand data (working storage or 
stack storage) in the same cache lines; which
can be costly due to moving cache lines between the separated (split) local 
caches (instruction/data L1/L2)"

-- C. Kevin Shum, Distinguished Engineer, IBM z Systems Microprocessor 
Development (March 2016)

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Keith Moe
Sent: Wednesday, August 1, 2018 1:27 PM
To: [email protected]
Subject: Re: EQU * considered harmful

Inline data is only a killer if it is updated.  It is merely less efficient if 
it is read only (same cache line in instruction and data caches).

My example was merely to show that the "INSTRUCT" statement would force half 
word alignment.  Aside from macros that expand inline CONSTANTS (not updatable 
areas), I generally avoid mixing instructions and data.  Even in non-reentrant 
code (unfortunately there's a lot here that I have to maintain and it's not 
worth it to make it reentrant), I try to isolate code blocks and data blocks.

Keith Moe
BMC Software, Inc. 
--------------------------------------------
On Wed, 8/1/18, Charles Mills <[email protected]> wrote:

 Subject: Re: EQU * considered harmful
 To: [email protected]
 Date: Wednesday, August 1, 2018, 1:05 PM
 
 Well, one could argue that
 "DS" implies a variable, not instructions, and is
 therefore inappropriate as something on which to hang an
 instruction label.
 
 I like
 the idea of some kind of "instruction" attribute
 for EQU, with an error if you branched to a non-instruction
 symbol. I think I might argue for an EQU operand rather than
 a new opcode, but that is a quibble.
 
            J      NEXTL
            DC   CL(oddnumber)'
 '
 NEXTL INSTRUCT
 
 You know that data mixed with instructions is
 just a performance KILLER on modern CPUs? They have separate
 i- and data caches, and mingling the two makes a mess that
 must be straightened out, at a cost of CPU cycles.
     
 Charles
 
 
 -----Original
 Message-----
 From: IBM Mainframe Assembler
 List [mailto:[email protected]]
 On Behalf Of Keith Moe
 Sent: Wednesday,
 August 1, 2018 12:06 PM
 To: [email protected]
 Subject: Re: EQU * considered harmful
 
 I have been using 
 
 label DS 0H
 
 for instruction labels just
 about forever and will continue to do so until I retire. 
 That said, the label has the attribute of a half word, not
 the attribute of an instruction label.  Putting the label
 on the actual instruction has the "problem" of
 inserting code at the label before the existing instruction,
 which the separate label simplifies.
 
 That said, I wish the assembler had an
 "instruction" assembler statement that could be
 used to assign labels that would receive the attribute of
 the immediate following instruction.  It would also force
 half word alignment if necessary. Example:
 
 LABEL INSTRUCT
            CLI   
    
        JNE  NEXTL
           
 whatever
            J      NEXTL
            DC   CL(oddnumber)'
 '
 NEXTL INSTRUCT
    
       ......
 
 The LABEL
 and NEXTL symbols would be assigned the attribute of the
 immediately following instruction (including length of the
 instruction).  The assembler could then have an option that
 would flag branch and execute references to labels that are
 NOT instructions (and ACONTROL to turn it on and off).
 
 If the first statement the
 generates something is not an instruction, this could also
 be considered a warning situation.  In the situation where
 the instruction is generated via non-standard means (i.e.,
 DC X'xxxx' because the Opcode does not have a
 mnemonic), the ACONTROL function could be used to avoid the
 warning. 
 
 Keith Moe
 BMC Software, Inc.
 --------------------------------------------

Reply via email to