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



Rockbox mail archive

Subject: H300 assembly introducing artifacts

H300 assembly introducing artifacts

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

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:06:11 2005


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