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

A kind of instruction address adaptive relocation method and program compilation 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 delays, highlighting substantive features, and reducing read data delays

Active Publication Date: 2022-07-08
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
  • A kind of instruction address adaptive relocation method and program compilation method
  • A kind of instruction address adaptive relocation method and program compilation method
  • A kind of instruction address adaptive relocation method and program compilation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0045] like figure 1 As shown, the technical solution of the present invention provides an instruction address adaptive relocation method, which uses 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 executable target files and configuration information;

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

[0048] S1-3: After the executable object file is divided, the corresponding memory space is divided 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-address each segment in the executable target file, and finally perform target linking, and output the optimized executable target file.

[0051] In this method, a processing process is added after the linking stage. In this embodiment, the prepro...

Embodiment 2

[0053] like figure 2 As shown, the technical solution of the present invention provides an instruction address adaptive relocation method, the executable object file generated in the linking stage of the program compilation process is used as the source file, and the method includes the following steps:

[0054] S2-1: Read the executable object file and configuration information; it should be noted that the configuration information includes memory configuration information and optimized configuration information; first, the configuration information is given according to the characteristics of the memory used. For the memory configuration information, see image 3 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 during the program compilation process, and the optimization strength ranges from 0 to n (n=1, 2,...

Embodiment 3

[0067] like Figure 4 As shown, this embodiment provides a method for compiling a program. In this embodiment, a gcc compiler in a linux environment is used 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 phase, the compiler checks the normativeness of the code and determines that the syntax is correct, and then translates the code into assembly language;

[0070] S3-3: The assembler in the assembly stage converts the assembly language into binary object code, where the object code includes relocatable object files, executable object code and sharable object code;

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

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 present invention provides an instruction address adaptive relocation method and a program compilation method. The executable object file generated in the linking stage of the program compilation process is used as a source file, and the relocation method includes the following steps to read the executable object file and configuration information ; Divide the code segment and data segment in the executable object file; after the executable object file is divided, divide the corresponding memory space according to the size of each segment; calculate the actual target value; the actual target value is less than the set target When the value is set, relocate each segment in the executable object file, and finally perform the object linking, and output the optimized executable object file.

Description

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

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 Patents(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