Instruction to load data up to a dynamically determined memory boundary
AssigneeInternational Business Machines Corporation
InventorsJonathan D. Bradbury, Michael K. Gschwind, Christian Jacobi, Eric M. Schwarz, Timothy J. Slegel
Life of this patent
Estimating the term…
Abstract
A Load to Block Boundary instruction is provided that loads a variable number of bytes of data into a register while ensuring that a specified memory boundary is not crossed. The boundary is dynamically determined based on a specified type of boundary and one or more characteristics of the processor executing the instruction, such as cache line size or page size used by the processor.
Claims20
A computer program product for executing a machine instruction in a central processing unit, the computer program product comprising:
- a non-transitory computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
- obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
- at least one opcode field to provide an opcode, the opcode identifying a load to block boundary operation;
- a register field to be used to designate a register, the register comprising a first operand;
- at least one field for locating a second operand in main memory;
- and
- a block boundary type indicator to indicate a specified type of block boundary of the second operand;
- and
- executing the machine instruction, the execution comprising:
- loading from a memory block of the second operand a variable amount of data into the first operand while ensuring only data within the memory block of the second operand is being loaded into the first operand, the memory block being of a fixed, predefined size, wherein the loading from the memory block of the second operand starts at a starting address in the memory block of the second operand, the starting address provided by the machine instruction, and ends at an ending address, the loading comprising:
- dynamically determining boundary size, the determined boundary size being fixed and predefined apart from the machine instruction based on the fixed, predefined size of the memory block and being dynamically determined based on the specified type of block boundary and one or more characteristics of the processor;
- determining a boundary mask based on the boundary size, the boundary mask for determining closeness of the starting address to a boundary of the memory block;
- determining an ending address at which loading is to stop the determining comprising selecting between a first memory position and a second memory position, the first memory position determined based on the boundary size and on masking the starting address using the boundary mask, and the second memory position determined as the starting address plus a length of the first operand;
- and
- loading the amount of data into the first operand, the loading terminating at the ending address.
A computer system for executing a machine instruction in a central processing unit, the computer system comprising:
- a memory;
- and
- a processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
- obtaining, by a processor, a machine instruction for execution, the machine instruction being defined for computer execution according to a computer architecture, the machine instruction comprising:
- at least one opcode field to provide an opcode, the opcode identifying a load to block boundary operation;
- a register field to be used to designate a register, the register comprising a first operand;
- at least one field for locating a second operand in main memory;
- and
- a block boundary type indicator to indicate a specified type of block boundary of the second operand;
- and
- executing the machine instruction, the execution comprising:
- loading from a memory block of the second operand a variable amount of data into the first operand while ensuring only data within the memory block of the second operand is being loaded into the first operand, the memory block being of a fixed, predefined size, wherein the loading from the memory block of the second operand starts at a starting address in the memory block of the second operand, the starting address provided by the machine instruction, and ends at an ending address, the loading comprising:
- dynamically determining a boundary size, the determined boundary size being fixed and predefined apart from the machine instruction based on the fixed, predefined size of the memory block and being dynamically determined based on the specified type of block boundary and one or more characteristics of the processor;
- determining an ending address at which loading is to stop, the determining comprising selecting between a first memory position and a second memory position, the first memory position determined based on the boundary size and on masking the starting address using the boundary mask, and the second memory position determined as the starting address plus a length of the first operand;
- and
- loading the amount of data into the first operand, the loading terminating at the ending address.
Dependencies are inferred from the claim text.