Optimization of DGEMM Function for Loongson3B1500 Architecture
DGEMM function is the most important of Level3 functions in BLAS and completes the multiplication of two double-precision matrixes. In this paper,we optimize DGEMM on Loongson3B1500. Using the reserved physical memory and larger page,we can reduce probabilities which the memory page is swapped in and out of physical memory and TLB miss; Utilize Loongson two 128-bit instructions of vector fetching and vector multiplication to realize vector computing of matrix multiplication; Design reasonable partition strategy according to the characteristics of the memory access of each matrix in matrix multiplication,and let the high repeat block in to locked cache with the using of cache locking mechanism on Loongson3B1500 to reduce the cache missing; Design the new prefetching algorithm for the original prefetching time of matrix A and B is greater of its calculate time,by expanding the amount of core calculating to hide the pre-fetching time of A and B in computing time,and use ld instruction and register $ 0 to pre-fetch matrix C.About all,the optimized DGEMM function has get more than 80% of theoretical performance in both one thread and multi-threads.