Data prefetching apparatus in a data processing system and method therefor
First Claim
1. A data processing system for prefetching data for loading into a cache in response to a parameter-selectable prefetch instruction, comprising:
- detection means for detecting if the parameter-selectable prefetch instruction has parameters that indicate that a portion of the data is to be prefetched at least twice for the cache during a prefetch operation specified by the parameter-selectable prefetch instruction; and
at least one of the following;
modification means for altering the parameters of the parameter-selectable prefetch instruction to avoid prefetching the data at least twice during the prefetch operation; and
prevention means for preventing the prefetching of the data at least twice by the parameter-selectable prefetch instruction during the prefetch operation.
22 Assignments
0 Petitions
Accused Products
Abstract
A data processing system (20) is able to perform parameter-selectable prefetch instructions to prefetch data for a cache (38). When attempting to be backward compatible with previously written code, sometimes performing this instruction can result in attempting to prefetch redundant data by prefetching the same data twice. In order to prevent this, the parameters of the instruction are analyzed to determine if such redundant data will be prefetched. If so, then the parameters are altered to avoid prefetching redundant data. In some of the possibilities for the parameters of the instruction, the altering of the parameters requires significant circuitry so that an alternative approach is used. This alternative but slower approach, which can be used in the same system with the first approach, detects if the line of the cache that is currently being requested is the same as the previous request. If so, the current request is not executed.
53 Citations
21 Claims
-
1. A data processing system for prefetching data for loading into a cache in response to a parameter-selectable prefetch instruction, comprising:
-
detection means for detecting if the parameter-selectable prefetch instruction has parameters that indicate that a portion of the data is to be prefetched at least twice for the cache during a prefetch operation specified by the parameter-selectable prefetch instruction; and
at least one of the following;
modification means for altering the parameters of the parameter-selectable prefetch instruction to avoid prefetching the data at least twice during the prefetch operation; and
prevention means for preventing the prefetching of the data at least twice by the parameter-selectable prefetch instruction during the prefetch operation. - View Dependent Claims (2, 3, 4)
the data processing system comprises the modification means; and
the detection means compares the parameters to predetermined parameter sets that are known to select redundant data.
-
-
3. The data processing system of claim 2, wherein the modification means comprises substitute parameters corresponding to each of the predetermined parameter sets.
-
4. The data processing system of claim 1 comprising the modification means and the prevention means.
-
5. A data processing system for prefetching data for loading into a cache in response to a parameter-selectable prefetch instruction, comprising:
-
detection means for determining if the parameter-selectable instruction has a first programmed condition that causes fetching of redundant data during a prefetch operation; and
execution means, coupled to the detection means, for executing the instruction by generating cache line requests, in response to the parameter-selectable prefetch instruction, that are mutually exclusive in order to avoid fetching redundant data during the same prefetch operation. - View Dependent Claims (6, 7, 8, 9, 10, 11)
substitute parameters corresponding to each of the predetermined parameter sets. -
9. The data processing system of claim 5, wherein the execution means comprises prevention means for preventing a request for a line in the cache if a previous request for the line in the cache by the parameter-selectable prefetch instruction was made during the prefetch operation.
-
10. The data processing system of claim 5, wherein the execution means comprises prevention means for preventing a request for a line in the cache if an immediately preceding request was for the line in the cache during prefetch operation.
-
11. The data processing system of claim 5, wherein the execution means comprises:
-
prevention means for preventing a request for a line in the cache if a previous request for the line in the cache by the parameter-selectable prefetch instruction was made during the prefetch operation; and
modification means for altering the parameters of the parameter-selectable prefetch instruction to avoid prefetching redundant data during the prefetch operation.
-
-
-
12. In a data processing system, a method for prefetching blocks of data for loading into a cache in response to a parameter-selectable prefetch instruction, comprising:
-
determining if the parameter-selectable prefetch instruction has a first programmed condition that causes fetching of at least a portion of a prefetched block of data at least twice during prefetching of the block data; and
executing the parameter-selectable prefetch instruction by generating cache line requests, in response to the parameter-selectable prefetch instruction, that are mutually exclusive in order to avoid fetching the at least a portion of the prefetched block of data at least twice. - View Dependent Claims (13, 14, 15, 16, 17, 18)
modifying the parameters of the parameter-selectable prefetch instruction to avoid prefetching redundant data if the length exceeds the stride; and
preventing a request for a line in the cache if a previous request for the line in the cache by the parameter-selectable prefetch instruction was made.
-
-
19. In a data processing system, a method for prefetching data for loading into a cache, which has a line length, in response to a parameter-selectable prefetch instruction, which has a stride parameter, comprising:
-
receiving the parameter-selectable prefetch instruction;
detecting if the line length exceeds the stride parameter of the received parameter-selectable prefetch instruction;
modifying the stride parameter to equal the line length if the line length exceeds the stride parameter of the received parameter-selectable prefetch instruction to form a modified parameter-selectable prefetch instruction; and
executing the modified parameter-selectable prefetch instruction. - View Dependent Claims (20, 21)
the parameter-selectable prefetch instruction further has a number-of-blocks parameter; and
the step of modifying further comprises modifying the number-of-blocks parameter if the line length exceeds the stride parameter of the received parameter-selectable prefetch instruction.
-
-
21. The method of claim 20, further comprising:
preventing a request for a line in the cache if a previous request for the line in the cache by the parameter-selectable prefetch instruction was made.
Specification