IP Library Granted Patent US 9,329,850
Granted Patent B2
US 9,329,850 · App. 14/313,358 · Granted May 3, 2016

Relocation of instructions that use relative addressing

Inventors: Michael K. Gschwind (Chappaqua, NY); Valentina Salapura (Chappaqua, NY)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F8/52G06F8/443G06F9/44557G06F9/3004
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,329,850
App. No.
14/313,358
Granted
May 3, 2016
Kind
B2
Abstract

Relocation of instructions that use relative addressing. Metadata relating to an instruction that uses relative addressing to access data and is to be relocated is stored prior to relocation. Based on relocating the instruction from one memory location to another memory location, a determination is made of an address to be used to access the data by the instruction. The determining is based on at least one of the metadata or an address of the another memory location. The instruction is executed at the another memory location, and the determined address is used to access the data.

Claims (38)

1. A method of facilitating processing within a computing environment, said method comprising:

storing, by a processor of the computing environment, metadata relating to an instruction of the computing environment to be relocated from one memory location to another memory location, the instruction using program counter (PC)-relative addressing to access data and the instruction included in code that is dynamically optimized resulting in relocating the instruction to provide a relocated instruction;

based on relocating the instruction, determining an address to be used to access the data by the relocated instruction, the determining being based on at least one of the metadata or an address of the another memory location, wherein the determining the address to be used to access the data comprises:

accessing a register that is included in the code prior to optimizing the code to obtain a register address from the register, the register being a fixed number of instructions before or after the instruction, and the register address comprising an address of the one memory location;

determining an offset to be used by the relocated instruction to access the data; and

using the register address and the offset to determine the address to be used to access the data; and

executing the relocated instruction at the another memory location, the executing using the determined address to access the data.

2. The method of claim 1 , wherein the determining comprises adjusting the offset based on at least one of the metadata or the address of the another memory location, and using the adjusted offset to determine the address to be used to access the data.

3. A computer program product for facilitating processing within a computing environment, said computer program product comprising:

a computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:

storing, by a processor of the computing environment, metadata relating to an instruction of the computing environment to be relocated from one memory location to another memory location, the instruction using program counter (PC)-relative addressing to access data and the instruction included in code that is dynamically optimized resulting in relocating the instruction to provide a relocated instruction;

based on relocating the instruction, determining an address to be used to access the data by the relocated instruction, the determining being based on at least one of the metadata or an address of the another memory location, wherein the determining the address to be used to access the data comprises:

accessing a register that is included in the code prior to optimizing the code to obtain a register address from the register, the register being a fixed number of instructions before or after the instruction, and the register address comprising an address of the one memory location;

determining an offset to be used by the relocated instruction to access the data; and

using the register address and the offset to determine the address to be used to access the data; and

executing the relocated instruction at the another memory location, the executing using the determined address to access the data.

4. The computer program product of claim 3 , wherein the metadata comprises an address of the one memory location.

5. The computer program product of claim 3 , wherein the register is a special purpose register, including one of a come-from-address register or a target address register.

6. The computer program product of claim 3 , wherein the determining comprises adjusting the offset based on at least one of the metadata or the address of the another memory location, and using the adjusted offset to determine the address to be used to access the data.

7. The computer program product of claim 6 , wherein the adjusting comprises determining an absolute address and using the absolute address in adjusting the offset.

8. The computer program product of claim 3 , wherein the instruction is included in code of a module, the module including the code and data, the data to be accessed by one or more instructions of the code, and wherein the relocating is a result of optimizing at least a portion of the code to provide optimized code, wherein the optimized code is placed in one or more memory locations different from one or more memory locations storing the code that is not optimized, and wherein the data is not relocated.

9. The computer program product of claim 3 , wherein the instruction is included in a module having code and data, the code including the instruction, and wherein the relocating comprises storing the relocated instruction in the another memory location, the another memory location overlaying a data space of the module.

10. The computer program product of claim 3 , wherein the instruction is included in a module having code and data, the code including the instruction, and wherein the relocating comprises storing the relocated instruction in the another memory location, the another memory location being one of before or after the module.

11. The computer program product of claim 3 , wherein the instruction is of library code to be shared by a plurality of applications, and wherein the method further comprises based on optimizing the library code to provide optimized library code, storing the optimized library code at different memory locations for different applications of the plurality of applications.

12. The computer program product of claim 3 , wherein the instruction is of library code to be shared by a plurality of applications, and wherein the method further comprises based on optimizing the library code to provide optimized library code, storing the optimized library code at a same memory location for different applications of the plurality of applications.

13. A computer system for facilitating processing within a computing environment, said computer system comprising:

a memory; and

a processor in communications with the memory, wherein the computer system is configured to perform a method, said method comprising:

storing metadata relating to an instruction of the computing environment to be relocated from one memory location to another memory location, the instruction using program counter (PC)-relative addressing to access data and the instruction included in code that is dynamically optimized resulting in relocating the instruction to provide a relocated instruction;

based on relocating the instruction, determining an address to be used to access the data by the relocated instruction, the determining being based on at least one of the metadata or an address of the another memory location, wherein the determining the address to be used to access the data comprises:

accessing a register that is included in the code prior to optimizing the code to obtain a register address from the register, the register being a fixed number of instructions before or after the instruction, and the register address comprising an address of the one memory location;

determining an offset to be used by the relocated instruction to access the data; and

using the register address and the offset to determine the address to be used to access the data; and

executing the relocated instruction at the another memory location, the executing using the determined address to access the data.

14. The computer system of claim 13 , wherein the determining comprises adjusting the offset based on at least one of the metadata or the address of the another memory location, and using the adjusted offset to determine the address to be used to access the data.

15. The computer system of claim 13 , wherein the instruction is included in code of a module, the module including the code and data, the data to be accessed by one or more instructions of the code, and wherein the relocating is a result of optimizing at least a portion of the code to provide optimized code, wherein the optimized code is placed in one or more memory locations different from one or more memory locations storing the code that is not optimized, and wherein the data is not relocated.

16. The computer system of claim 13 , wherein the instruction is included in a module having code and data, the code including the instruction, and wherein the relocating comprises storing the relocated instruction in the another memory location, the another memory location overlaying a data space of the module.

17. The computer system of claim 13 , wherein the instruction is included in a module having code and data, the code including the instruction, and wherein the relocating comprises storing the relocated instruction in the another memory location, the another memory location being one of before or after the module.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 24, 2014
From: GSCHWIND, MICHAEL K.; SALAPURA, VALENTINA
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 033168/0613 →
Continuity (1)
Related Publication 20150370558A1 · Dec 24, 2015