[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] xenet_FifoSend(struct sk_buff *orig_skb,structnet_device*dev)



Hi again,

Just heading out the door here and might not be available for a couple of days, so thought I'd pass this along, untested, for your consideration.

I wrote a move_halfword_higher() function in assembler, but didn't have the time to test it. If my assumptions were correct about the intent of the memmove() in adapter.c, then this should drop in and do a quicker move. It assumes a bunch of stuff, so both the overhead and transfer loops should be quicker than the memmove it replaces, but only for this specific case. Inner loop is 12 cycles per word to move, only 11 cycles of overhead on top of that.

If I didn't get it right, I'll test and fix it on my return.

Jim Law
Iris Power

----- Original Message ----- From: "Brettschneider Falk" <fbrettschneider@xxxxxxxxxxxxxxx>
To: <microblaze-uclinux@xxxxxxxxxxxxxx>
Sent: Tuesday, April 29, 2008 1:10 PM
Subject: RE: [microblaze-uclinux] xenet_FifoSend(struct sk_buff *orig_skb,structnet_device*dev)


Hi,

Jim Law wrote:
Here is a new assembler memcpy for the MB.
cool...trying that...stay tuned...

... not sure what else I can add at this point. Is there any other
significant transfers or checksums that use other functions
that might benefit?
drivers/net/xilinx_emac/adapter.c has that ugly memmove() in FifoRecvHandler(). Maybe memmove() can also be faster in assembler... ;-)

Cheers, Falk

___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

###################################-*-asm*- # # Copyright 2008 (c) Jim Law - Iris LP All rights reserved. # # This file is subject to the terms and conditions of the GNU General
# Public License.  See the file COPYING in the main directory of this
# archive for more details.
#
# Written by Jim Law <jlaw@xxxxxxxxxxxxx>
# # application specific memory move for the MB xilinx enet
# adapter.c code
# # # assly_movhalf.S # # Attempt at quicker utility for adapter.c for MicroBlaze
#	Input :	Operand1 in Reg r5 - dest must be 2 bytes higher than src
#		Operand2 in Reg r6 - src must be word aligned
#		Operand3 in Reg r7 - number of bytes to move
#	Output: Result in Reg r3 - starting destination address
#			
# # Explanation:
# 	- moves a block 2 locations higher in memory
#	- will use an extra half to full word at end of dest memory,
#	  depending on length of move
#
#
#######################################

#include <asm/clinkage.h>

	.globl	C_SYMBOL_NAME(move_halfword_higher)
	.ent	C_SYMBOL_NAME(move_halfword_higher)

C_SYMBOL_NAME(move_halfword_higher):
	addik	r3,r5,0		# save dest address as return value

	addik	r7,r7,-1	# c = c-1
	andi	r7,r7,0xfffffffc	# c = c & ~3
	addik	r7,r7,1		# c = c+1

	andi	r5,r5,0xfffffffc	# d = d & ~3
	addik	r10,r0,0	# h = 0
	addik	r6,r6,-4	# s--

1:	lw	r11,r6,r7	# v = *(s + offset)
	bslli	r4,r11,16	# temp = v << 16
	or	r4,r4,r10	# temp = temp | h
	sw	r4,r5,r7	# *(d + offset) = temp
	bsrli	r10,r11,16	# h = v >> 16
	bneid	1b
	addik	r7,r7,-4	# offset-- (IN DELAY SLOT)

	sw	r10,r5,r7	# *(d + offset) = h
	
	rtsd	r15,8
	nop

.end C_SYMBOL_NAME(move_halfword_higher)