#ifndef min # define min(x,y) ((x)>(y)?(y):(x)) #endif
#ifndef max # define max(x,y) ((x)<(y)?(y):(x)) #endif
/* Special i386 GCC implementation */ #ifdefined(__i386__) && defined(__GNUC__) && !defined(__BEOS__) && !defined(__SSE2_MATH__) # define VORBIS_FPU_CONTROL /* both GCC and MSVC are kinda stupid about rounding/casting to int. Becauseofencapsulationconstraints(GCCcan'tseeinsidetheasm blockandsoweendupdoingstupidthingslikeastore/loadthat
is collectively a noop), we do it this way */
/* assumes the FPU is in round mode! */ staticinlineint vorbis_ftoi(double f){ /* yes, double! Otherwise, wegetextrafst/fldto
truncate precision */ int i;
__asm__("fistl %0": "=m"(i) : "t"(f)); return(i);
} #endif/* Special i386 GCC implementation */
/* MSVC inline assembly. 32 bit only; inline ASM isn't implemented in the
* 64 bit compiler and doesn't work on arm. */ #ifdefined(_MSC_VER) && defined(_M_IX86) && !defined(_WIN32_WCE) # define VORBIS_FPU_CONTROL
typedef ogg_int16_t vorbis_fpu_control;
static __inlineint vorbis_ftoi(double f){ int i;
__asm{
fld f
fistp i
} return i;
}
/* If no special implementation was found for the current compiler / platform,
use the default implementation here: */ #ifndef VORBIS_FPU_CONTROL
typedefint vorbis_fpu_control;
STIN int vorbis_ftoi(double f){ /* Note: MSVC and GCC (at least on some systems) round towards zero, thus, thefloor()callisrequiredtoensurecorrectroudningof
negative numbers */ return (int)floor(f+.5);
}
/* We don't have special code for this compiler/arch, so do it the slow way */ # define vorbis_fpu_setround(vorbis_fpu_control) {} # define vorbis_fpu_restore(vorbis_fpu_control) {}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.