⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adds two 64-bit values to produce a 64-bit result..txt

📁 c6000的应用程序比较常用比如说fft ifft等一些原文件
💻 TXT
字号:
TEXAS INSTRUMENTS, INC.		
*
*	64 BIT ADD
*
*	Revision Date:  06/18/97
*	
*	USAGE	This routine is C Callable and can be called as:
*		
*		void add64b(int alow, int ahigh, int blow, int bhigh, int *c)
*
*		alow  --- lsword to first 64 bit value
*		ahigh --- msword to first 64 bit value 
*               blow  --- lsword to second 64 bit value
*		bhigh --- msword to second 64 bit value
*		*c --- pointer to resultant 64 bit value
*
*		If routine is not to be used as a C callable function then
*		you need to initialize values for all of the values passed
*		as these are assumed to be in registers as defined by the 
*		calling convention of the compiler, (refer to the C compiler
*		reference guide).
*
*	C CODE
*		This is the C equivalent of the assembly code.  Note that
*		the assembly code is hand optimized and restrictions may
*		apply.
*
*		void add64(int alow, int ahigh, int blow, int bhigh, int *c)
*		{
*			c[0] = alow + blow;
*			c[1] = ahigh + bhigh;
*			if((unsigned) c[0] < (unsigned) alow)
*				c[1]++;
*		}
*
*
*	DESCRIPTION
*
*		This routine takes two 64 bit values and calculates their
*               sum.  The inputs are 64-bit numbers, which are broken into
*		two 32-bit values (least and most significant words), and the
*		result is a 64-bit number.
*	
*	ASSUMPTIONS
*
*         	1.  Only one sum is computed with a pair of 64-bit values.  The
*		    code can be reorganized to compute an average of two 64-bit
*		    adds in three cycles
*		2.  Multi-word result uses a return pointer and requires STWs.
*
*	CYCLES
*
*		2 (3 with STWs)
*
*===============================================================================
	.global _add64
	.text

_add64:
*** BEGIN Benchmark Timing
B_START:

	ADDU	.L1	A4,	A6,	A1:A0	; c_tmp:c_low = a_low + b_low
||	ADD	.L2	B4,	B6,	B7	; c_high_tmp = a_high + b_high
||	ADD	.S2X	A8, 	4,	B0	; update pointer to c_high	

	ADD	.L2X	A1,	B7,	B7	; c_high = c_high_tmp + c_tmp

B_END:
*** END Benchmark Timing

	STW	.D1	A0,	*A8		; c_low stored
||	STW	.D2	B7,	*B0		; c_high stored
||	B	.S2	B3			; return to calling function

STOP:
	NOP	5

⌨️ 快捷键说明

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