Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Instruction address self-adaptive relocation method and program compiling method

A technology of instruction address and program compilation, which is applied in the field of program compilation, can solve problems such as reading data delays and reducing CPU execution efficiency, and achieve the effects of reducing the number of pre-charging operations, highlighting substantive features, and reliable design principles

Active Publication Date: 2020-06-19
INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] Compilers currently on the market do not perform targeted compilation according to the characteristics of the memory. They are independent during the compilation process. Some codes are often called by other functions in multiple stages or cyclically. In this way, it will Cause the CPU to frequently read this instruction, if this section of instruction requires multiple addresses to store, the CPU will delay reading data from the memory, thereby reducing the execution efficiency of the CPU, the present invention provides an adaptive relocation of instruction address Method and Program Compilation Method

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Instruction address self-adaptive relocation method and program compiling method
  • Instruction address self-adaptive relocation method and program compiling method
  • Instruction address self-adaptive relocation method and program compiling method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0045] Such as figure 1 As shown, the technical solution of the present invention provides a method for adaptive relocation of instruction addresses, using the executable object file generated in the linking stage of the program compilation process as the source file, and the method includes the following steps:

[0046] S1-1: Read the executable target file and configuration information;

[0047] S1-2: slicing the code segment and data segment in the executable object file;

[0048] S1-3: After the executable target file is divided, divide the corresponding memory space according to the size of each segment;

[0049]S1-4: Calculate the actual target value;

[0050] S1-5: When the actual target value is less than the set target value, re-locate the address of each segment in the executable target file, and finally perform target linking, and output the optimized executable target file.

[0051] This method is to add a processing process after the linking stage. In this embo...

Embodiment 2

[0053] Such as figure 2 As shown, the technical solution of the present invention provides a method for self-adaptive relocation of instruction addresses. The executable target file generated in the linking stage of the program compilation process is used as the source file. The method includes the following steps:

[0054] S2-1: Read the executable target file and configuration information; it should be noted that the configuration information includes memory configuration information and optimization configuration information; firstly, according to the characteristics of the memory used, the configuration information is given. For memory configuration information, see image 3 As shown; the optimization configuration can be passed through parameters when compiling, and the optimization configuration information includes the optimization strength and the number of iterations set in the compilation stage of the program compilation process, and the optimization strength is from...

Embodiment 3

[0067] Such as Figure 4 As shown, this embodiment provides a program compilation method. In this embodiment, the gcc compiler under the linux environment is taken as an example (the compiler is not limited here). To compile a C program, the compilation method includes the following steps:

[0068] S3-1: In the preprocessing stage, the preprocessor compiles the header files included in the C source code to form a preprocessing file;

[0069] S3-2: In the compilation stage, the compiler checks the standardization of the code and translates the code into assembly language after confirming that the syntax is correct;

[0070] S3-3: In the assembly stage, the assembler converts the assembly language into binary object codes, wherein the object codes include relocatable object files, executable object codes, and shareable object codes;

[0071] S3-4: Linking stage The linker links multiple relocatable object files into an executable object file; the linking process is a module as...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides an instruction address self-adaptive relocation method and a program compiling method, an executable target file generated in a link stage of a program compiling process is usedas a source file, and the relocation method comprises the following steps: reading the executable target file and configuration information; scribing a code segment and a data segment in the executable target file; after the executable target file is divided, dividing a corresponding memory space according to the size of each segment; calculating an actual target value; and when the actual targetvalue is smaller than the set target value, performing address re-positioning on each section in the executable target file, finally performing target linking, and outputting the optimized executabletarget file.

Description

technical field [0001] The invention relates to the technical field of program compilation, in particular to an instruction address self-adaptive relocation method and a program compilation method. Background technique [0002] The information stored and processed by modern computers is represented by binary signals. For computers, a program is a series of binary data streams, which enter the CPU for calculation in a pipelined manner. Mainly data transfer between CPU and memory. Most calculations use 8-bit blocks, or bytes, as the smallest addressable unit of memory. A program object is a byte collection of program data, instructions, and control information. When the compiler and system run, the storage space is divided into more manageable units to store program objects. [0003] Computers execute machine code, encoding low-level operations in sequences of bytes, including processing data, managing memory, reading and writing data on storage devices, and communicating ov...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/41G06F9/34G06F9/38
CPCG06F8/47G06F9/34G06F9/3802
Inventor 周玉龙刘同强李拓邹晓峰
Owner INSPUR SUZHOU INTELLIGENT TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products