Computer with cache pre-load

Abstract: A computer comprises a main memory for storing a plurality of data, a cache memory for temporarily storing a portion of the plurality of data, a processor for accessing data stored in the cache memory and processing the data according to instructions. The processor has an access instruction combined with a pre-load instruction, and an access instruction only for accessing data, and includes means for indicating a pre-load condition to the cache memory when the processor accesses data from the cache memory according to the access instruction combined with the pre-load instruction. The cache memory pre-loads data to be accessed next by the processor from the main memory when the processor indicates the pre-load condition.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a computer, and more specifically to a cache memory contained in a computer for effectively pre-loading array data of a matrix from a main memory to the cache memory. Discussion of the Related Art In a computer, a cache memory is located between a processor and a main memory. The cache memory stores a portion of the data stored in main memory, along with corresponding addresses of the portion of data from the main memory. The capacity of the cache memory is typically small, compared to that of main memory, but its access speed is comparatively quite high. A processor reads data from the cache memory, processes the data, and writes the processed data into the cache memory. Access time (both read and write) of the computer can thus be reduced, in comparison with the access time required to access the main memory directly. When the cache memory receives an access request (or access address) from the processor, the cache memory first checks whether the data corresponding to the access address are stored in the cache memory or not. If the data are not stored in the cache memory, the cache memory sends the access address to the main memory, and transfers the respective data corresponding to the respective access address from the main memory back to cache memory. In related devices, one block of data, including the data which corresponds to the access address, are transferred and stored in the cache memory. For example, one block of data usually consists of four sets of data corresponding to four continuous addresses. In this case, if the processor accesses continuous addresses in order, the processor will read continuous data from the cache memory in order. However, if the processor accesses addresses in a dispersed manner, a frequent result is that data corresponding to the respective access address are not stored in the cache memory. The cache memory must then transfer the required data from the main memory at that time. The processor often executes a matrix calculation by sequentially reading out an array data in a matrix format from the cache memory. The address area of this array data is usually longer than the capacity of the cache memory permits. Accordingly, the offset (interval) of the access address of the array data is very large. For example, the processor will read out an array data corresponding to address 0. Next, the processor will read out an array data corresponding to address 64, third, the processor will read out an array data corresponding to address 128. In this case, the offset of the access address (or address interval) is 64. However, the array data corresponding to the address area (0 ∼ 128) cannot be stored in the cache memory at one time, because, as mentioned earlier, the capacity of the cache memory is quite small. Therefore, whenever the processor accesses the array data from the cache memory, the cache memory must first transfer the array data from main memory. Obviously, some time is consumed during this transfer. During the transfer period, the processor is forced to wait, without being able to process data. To prevent the above-mentioned defect, when the cache memory does not store the data corresponding to the respective access address, a method has been considered of having the cache memory transfer a block which includes the data corresponding to the respective access address, and also the next sequential data block. For example, if the present access address requested by the processor is 0, a first data block corresponding to address (0 ∼ 3), along with the next data block corresponding to address (4 ∼ 7), are both transferred from main memory to cache memory. This -device operates on a prediction that the next data block will be accessed following the first data block. That is, in this device, the next data block neighboring the first access address is simply transferred from main memory to cache memory. As mentioned above, if the processor accesses array data of a matrix sequentially, the offset of the access address of the array data will also be large (for example, 64, 128). Accordingly, the next data block neighboring the first access address may not include the array data which the processor needs to access next. Moreover, in this device, the cache memory transfers the next block of data with the first block of data, including data corresponding to the present access address, only when the cache imemory does not already store the data corresponding to the present access address. In short, if the cache memory happens to already store the data corresponding to the present access address, the cache memory will not transfer the neighboring data which may be accessed in the future. Therefore, even if the cache memory unexpecetedly stores data corresponding to the present access address, it often happens that the cache memory does not store the data corresponding to the next access address when the processor needs to access the next array data. As also mentioned above, in the prior device, when the processor sequentially accesses the array data of a matrix from the cache memory, it often happens that the cache memory does not store the array data whose offset is large, and the cache memory must transfer the array data from the main memory. WO 89/06397 discloses an arrangement including a main memory, a cache memory, and a processor which accesses an array data item from the cache in accordance with an access instruction including a pre-load instruction made up of a base-address and an offset. SUMMARY OF THE INVENTION It is an object of the present invention to provide a computer, including a cache memory, which can effectively pre-load an array data, including the data which the processor will access next in succession, from the main memory to the cache memory. Accordingly the present invention provides a computer comprising: a main memory for storing a plurality of array data each corresponding to a respective address; a cache memory for loading and temporarily storing a portion of said plurality of array data in said memory in order; and a processor for accessing said portion of said plurality of array data stored in the cache memory and for processing said portion of said plurality of array data according to a processing instruction; wherein the processor has an access instruction combined with a pre-load instruction which includes a base-address and an offset as operands, and wherein the base-address is a target address of the access instruction and the offset is an address interval between two array data, to be accessed in succession, in the main memory; characterized in that the processor includes means for indicating a pre-load signal and a pre-load address according to the base address and the offset to the cache memory when the processor accesses a first array data item from the cache memory according to the access instruction combined with the pre-load instruction, wherein, in response to said pre-load signal, said cache memory pre-loads a second array data item from the main memory according to the pre-load address, said second array data item being data to be accessed next in succession by the processor. The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate a preferred embodiment of the invention. Together with the general description given above and detailed description given below, they serve to explain the principles of the invention. BRIEF DESCRIPTION OF DRAWINGS Figure 1 is a block diagram representing a computer, including a cache memory; Figure 2 is a flowchart of the method for compiling a source program to an object program; Figure 3A is an example of a source program, including a matrix operation; Figure 3B is an example of object program compiled from source program shown in Fig. 3A according to the prior art; Figure 3C is an example of an object program compiled from the source program shown in Fig. 3A; Figure 4 is a circuit-block diagram of the processor shown in Fig. 1; Figure 5 depicts an instruction format; Figure 6 depicts register information for limiting a pre-load in the cache memory; Figure 7A is an example of an array data in a matrix format; Figure 7B depicts the array data stored in main memory; Figure 7C is a time chart depicting pre-loading of the array data according to the prior art; Figure 7D is a time chart depicting pre-loading of the array data according to the present invention; and Figure 8 is a representative graph depicting operation of the cache memory according to the preferred embodiment. DESCRIPTION OF THE PREFERRED EMBODIMENTS Figure 1 is a block diagram depicting a computer, including a cache memory, in accordance with the present invention. As embodied in Fig. 1, a processor 12 executes instructions of an object program, which was compiled from a source program, A main memory 20 stores a plurality of data corresponding to respective data addresses in order. A cache memory 30 is located between processor 12 and main memory 20. Cache memory 30 comprises a data memory section 32, having a capacity which is smaller, but an access speed which is higher than that of main memory 20. Cache memory 30 further comprises memory control section 34 for controlling access to the data memory section 32. The data memory section 32 is capable of storing a portion of the plurality of data stored in main memory 20. The portion of data is a copy of data by block unit, and is stored in cache memory 30 with its corresponding data address. In the computer as embodied in Fig. 1, the processor 12 accesses data (in the format of a read/write request) in the cache memory 30 according to an access instruction. When this occurs, memory control section 34 checks whether any data corresponding to the required access address are included in the data memory section 32 or not. If the data are included in the data memory section 32 (referred to as a "hit"), the memory control section 34 reads out the data corresponding to the access address from the data memory section 32, or writes the data to the access address in the data memory section 32. If the data are not included in the data memory section 32 (referred to as a "cache miss"), the memory control section 34 accesses the main memory 20 and loads a data block, including data corresponding to the access address, from the main memory 20 to data memory section 32. Next, memory control section 34 proceeds to access the request from the processor 12. When the new data block is loaded to the data memory section 32, another data block, specifically that data block which has been stored for the longest time in the data memory section 32, is displaced back to the main memory 20. In accordance with the present invention, processor 12 has a second access instruction, which is usually in the form of a read/write request, combined with a pre-load instruction of which data are to be accessed next in succession. The next data are loaded from main memory 20 to data memory section 32. The processor 12 indicates a pre-load condition to the memory control section 34 when the processor accesses the cache memory 30 according to the second access instruction combined with the pre-load instruction. Compiler software is provided for generating object instructions from source instructions. As embodied in Fig. 4, compiler 80 has the following characteristics. When compiler 80 detects loop instructions for accessing an array data sequentially, compiler 80 generates the second access instruction combined with the pre-load instruction, instead of the normal first access instruction. When processor 12 accesses cache memory 30 according to the second access instruction combined with pre-load instruction, processor 12 indicates the pre-load condition to cache memory 30 by outputting a pre-load signal (PL) and a pre-load address (PL-ADR). Memory control section 34 in cache memory 30 pre-loads the data corresponding to the pre-load address (PL-ADR) only when the memory control section 34 receives pre-load signal (PL). In the source instructions shown in Fig. 3A, a matrix of "a", "b", "ab" consists of (64 x 64) elements respectively. ab[i][j] = a [i][k] x b [k][j] In the above formula, the value of ab[i][j] is determined by the product of a[i][k] and b[k][j], with the condition that parameters "k", "j", and "i" are respectively changed from "0" to "63". In the object program according to the prior art, shown in Fig. 3B, the following instructions are given to load data from the cache memory to the processor. lw $24, 0($3) lw $25, 0($4) In these instructions, "$24," "$25", "$3", "$4" means respectively number of registers in the processor. "($3)", "($4)" means that the address is stored in register "$3" and "$4". Therefore, instruction (1) requires loading data corresponding to address stored in register "$3" from cache memory, storing the data in register "$24". Instruction (2) is similar to instruction (1). In Fig. 3B, the following instructions calculate the next access address by offset. addu $3, $3, 1 addu $4, $4, 64 Instruction (3) requires increasing the address stored in the register "$3" by 1 and storing the address in register "$3" again. Instruction (4) is similar to instruction (3). In the object instruction shown in Fig. 3B, an instruction to load data corresponding to the present access address and an instruction to calculate the next access address are separate. In short, a pre-load instruction to load data corresponding to the next access address is not included in these object instructions. However, in the object program for use with the present invention, as shown in Fig. 3C, the following instructions are to load data corresponding to the present access address and to pre-load data corresponding to the next access address. lwa $24, 1($3) lwa $25, 64($4) Instruction (5) requires loading data corresponding to the address stored in register "$3", to store the data in register "$24" and to increase the address stored in register "$3" by 1. Instruction (6) is similar to instruction (5). In the object program shown in Fig. 3C, instruction "lwa" is used as a combination of instruction "lw" and "addu", shown in Fig. 3B. Therefore, when processor 12 executes instruction "lwa", the processor 12 can access data corresponding to the present access address from cache memory 30 and send the next access address to the cache memory 30 (described in greater detail below). Figure 2 illustrates the compiling process. It is assumed that the source program shown in Fig. 3A is supplied to a computer. Initially, compiler means 80 (software) detects a series of loop instructions for accessing an array data sequentially from the source program (step 21 in Fig. 2). In this source program, shown in Fig. 3A, loop instructions are included. "a[i][K]", "b[K][j]" are examples of array data to be accessed sequentially according to parameter "i", "j", "k". Therefore, this part is detected. Next compiler means 80 extracts a loop order of parameters in the loop instructions (step 23, in Fig. 2). In this case, according to the order of the loop instruction, the loop order of the parameters is as follows i-----> j-----> K Next, compiler means 80 extracts the parameter order of each right term of the formula in part (step 25 in Fig. 2). In this case, each right term of formula is "a[i][K]", "b[K][j]". Therefore, parameter order is as follows. a: i------->K b: K------->j Compiler means 80 checks whether the direction of the loop order of the parameters is equal to the direction of the parameter order of the right term or not (step 27 in Fig. 2). As for the right term "a[i][K]", directions (7) and (8) are equal. The minimum dimension of the array data is "1". Therefore, compiler means 80 determines that the offset is "1" and generates a pre-load instruction combined with the second access instruction "lwa $24, 1($3)." (Step 29 in Fig. 2) As for the right term "b[K][j]", directions (7) and (9) are not equal. The maximum dimension of the term is "64" because of "b[64][64]" in the source program. Therefore, compiler means 80 determines that the offset is "64" and generates a pre-load instruction combined with the second access instruction "lwa $25, 64($4)". (Step 31 in Fig. 2) When the entire source program is checked to detect the loop instructions for accessing the array data, the above-mentioned processing is completed (Step 33 in Fig. 2). In Fig. 1, when cache memory 30 is accessed by processor 12, memory control section 34 examines whether the pre-load control signal PL is present or not. If the pre-load control signal PL is not present, the memory control section 34 processes as usual. If the pre-load control signal PL is present, memory control section 34 accesses data corresponding to the present access address from data memory section 32 and sends the data to the processor 12. After the memory control section 34 finishes accessing data, the memory control section 34 pre-loads that data corresponding to the pre-load address, which is sent by the processor 12, from main memory 20. In short, a data block including the data corresponding to the pre-load address is read from the main memory 20 and is transferred to the data memory section 32. Figure 4 is a block diagram of processor 12 shown in Fig. 1 in accordance with the present invention. Figure 5 depicts an instruction format in accordance with the present invention. By using Fig. 4 and 5, operation of processor 12 is explained in detail. In Fig. 4, when instructions to be executed by processor 12 are stored in main memory 20, the instructions have already been compiled to object instructions. As mentioned earlier, these object instructions include a second access instruction combined with a pre-load instruction. As broadly embodied in Fig. 4, at the initialization mode, a series of instructions to be executed by processor 12 are transferred from main memory 20 to an instruction cache memory 41, It is assumed that the access instruction is fetched from instruction cache memory 41 to instruction register 43. Instruction decoder 45 decodes the instruction sent from instruction register 43 and sends the instruction, which is divided into elements, to pipeline register 47. In this place, the access instruction is combined with a pre-load instruction consisting of four elements shown in Fig. 5. This instruction consists of an operation code, a register number, a base address and an offset. For example, as for the access instruction combined with the pre-load instruction in fig. 3C, "lwa $25, 64($4)" "lwa" is an operation code, "$25" is a register number "($4)" is a base address, "64" is an offset. The pipeline register mates a pre-load detection signal "on" through line 49 according to operation code "lwa". Offset "64" is supplied to pre-load address generation section 51 through line 48. "$25" and "($4)" are supplied to register file 53 through line 55. The base address stored is register "$4" is read from register file 53. The base address is transferred to ALU 57 and pre-load address generation section 51 through line 59. The base address is transferred to access address register 61 through ALU 57. The base address in the access address register 61 is sent to memory control section 34. The memory control section 34 accesses data corresponding to the above address from data memory section 32. The data, which is accessed by the memory control section 34, is stored in register "$25" of register file 53 through line 50. At the same time, ALU 57 adds the base address, which is received through line 59, to offset "64" which is received through selector 58. Then ALU 57 stores the addition result, which is a new base address, in register "$4" of register file 53 through line 60. On the other hand, pre-load generation section 51 adds the base address, which was received through line 59, to offset "64". Then, the addition result, which is a pre-load address, is sent to memory control section 34 through pre-load address register 62. At the same time, pre-load address generation section 51 sends a pre-load signal to memory control section 34 through line 52. Therefore, the memory control section 34 sends the pre-load address to main memory 20. Then, data corresponding to the pre-load address are transferred from main memory 20 to data memory section 32. Simultaneously, pipeline register 47 tends a signal to read out the next instruction to program counter control section 65 through line 64. The instruction address, which is incremented by "1", is sent to instruction cache control section 42 through program counter 67. Therefore, the next instruction is read out from instruction cache 41 to instruction register 43. Hence, the ALU supplies a jump address through line 66 according to the operation result. In this case, the jump address is supplied to instruction cache control section 42 through program counter control section 65 and program counter 67. Then an instruction corresponding to the jump address is read out from instruction cache 41 to instruction register 43. When an operation instruction other than an access instruction is executed by the processor, the processor processes as follows. It is assumed that instruction "mul $8, $24, $25" is fetched to pipeline register 47. Operation code "mul" is supplied to ALU 57 through line 56. Register number "$8, $24, $25" is supplied to register file 53 through line 55. Then, data stored in register "$24" is transferred from register file 53 to ALU 57 through line 59. Data stored in register "$25" is transferred from register file 53 to ALU 57 through line 63 and selector 58. ALU 57 multiplies the data corresponding to register $24" with the data corresponding to register "$25". Then ALU 57 stores the multiplication result in register "$8" of register file 53. Figure 6 displays mode information for limiting a pre-load in Memory control section 34. This mode information consists of a bit field "INH" for inhibiting pre-load, and an address limit for permitting pre-load. The address limit is the first address and last address in which data can be pre-loaded. When memory control section 34 receives the pre-load signal and pre-load address from pre-load address generation section 51, the memory control section 34 checks whether a pre-load is inhibited or not according to "INH." (For example, when processor 12 executes instructions for debugging, flag "INH" is set by "1" because it is not necessary for the debug to be executed quickly.) If flag "INH" is not set by "1", the memory control section 34 checks whether the pre-load address within the address limit for permitting pre-load. For example, it is assumed that all of the array data of the matrix are stored in region "A" of main memory 20 and other data are stored in region "B" of main memory 20. In this case, the first address and last address of region "A" is stored as address limit in memory control section 34. if the pre-load address is within the address limit for permitting a pre-load, the memory control section 34 accesses the pre-load address in main memory 20. Then, the data block including the data corresponding to the pre-load address is transferred from main memory 20 to cache memory 30 and stored in data memory section 32. Data which processor 12 accesses next is pre-loaded from main memory 20 to cache memory 30 while processor 12 executes the present access instruction. When processor 12 executes the second access instruction combined with the pre-load instruction, a pre-load signal and a pre-load address are sent to memory control section 34 in Fig. 4. However, only the pre-load signal may be sent to memory control section 34. In this case, memory control section 34 memorizes the access address sent by access address register 61 in order. When the pre-load signal is supplied by the pre-load address generation section 51, memory control section 34 calculates an offset (differences) between the present access address and the previous access address. Then, the section 34 adds the offset to the present access address as a pre-load address. Therefore, the section 34 can pre-load data from main memory 20 to data memory section 32 according to the pre-load address. Figure 7A is an example of an array data in a matrix format. Figure 7B depicts the array data as it is stored in main memory 20. Figure 7C is a time chart depicting pre-loading the array data according to the prior art. Fig. 7D is a time chart depicting pre-loading the array data according to the present invention. By using Figs. 7A, 7B, 7C and 7D, the pre-loading operation can be explained in detail. Matrix A and B consist of nine elements (array data), respectively, as shown in Fig. 7A. Nine Corresponding elements of matrix C are determined by multiplication of matrix A and B. To calculate an element of matrix C, necessary elements of matrix A are successive. For example, to calculate C 1 elements A 1 , A 2 , A 3 of matrix A are used. However, necessary elements of matrix B are dispersed. For example, to calculate C 1 , elements B 1 , B 4 , B 7 of matrix B are used. These elements of matrix A and B are stored in main memory 20 as shown in Fig. 7B. In region A of main memory 20, elements (A 1 , A 2 , A 3 ...) of matrix A are stored in order. In region B of main memory 20, elements (B 1 , B 2 , B 3 ....) of matrix B are stored in order. Fig. 7C is a time chart of the method of pre-loading elements of a similar matrix according to the prior art. In Fig. 7C the processor calculates C 1 of matrix C by using A 1 , A 2 , A 3 of matrix A and B 1 , B 4 , B 7 of matrix B according to the following formula. Cache memory does not store these elements at the beginning. C 1 = A 1 B 1 + A 2 B 4 + A 3 B 7 Initially, the processor attempts to access A 1 in cache memory. Cache memory does not store A 1 . Therefore, cache memory loads A 1 from main memory and pre-loads A 2 which is the next data after A 1 . The processor reads out A 1 from cache memory. Next, the processor attempts to access B 1 in cache memory. Cache memory does not store B 1 . Therefore, cache memory loads B 1 from main memory and pre-loads B 2 which is the next data after B 1 . The processor reads out B 1 from cache memory and multiplies A 1 and B 1 , Next, the processor attempts to access A 2 in cache memory. Because A 2 has been pre-loaded, cache memory stores A 2 . Therefore, the processor can read out A 2 from cache memory. Next, the processor attempts to access B 4 from cache memory. Cache memory does not store B 4 . Therefore, cache memory must load B 4 from main memory, at the same time pre-loading B 5 which is the next data after B 4 . In short, in the prior art, whenever the processor accesses an eluent of matrix B, cache memory must always load that element from main memory. Accordingly, when the system attempts to access an array data (element) whose offset (address interval) is large, the prior method, which pre-loads the next sequential address data of the presently accessed data when cache-miss happens, is unsatisfactory. Fig. 7D is a time chart of the method for pre-loading elements of a matrix according to the present invention. In Fig. 7D, initially processor 12 accesses A 1 and a sends pre-load signal and pre-load address to cache memory 30. Cache memory 30 does not store A 1 . Therefore, cache memory 30 loads A 1 from main memory 20, and at the same time pre-loads A 2 according to the pre-load address. The processor 12 reads out A 1 from cache memory 30. Next, the processor 12 accesses B 1 and sends a pre-load signal and pre-load address to cache memory 30. Cache memory 30 does not store B 1 . Therefore, cache memory 30 loads B 1 from main memory 20 and at the same time pre-loads B 4 according to the pre-load address. The processor 12 reads out B 1 from cache memory 30 and multiplies A 1 and B 1 . Next, the processor 12 accesses A 2 and sends a pre-load signal and pre-load address to cache memory 30. Cache memory 30 stores A 2 , therefore, processor 12 reads out A 2 from cache memory 30 immediately. At the same time, cache memory 30 pre-loads A 3 according to the pre-load address from main memory 20. Next, the processor accesses B 4 and sends pre-load signal and pre-load address to cache memory 30. Cache memory 30 stores B 4 . therefore, processor 12 reads out B 4 from cache memory 30 immediately. At the same time, cache memory 30 pre-loads B 7 according to the pre-load address from main memory 20. In short, in the present invention, when processor 12 accesses an element of matrix B, processor 12 reads out the element from cache memory 30 immediately. Accordingly, when accessing an array data (element) whose offset (address interval) is large, the present invention, which pre-load the next data according to the pre-load address, very effective. When data corresponding to the pre-load address is pre-loaded from main memory 20 to cache memory 30, data (old data) which is already stored in cache memory 30 is replaced to main memory 20. In this case, in a program for calculating the array data of a matrix, processor 12 accesses not only array data but also the other data in cache memory 30. For example, in fig. 3C, the other data are stored in register "$5" (store address for calculation result). The other data in cache memory 30 are accessed frequently by processor 12 when processor 12 executes the program for calculating the array data of a matrix. Therefore, if new array data is pre-loaded to cache memory 30 in order, it happened that the other data are replaced reluctantly from cache memory 30. To prevent this defect, data memory section 32 is divided into plural areas. Each area is called a "way." Pre-loading of data is controlled for each way. For example, as embodied in Fig, 8, data memory section 32 is divided into four ways, which are from way [0] to way [3]. Only three way which are from way [0] to way [2] comprise areas to write pre-loaded data and to replace old data. Way [3] is an area to write the other data. Accordingly, pre-loaded array data (new array data) are written in one of three ways from way [0] to way [2] and old array data corresponding to address, which new array data are written, are replaced to main memory 20. As shown in Fig. 8, four addresses "00" "01" "10" "11" are assigned to each way. When data corresponding to an access address are read out from main memory 20, the data are written an address of way, corresponding to low order two bit of the access address. For example, an array data are accessed from cache memory 30 according to following instructions shown in fig. 3C. lwa $24, 1($3) lwa $25, 64($4) It is assumed that the address stored in register ($3) is "00" and the address stored in register ($4) is "1000000000000 (=2 12 )." Data corresponding to address "00" is accessed from cache memory 30. But at the beginning, cache memory 30 does not store the data. Therefore, memory control section 34 reads out data corresponding to address "00" from main memory 20. The data are written in address "00" of way [0]. Then, the data are stored in register "$24" of register file 53. At the same time, memory control section 34 reads out data corresponding to pre-load address "01" from main memory 20 (because present access address "00" + offset "1" = pre-load address "01"). The pre-loaded data are written in address "01" of way [0]. Next, data corresponding to address "(2 12 )" is accessed from cache memory 30. But at the beginning, cache memory 30 does not store the data. Therefore, memory control section 34 reads out data corresponding to address "(2 12 )" from main memory 20. The data are written in address "00" of way [1]. Then, the data are stored in register "$25" of register file 53. At the same time, memory control section 34 reads out data corresponding to pre-load address "1000001000000 (=2 12 +2 6 )" from main memory 20 (because, present access address "2 12 " + offset "64=(2 6 )" = pre-load address (=2 12 +2 6 )). The pre-load data are written in address "00" of way [1]. At that time, the data corresponding to address "(2 12 )" (old array data) are erased. But this is not a problem because the old array data were already stored in register "$25" and the old array data are not used for a while after the old array data are used for calculation. In the ways, an array data of matrix A are stored in way [0] in order, while an array data of matrix B are stored in way [1] in order. The other data except array data are stored in way [3]. In short, pre-load and replacement (erase) are executed among only array data in a predetermined way in cache memory 30. The other data except for array data are left in way [3] of cache memory 30. Therefore, array data, which are accessed by processor 12 next, can be pre-loaded effectively without replacing the other necessary data from cache memory 30. Additional advantages and modifications will readily occur to those skilled in the art. The invention in its broader aspects is not limited to the specific details shown and described, but only as defined in the appended claims.

Claims: A computer comprising: a main memory (20) for storing a plurality of array data each corresponding to a respective address; a cache memory (30) for loading and temporarily storing a portion of said plurality of array data in said memory in order; and a processor (12) for accessing said portion of said plurality of array data stored in the cache memory and for processing said portion of said plurality of array data according to a processing instruction; wherein the processor has an access instruction combined with a pre-load instruction which includes a base-address and an offset as operands, and wherein the base-address is a target address of the access instruction and the offset is an address interval between two array data, to be accessed in succession, in the main memory; characterized in that the processor (12) includes means (47, 51, 62) for indicating a pre-load signal (52) and a pre-load address according to the base address and the offset to the cache memory (30) when the processor (12) accesses a first array data item from the cache memory (30) according to the access instruction combined with the pre-load instruction, wherein, in response to said pre-load signal, said cache memory pre-loads a second array data item from the main memory according to the pre-load address, said second array data item being data to be accessed next in succession by the processor. A computer according to claim 1, wherein the cache memory pre-loads said second array data item to be accessed next, immediately after the processor accesses said first array data item stored in the cache memory according to the base-address. A computer according to claim 1, wherein the cache memory includes means for memorizing an address formerly accessed in order by the processor, and for determining a pre-load address according to the address accessed by the processor when the processor indicates the pre-load signal. A computer according to claim 1, wherein the cache memory includes means for memorizing mode-information indicating whether pre-load should be permitted or not, and means for determining whether pre-load is executed or not according to the mode-information when the processor indicates the pre-load signal. A computer according to claim 4, wherein the cache memory further includes means for memorizing address limit information indicating which corresponding array data should be pre-loaded, and means for executing a pre-load if the pre-load address is within the address limits when the processor indicates the pre-load signal.

Inventors: AIKAWA TAKESHI, MINAGAWA KENJI, SAITO MITSUO, AIKAWA, TAKESHI, MINAGAWA, KENJI, SAITO, MITSUO, Aikawa, Takeshi, c/o Intellectual Prop. Div., Minagawa, Kenji, c/o Intellectual Prop. Div., Saito, Mitsuo, c/o Intellectual Prop. Div.
Applicants: TOSHIBA KK, KABUSHIKI KAISHA TOSHIBA
Application year: 1991
Main classification: G06F12
IPC codes: G06F12, G06F9