On Fri, Jan 16, 2009 at 6:17 PM, Jacob Meuser <jake...@sdf.lonestar.org> wrote:
> can someone check that this builds on !x86?

fails on macppc.

c++ -O2 -pipe  -DOS_LINUX -DOSSMIDIIN -DFFTW_VERSION_3 -DASM_F2I_YES
`fltk-config --cflags`  -DSNDIOAUDIOOUT  -DOS_LINUX -DOSSMIDIIN
-DFFTW_VERSION_3 -DASM_F2I_YES `fltk-config --cflags`  -DSNDIOAUDIOOUT
   -c -o FormantFilter.o FormantFilter.C
FormantFilter.C: In member function `void FormantFilter::setpos(float)':
FormantFilter.C:93: error: unknown register name `st' in `asm'
gmake[2]: *** [FormantFilter.o] Error 1
gmake[2]: Leaving directory
`/usr/ports/mystuff/audio/zynaddsubfx/w-zynaddsubfx-2.2.1/ZynAddSubFX-2.2.1/src/DSP'
gmake[1]: *** [DSP] Error 2
gmake[1]: Leaving directory
`/usr/ports/mystuff/audio/zynaddsubfx/w-zynaddsubfx-2.2.1/ZynAddSubFX-2.2.1/src'
gmake: *** [all] Error 2
*** Error code 2



The line in question is a macro for F2I defined in globals.h

#ifdef ASM_F2I_YES
#define F2I(f,i) __asm__ __volatile__ ("fistpl %0" : "=m" (i) : "t" (f-0.4999999
9) : "st") ;
#else
#define F2I(f,i) (i)=((f>0) ? ( (int)(f) ) :( (int)(f-1.0) ));
#endif


ASM_F2I_YES gets defined in src/Makefile as -DASM_F2I_$(ASM_F2I) and
ASM_F2I is in src/Makefile.inc

#Assembler FLOAT to INT conversions
ASM_F2I=YES
#ASM_F2I=NO

I know very little about assembly (especially on powerpc) to comment
any further on this. The copy of PowerPC assembler reference manual I
have at hand offers this:

fctid  FRT,FRB Floating Convert to Integer Doubleword
fctid. FRT,FRB

fctidz   FRT,FRB Floating Convert to Integer Doubleword with Round toward Zero
fctidz. FRT,FRB

fctiw   FRT,FRB Floating Convert to Integer Word
fctiw. FRT,FRB

fctiwz   FRT,FRB Floating Convert to Integer Word with Round toward Zero
fctiwz. FRT,FRB

Does that help ... a little?
--patrick

Reply via email to