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

📄 ebcccc_opt.s

📁 Intel PXA27X Display Driver Windows CE
💻 S
字号:
;
; Copyright (c) Microsoft Corporation.  All rights reserved.
;
;
; Use of this source code is subject to the terms of the Microsoft end-user
; license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
; If you did not accept the terms of the EULA, you are not authorized to use
; this source code. For a copy of the EULA, please see the LICENSE.RTF on your
; install media.
;
;/* 
;** INTEL CONFIDENTIAL
;** Copyright 2000-2003 Intel Corporation All Rights Reserved.
;**
;** The source code contained or described herein and all documents
;** related to the source code (Material) are owned by Intel Corporation
;** or its suppliers or licensors.  Title to the Material remains with
;** Intel Corporation or its suppliers and licensors. The Material contains
;** trade secrets and proprietary and confidential information of Intel
;** or its suppliers and licensors. The Material is protected by worldwide
;** copyright and trade secret laws and treaty provisions. No part of the
;** Material may be used, copied, reproduced, modified, published, uploaded,
;** posted, transmitted, distributed, or disclosed in any way without Intel抯
;** prior express written permission.
;
;** No license under any patent, copyright, trade secret or other intellectual
;** property right is granted to or conferred upon you by disclosure or
;** delivery of the Materials, either expressly, by implication, inducement,
;** estoppel or otherwise. Any license under such intellectual property rights
;** must be express and approved by Intel in writing.
;*/
	INCLUDE memcopy_macro.inc
	EXPORT	Memmove1616_ASM_LE16
	EXPORT	Memmove1616_ASM_GT16
	EXPORT	EmulatedBltSrcCopy1616ASM
	
	AREA	EBCOPY16OPT,	CODE,	READONLY
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
	; void Memmove1616_ASM_LE16(WORD* pSrc, WORD *pDst, int len) 	;
	; 																;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
Memmove1616_ASM_LE16

	; r0->pSrc, r1->pDst, r2->len
	; if ( pSrc > pDst ), use increase mode
	cmp		r2,		#0

    IF Thumbing :LOR: Interworking
        bxle  lr
    ELSE
        movle  pc, lr          ; return
    ENDIF
	
	cmp 	r0, 	r1
	ble		Memmove1616_ASM_LE16_DEC
Memmove1616_ASM_LE16_INC

Memmove1616_ASM_LE16_INC_LABEL MEMCOPYMBTS_LT16 r0, r1, r2, #2, #2, r3, r12, ldrh, strh, ldrneh, strneh
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF

; (pSrc <= pDst ) use decrease mode
Memmove1616_ASM_LE16_DEC
	add		r0,		r0,		r2, lsl #1
	add		r1,		r1,		r2, lsl #1
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
Memmove1616_ASM_LE16_DEC_LABEL MEMCOPYMBTS_LT16 r0, r1, r2, #-2, #-2, r3, r12, ldrh, strh, ldrneh, strneh
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF

	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
	; void Memmove1616_ASM_GT16(WORD* pSrc, WORD *pDst, int len) 	;
	; 																;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
Memmove1616_ASM_GT16

	cmp		r2,		#0			; len >= 0?
    IF Thumbing :LOR: Interworking
        bxle  lr
    ELSE
        movle  pc, lr          ; return
    ENDIF

	stmdb	sp!,	{r4-r6,r14}


	subs	r3,		r0,		r1
	rsblt	r3,		r3,		#0
	
	cmp		r3,		r2,		lsl #1
	cmple	r0,		r1
	ble		Memmove1616_ASM_GT16_DEC
Memmove1616_ASM_GT16_INC
	eor		r3,		r0,		r1
	tst		r3,		#2
	bne		Memmove1616_ASM_GT16_INC_2B
Memmove1616_ASM_GT16_INC_4B
	tst		r0,		#0x2
	ldrneh	r12,	[r0], #2
	subne	r2,		r2,	  #1
	mov		r14,	r2, 	lsr	#1 ; r14->number in 4-byte
	strneh	r12,	[r1], #2
	
	
Memmove1616_ASM_GT16_INC_4B_LABLE   MEMCOPYMBTS_LG16 r0, r1, r14, #4, #4, r3, r12, r4, r5, r6, ldr, str
	 
	tst		r2,		#0x1
	ldrneh	r12,	[r0], #2
	strneh	r12,	[r1], #2
 	b		Memmove1616_ASM_GT16_EXIT
 	
			
Memmove1616_ASM_GT16_INC_2B	
Memmove1616_ASM_GT16_INC_2B_LABLE	MEMCOPYMBTS_LG16 r0, r1, r2, #2, #2, r3, r12, r4, r5, r6, ldrh, strh
 	b		Memmove1616_ASM_GT16_EXIT

	
Memmove1616_ASM_GT16_DEC
	add		r0,		r0,		r2, lsl #1
	add		r1,		r1,		r2, lsl #1
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
	eor		r3,		r0,		r1
	tst		r3,		#2
	bne		Memmove1616_ASM_GT16_DEC_2B
	
Memmove1616_ASM_GT16_DEC_4B
	tst		r0,		#0x2
	ldreqh	r12,	[r0], #-2
	subeq	r2,		r2,	  #1
	mov		r14,	r2,   lsr	#1
	streqh	r12,	[r1], #-2
	
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
	
Memmove1616_ASM_GT16_DEC_4B_LABLE 	MEMCOPYMBTS_LG16 r0, r1, r14, #-4, #-4, r3, r12, r4, r5, r6, ldr, str

	add		r0,		r0,		#2
	add		r1,		r1,		#2
	 
	tst		r2,		#0x1
	ldrneh	r12,	[r0], #-2
	strneh	r12,	[r1], #-2
 	b		Memmove1616_ASM_GT16_EXIT
 	
			
Memmove1616_ASM_GT16_DEC_2B	
Memmove1616_ASM_GT16_DEC_2B_LABLE	MEMCOPYMBTS_LG16 r0, r1, r2, #-2, #-2, r3, r12, r4, r5, r6, ldrh, strh

	
Memmove1616_ASM_GT16_EXIT	
	ldmia	sp!,	{r4-r6,pc} 
	
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
	; void EmulatedBltSrcCopy1616ASM(WORD* pSrc, WORD *pDst, int len, int cRows,			;
	;								UINT32 iScanStrideSrc,									; 
	;								UINT32 iScanStrideDst)									;
	; 																						;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	

STACKDEPTH					EQU		(4*4)
	
ISCANSTRIDESRC				EQU		(STACKDEPTH+0)
ISCANSTRIDEDST				EQU		(STACKDEPTH+4)
EmulatedBltSrcCopy1616ASM	
	cmp		r2,		#0
	cmpgt	r3,		#0

    IF Thumbing :LOR: Interworking
        bxle  lr
    ELSE
        movle  pc, lr          ; return
    ENDIF

	
	str		r4,		[sp,	#-4]!
	str		r5,		[sp,	#-4]!
	str		r6,		[sp,	#-4]!
	str		r7,		[sp,	#-4]!
	cmp		r2,		#16
	
	ldr		r4,		[sp,	#ISCANSTRIDESRC]
	ldr		r5,		[sp,	#ISCANSTRIDEDST]	
	mov		r7,		r2			; keep len in one line
	
	bgt		SrcCopy1616_ASM_GT16
	
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
SrcCopy1616_ASM_LE16	
SrcCopy1616_ASM_LE16_LOOP	
	cmp 	r0, 	r1
	ble		SrcCopy1616_ASM_LE16_DEC
		
SrcCopy1616_ASM_LE16_INC
SrcCopy1616_ASM_LE16_INC_LABEL MEMCOPYMBTS_LT16 r0, r1, r2, #2, #2, r6, r12, ldrh, strh, ldrneh, strneh
	subs	r3,		r3,		#1
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	mov		r2,		r7
	sub		r0,		r0,		r2, lsl #1
	sub		r1,		r1,		r2, lsl #1
	
	bgt		SrcCopy1616_ASM_LE16_LOOP
	; return from the function	
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF

	
; (pSrc <= pDst ) use decrease mode
SrcCopy1616_ASM_LE16_DEC
	add		r0,		r0,		r2, lsl #1
	add		r1,		r1,		r2, lsl #1
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
SrcCopy1616_ASM_LE16_DEC_LABEL MEMCOPYMBTS_LT16 r0, r1, r2, #-2, #-2, r6, r12, ldrh, strh, ldrneh, strneh
	subs	r3,		r3,		#1
	add		r0,		r0,		#2  ;; important
	add		r1,		r1,		#2
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	mov		r2,		r7
	bgt		SrcCopy1616_ASM_LE16_LOOP
	; return from the function
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF

	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	
SrcCopy1616_ASM_GT16
	str		r8,		[sp,	#-4]!
	str		r9,		[sp,	#-4]!
	str		r10,	[sp,	#-4]!
	str		r11,	[sp,	#-4]!
	
SrcCopy1616_ASM_GT16_LOOP	
	subs	r12,	r0,		r1
	rsblt	r12,	r12,	#0
	
	cmp		r12,	r2,		lsl #1
	cmplt	r0,		r1
	blt		SrcCopy1616_ASM_GT16_DEC
	
SrcCopy1616_ASM_GT16_INC
	eor		r12,	r0,		r1
	tst		r12,	#2
	bne		SrcCopy1616_ASM_GT16_INC_2B
SrcCopy1616_ASM_GT16_INC_4B
	tst		r0,		#0x2
	ldrneh	r12,	[r0], #2
	subne	r2,		r2,	  #1
	mov		r11,	r2, 	lsr	#1 ; r11->number in 4-byte
	strneh	r12,	[r1], #2
	
	
SrcCopy1616_ASM_GT16_INC_4B_LABLE   MEMCOPYMBTS_LG16 r0, r1, r11, #4, #4, r6, r12, r8, r9, r10, ldr, str
	 
	tst		r2,		#0x1
	ldrneh	r12,	[r0], #2
	mov		r2,		r7
	strneh	r12,	[r1], #2
	
	sub		r0,		r0,		r2, lsl #1
	sub		r1,		r1,		r2, lsl #1
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	subs	r3,		r3,		#1
	bgt		SrcCopy1616_ASM_GT16_LOOP

	;return from the function
	ldr		r11,	[sp],	#4
	ldr		r10,	[sp],	#4
	ldr		r9,		[sp],	#4
	ldr		r8,		[sp],	#4
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF

 	
			
SrcCopy1616_ASM_GT16_INC_2B	
SrcCopy1616_ASM_GT16_INC_2B_LABLE	MEMCOPYMBTS_LG16 r0, r1, r2, #2, #2, r6, r12, r8, r9, r10, ldrh, strh
	mov		r2,		r7
	subs	r3,		r3,		#1
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	sub		r0,		r0,		r2, lsl #1
	sub		r1,		r1,		r2, lsl #1

	bgt		SrcCopy1616_ASM_GT16_LOOP

	;return from the function
	ldr		r11,	[sp],	#4
	ldr		r10,	[sp],	#4
	ldr		r9,		[sp],	#4
	ldr		r8,		[sp],	#4
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF



	
SrcCopy1616_ASM_GT16_DEC
	add		r0,		r0,		r2, lsl #1
	add		r1,		r1,		r2, lsl #1
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
	eor		r12,	r0,		r1
	tst		r12,	#2
	bne		SrcCopy1616_ASM_GT16_DEC_2B
	
SrcCopy1616_ASM_GT16_DEC_4B
	tst		r0,		#0x2
	ldreqh	r12,	[r0], #-2
	subeq	r2,		r2,	  #1
	mov		r11,	r2,   lsr	#1
	streqh	r12,	[r1], #-2
	
	sub		r0,		r0,		#2
	sub		r1,		r1,		#2
	
SrcCopy1616_ASM_GT16_DEC_4B_LABLE 	MEMCOPYMBTS_LG16 r0, r1, r11, #-4, #-4, r6, r12, r8, r9, r10, ldr, str

	add		r0,		r0,		#2
	add		r1,		r1,		#2
	 
	tst		r2,		#0x1
	ldrneh	r12,	[r0], #-2
	strneh	r12,	[r1], #-2
	
	add		r0,		r0,		#2  ;; important
	add		r1,		r1,		#2

	subs	r3,		r3,		#1
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	mov		r2,		r7
	bgt		SrcCopy1616_ASM_GT16_LOOP

	;return from the function
	ldr		r11,	[sp],	#4
	ldr		r10,	[sp],	#4
	ldr		r9,		[sp],	#4
	ldr		r8,		[sp],	#4
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF


 	
			
SrcCopy1616_ASM_GT16_DEC_2B	
SrcCopy1616_ASM_GT16_DEC_2B_LABLE	MEMCOPYMBTS_LG16 r0, r1, r2, #-2, #-2, r6, r12, r8, r9, r10, ldrh, strh

	add		r0,		r0,		#2  ;; important
	add		r1,		r1,		#2

	subs	r3,		r3,		#1
	add		r0,		r0,		r4, lsl #1
	add		r1,		r1,		r5, lsl #1
	mov		r2,		r7
	bgt		SrcCopy1616_ASM_GT16_LOOP

	;return from the function
	ldr		r11,	[sp],	#4
	ldr		r10,	[sp],	#4
	ldr		r9,		[sp],	#4
	ldr		r8,		[sp],	#4
	ldr		r7,		[sp],	#4
	ldr		r6,		[sp],	#4
	ldr		r5,		[sp],	#4
	ldr		r4,		[sp],	#4
    IF Thumbing :LOR: Interworking
        bx  lr
    ELSE
        mov  pc, lr          ; return
    ENDIF


	
	END
	

⌨️ 快捷键说明

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