Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: H300 assembly introducing artifacts

Re: H300 assembly introducing artifacts

From: Brandon Low <lostlogic_at_lostlogicx.com>
Date: 2005-12-20

Well there's a faster way to do it, and it doesn't cause stupidity, so
I'll go with that.

Brandon

On Tue, 12/20/05 at 16:05:21 -0600, Brandon Low wrote:
> I'm working on optimizing Tremor and have run into a quandry. The
> following set of code snippets should do exactly the same thing, but I'm
> getting bad artifacts when I use the assembly version, and not when I
> use the plain-old-C version. Any thoughts are welcome.
>
> #if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
> asm ("mac.l %[y0],%[x0],%%acc0\
> \n\tmsac.l %[y0],%[x],%%acc0\
> \n\tmac.l %[y1],%[x],%%acc0\
> \n\tmsac.l %[y1],%[x0],%%acc0\
> \n\tmovclr.l %%acc0,%[x]\
> \n\tsub.l %[x0],%[x1]\
> \n\tdivs.l %[x1],%[x]\
> \n\nadd.l %[y0],%[x]"
> : [x] "+d" (x), [x1] "+d" (x1)
> : [x0] "r" (x0), [y0] "r" (y0), [y1] "r" (y1)
> : "cc" );
> return x;
> #else
> return y0+((y1-y0)*(x-x0))/(x1-x0);
> #endif
>
> Thanks,
>
> Brandon
Received on Tue Dec 20 23:39:36 2005


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa