Re: double bytes

From: Petr Stehlik <stehlik_at_cas3.zlin.vutbr.cz>
Date: Mon, 27 Apr 1998 22:14:45 +0100

Hi all,

first, thanks for all the tips. I must admit the precomputed table
(256kB long) was not what I was looking for :-)

JK>> > MOVE D0,D1
JK>> > LSL 8,D0
JK>> > BFINS D1,D0{0:8}
JK>> > LSR 8,D1
JK>> > BFINS D1,D0{24:8}

yes, I was thinking about using these bit instructions, but was
unsure about the resulting speed.

JK>On an '040 and assuming that the memory is slow, like when writing via the
JK>ST-RAM bus, that may be as fast as it goes. The bitfield instructions are

I forgot to specify more precisely where this will be used:

CPU is 030 or better (more like 040 and 060, 030 will be rare).
Source memory is always FastRAM, 32-bit wide (perhaps 64-bit).
Destination memory is always video card, sometimes 16-bit wide and very
slow (NOVA AB40), sometimes VRAM on PCI (Hades, Milan). But this routine
will be called about two million times per second, so it should be
really fast...

JK>loop1:
JK> move.w d0,d1
JK> swap d0
JK> move.w d1,d0
JK> ror.w #8,d0
JK> ror.l #8,d0

yes!! This is what I was looking for! I knew there was a rol trick, but
I couldn't recall it. Thanks!

JK> move.l #$ff0000ff,d2 ; assume another free register

yes, there's a lot of free registers.

JK>loop2:
JK> move.w d0,d1
JK> swap d0
JK> move.w d1,d0
JK> and.l d2,d0
JK> ext.l d1
JK> lsl.l #8,d1
JK> or.l d1,d0
JK>
JK>It's a bit hard to count cycles on the '030 and '040, but I believe the
JK>last one above should be fastest. Rotates are slower than shifts and both
JK>are slower than normal arithmetic instructions.

OK, thanks.

Petr
--
E-mail: stehlik_at_cas3.zlin.vutbr.cz                        PARCP developer
   WWW: http://cas3.zlin.vutbr.cz/~stehlik/              MiNTOS/Linux user
mirror: http://users.zln.cz/~pstehlik/                 Atari 800XL emulation
mirror: http://www.stehlik.cyberstrider.org/              Atari Falcon040
Received on ma. april 27 1998 - 23:00:00 CEST

This archive was generated by hypermail 2.3.0 : ti. nov. 03 2015 - 20:07:54 CET