memcpy.optimize.c

来自「代码优化,有效使用内存,透视优化技术,对比优化方法,如果你在追求代码效率的最大化」· C语言 代码 · 共 29 行

C
29
字号
/* ---------------------------------------------------------------------------
 * @
 *							MEMCPY OPTIMIZATION
 *							==================
 *
 * Build 0x001	24.06.2002
--------------------------------------------------------------------------- */
// configuration
#define BLOCK_SIZE		(8*M)				// size of the processed block
#define subBLOCK_SIZE	(L1_CACHE_SIZE/2)	// size of the sub-block
#define BRUST_LEN		(32)				// size of the read burst cycle
											// 32 bytes is the optimal choice
											// for all processors, although
											// to achieve maximum performance
											// it is necessary to determine this
											// value exactly

#include <DoCPU.h>
main()
{

	int *p1, *p2;
	int a, b, tmp=0;

	// TITLE
	PRINT("= = = demonstration of the optimized version of memcpy = = =\n");
	PRINT_TITLE;

	// 恹溴

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?