IP Library Granted Patent US 9,792,098
Granted Patent B2
US 9,792,098 · App. 14/667,933 · Granted Oct 17, 2017

Unaligned instruction relocation

Inventors: Carlo Bertolli (Dobbs Ferry, NY); John K. O'Brien (South Salem, NY); Olivier H. Sallenave (Baldwin Place, NY); Zehra N. Sura (Yorktown Heights, NY)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F8/54G06F8/445G06F9/3001G06F9/3012
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,792,098
App. No.
14/667,933
Granted
Oct 17, 2017
Kind
B2
Abstract

In one embodiment, a computer-implemented method includes receiving source code to be compiled into an executable file for an unaligned instruction set architecture (ISA). Aligned assembled code is generated, by a computer processor. The aligned assembled code complies with an aligned ISA and includes aligned processor code for a processor and aligned accelerator code for an accelerator. A first linking pass is performed on the aligned assembled code, including relocating a first relocation target in the aligned accelerator code that refers to a first object outside the aligned accelerator code. Unaligned assembled code is generated in accordance with the unaligned ISA and includes unaligned accelerator code for the accelerator and unaligned processor code for the processor. A second linking pass is performed on the unaligned assembled code, including relocating a second relocation target outside the unaligned accelerator code that refers to an object in the unaligned accelerator code.

Claims (26)

1. A system comprising:

a memory having computer readable instructions; and

one or more processors for executing the computer readable instructions, the computer readable instructions comprising:

receiving source code to be compiled into an executable file for an unaligned instruction set architecture (ISA), the source code configured for a processor and an accelerator;

generating aligned assembled code representing the source code, the aligned assembled code being byte-aligned and in accordance with an aligned ISA and comprising aligned processor code for the processor and aligned accelerator code for the accelerator;

performing a first linking pass on the aligned assembled code, the first linking pass comprising relocating a first relocation target residing in the aligned accelerator code, wherein the first relocation target is a memory space maintaining an address of a first object outside the aligned accelerator code;

generating unaligned assembled code semantically equivalent to the aligned assembled code, in accordance with the unaligned ISA, the unaligned assembled code representing the source code and comprising unaligned processor code for the processor and unaligned accelerator code for the accelerator;

wherein at least a portion of the unaligned assembled code semantically equivalent to the aligned assembled code is not byte-aligned, wherein the aligned assembled code comprises padding to achieve byte-alignment, and wherein generating the aligned assembled code representing the source code comprises:

generating the unaligned assembled code based on the source code; and

padding the unaligned assembled code with blank bits configured to shift instructions in the unaligned assembled code to byte-aligned positions;

performing a second linking pass on the unaligned assembled code semantically equivalent to the aligned assembled code, the second linking pass comprising relocating a second relocation target residing outside the unaligned accelerator code, wherein the second relocation target is a memory space maintaining an address of a second object in the unaligned accelerator code; and

outputting the executable file for the unaligned ISA based on the first linking pass and the second linking pass.

2. The system of claim 1 , wherein the first linking pass further comprises relocating a third relocation target outside the aligned accelerator code that refers to a third object outside the aligned accelerator code.

3. The system of claim 1 , wherein the second linking pass further comprises relocating a third relocation target outside the unaligned accelerator code that refers to a third object outside the unaligned accelerator code.

4. A computer program product for relocating unaligned instructions, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:

receiving source code to be compiled into an executable file for an unaligned instruction set architecture (ISA), the source code configured for a processor and an accelerator;

generating aligned assembled code representing the source code, the aligned assembled code being byte-aligned and in accordance with an aligned ISA and comprising aligned processor code for the processor and aligned accelerator code for the accelerator;

performing a first linking pass on the aligned assembled code, the first linking pass comprising relocating a first relocation target residing in the aligned accelerator code, wherein the first relocation target is a memory space maintaining an address of a first object outside the aligned accelerator code;

generating unaligned assembled code semantically equivalent to the aligned assembled code, in accordance with the unaligned ISA, the unaligned assembled code representing the source code and comprising unaligned processor code for the processor and unaligned accelerator code for the accelerator;

wherein at least a portion of the unaligned assembled code semantically equivalent to the aligned assembled code is not byte-aligned, wherein the aligned assembled code comprises padding to achieve byte-alignment, and wherein generating the aligned assembled code representing the source code comprises:

generating the unaligned assembled code based on the source code; and

padding the unaligned assembled code with blank bits configured to shift instructions in the unaligned assembled code to byte-aligned positions;

performing a second linking pass on the unaligned assembled code semantically equivalent to the aligned assembled code, the second linking pass comprising relocating a second relocation target residing outside the unaligned accelerator code, wherein the second relocation target is a memory space maintaining an address of a second object in the unaligned accelerator code; and

outputting the executable file for the unaligned ISA based on the first linking pass and the second linking pass.

5. The computer program product of claim 4 , wherein the first linking pass further comprises relocating a third relocation target outside the aligned accelerator code that refers to no objects inside the aligned accelerator code.

6. The computer program product of claim 4 , wherein the second linking pass further comprises relocating a third relocation target outside the unaligned accelerator code that refers to a third object outside the unaligned accelerator code.

Assignments (3)
CONFIRMATORY LICENSE Recorded Dec 10, 2015
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: U.S. DEPARTMENT OF ENERGY
Reel/Frame 037259/0498 →
CORRECTIVE ASSIGNMENT TO CORRECT THE FIRST NAME OF THIRD INVENTOR PREVIOUSLY RECORDED ON REEL 035251 FRAME 0601. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jun 18, 2015
From: BERTOLLI, CARLO; O'BRIEN, JOHN K.; SALLENAVE, OLIVIER H.; SURA, ZEHRA N.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 035955/0786 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 25, 2015
From: BERTOLLI, CARLO; O'BRIEN, JOHN K.; SALLENAVE, OLIVER H.; SURA, ZEHRA N.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 035251/0601 →
Continuity (1)
Related Publication 20160283209A1 · Sep 29, 2016