Method and apparatus for merging instructions to be processed, and non-transient computer-readable storage medium
AssigneeBeijing Xiaomi Mobile Software Co., Ltd.
InventorsJun Zhang, Xinghui Li
Life of this patent
Estimating the term…
Abstract
Provided in the present disclosure are a data access method and apparatus, and a non-transient computer-readable storage medium. The method includes: acquiring a plurality of instructions to be processed, wherein each of the instructions to be processed includes an address to be accessed; determining instructions to be merged from among the plurality of instructions to be processed, and performing merging processing on the instructions to be merged, so as to obtain a merged instruction; and performing data access according to an address to be accessed corresponding to the merged instruction.
Claims16
A data access method, applied to an electronic device, and the method comprising:
- acquiring a plurality of instructions to be processed, wherein each of the instructions to be processed comprises an address to be accessed;
- determining instructions to be merged among the plurality of instructions to be processed, and performing merging processing on the instructions to be merged, to obtain a merged instruction;
- performing data access according to an address to be accessed corresponding to the merged instruction,
- wherein determining instructions to be merged among the plurality of instructions to be processed comprises:
- acquiring a first instruction, wherein the first instruction is any instruction among the instructions to be processed;
- traversing the instructions to be processed, except the first instruction, to obtain a second instruction, wherein an address to be accessed of the second instruction is indirectly continuous with an address to be accessed of the first instruction, and the address to be accessed of the second instruction is not continuous with the address to be accessed of the first instruction through addresses to be accessed of other instructions to be processed;
- and
- determining the second instruction and the first instruction as the instructions to be merged in response to the second instruction and the first instruction satisfying a first preset merging condition,
- wherein the method further comprises:
- acquiring a difference value between the address to be accessed of the second instruction and the address to be accessed of the first instruction, wherein the address to be accessed is a logical address;
- acquiring a preset storage unit size;
- and
- obtaining a storage interval according to the difference value and the preset storage unit size, wherein the storage interval indicates a distance between the address to be accessed of the first instruction and the address to be accessed of the second instruction.
A data access apparatus, applied to an electronic device, and the apparatus comprising:
- at least one processor;
- and
- a memory configured to store instructions executable by the at least one processor,
- wherein the at least one processor is configured to:
- acquire a plurality of instructions to be processed, wherein each of the instructions to be processed comprises an address to be accessed;
- determine instructions to be merged among the plurality of instructions to be processed, and perform merging processing on the instructions to be merged, to obtain a merged instruction;
- perform data access according to an address to be accessed corresponding to the merged instruction;
- acquire a first instruction, wherein the first instruction is any instruction among the instructions to be processed;
- traverse the instructions to be processed, except the first instruction, to obtain a second instruction, wherein an address to be accessed of the second instruction is indirectly continuous with an address to be accessed of the first instruction, and the address to be accessed of the second instruction is not continuous with the address to be accessed of the first instruction through addresses to be accessed of other instructions to be processed;
- and
- determine the second instruction and the first instruction as the instructions to be merged in response to the second instruction and the first instruction satisfying a first preset merging condition;
- acquire a difference value between the address to be accessed of the second instruction and the address to be accessed of the first instruction, wherein the address to be accessed is a logical address;
- acquire a preset storage unit size;
- and
- obtain a storage interval according to the difference value and the preset storage unit size, wherein the storage interval indicates a distance between the address to be accessed of the first instruction and the address to be accessed of the second instruction.
A non-transient computer-readable storage medium, having a computer program stored thereon, wherein the program implements steps of a data access method, when executed by a processor, wherein the method is applied to an electronic device and comprises:
- acquiring a plurality of instructions to be processed, wherein each of the instructions to be processed comprises an address to be accessed;
- determining instructions to be merged among the plurality of instructions to be processed, and performing merging processing on the instructions to be merged, to obtain a merged instruction;
- performing data access according to an address to be accessed corresponding to the merged instruction,
- wherein determining the instructions to be merged among the plurality of instructions to be processed comprises:
- acquiring a first instruction, wherein the first instruction is any instruction among the instructions to be processed;
- traversing instructions to be processed, except the first instruction, to obtain a second instruction, wherein an address to be accessed of the second instruction is indirectly continuous with an address to be accessed of the first instruction, and the address to be accessed of the second instruction is not continuous with the address to be accessed of the first instruction through addresses to be accessed of other instructions to be processed;
- and
- determining the second instruction and the first instruction as the instructions to be merged, in response to the second instruction and the first instruction satisfying a first preset merging condition,
- wherein the method further comprises:
- acquiring a difference value between the address to be accessed of the second instruction and the address to be accessed of the first instruction, wherein the address to be accessed is a logical address;
- acquiring a preset storage unit size;
- and
- obtaining a storage interval according to the difference value and the preset storage unit size, wherein the storage interval indicates a distance between the address to be accessed of the first instruction and the address to be accessed of the second instruction.
Dependencies are inferred from the claim text.