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



Rockbox mail archive

Subject: H300 assembly introducing artifacts

H300 assembly introducing artifacts

From: Brandon Low <lostlogic_at_lostlogicx.com>
Date: Tue, 20 Dec 2005 16:05:21 -0600

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 2005-12-20

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy