Mercurial > libavutil.hg
comparison internal.h @ 124:bd1ecfd747bc libavutil
Add ARCH_X86_32 as a new define for 32 bit x86 architectures and change
the semantics of ARCH_X86 to mean both 32 and 64 bits.
author | diego |
---|---|
date | Wed, 01 Nov 2006 17:01:33 +0000 |
parents | 69714d5e1561 |
children | 172cf2494db7 |
comparison
equal
deleted
inserted
replaced
123:d3fc48bfea86 | 124:bd1ecfd747bc |
---|---|
215 /* better than nothing implementation. */ | 215 /* better than nothing implementation. */ |
216 /* btw, rintf() is existing on fbsd too -- alex */ | 216 /* btw, rintf() is existing on fbsd too -- alex */ |
217 static always_inline long int lrintf(float x) | 217 static always_inline long int lrintf(float x) |
218 { | 218 { |
219 #ifdef __MINGW32__ | 219 #ifdef __MINGW32__ |
220 # ifdef ARCH_X86 | 220 # ifdef ARCH_X86_32 |
221 int32_t i; | 221 int32_t i; |
222 asm volatile( | 222 asm volatile( |
223 "fistpl %0\n\t" | 223 "fistpl %0\n\t" |
224 : "=m" (i) : "t" (x) : "st" | 224 : "=m" (i) : "t" (x) : "st" |
225 ); | 225 ); |
226 return i; | 226 return i; |
227 # else | 227 # else |
228 /* XXX: incorrect, but make it compile */ | 228 /* XXX: incorrect, but make it compile */ |
229 return (int)(x + (x < 0 ? -0.5 : 0.5)); | 229 return (int)(x + (x < 0 ? -0.5 : 0.5)); |
230 # endif /* ARCH_X86 */ | 230 # endif /* ARCH_X86_32 */ |
231 #else | 231 #else |
232 return (int)(rint(x)); | 232 return (int)(rint(x)); |
233 #endif /* __MINGW32__ */ | 233 #endif /* __MINGW32__ */ |
234 } | 234 } |
235 #endif /* HAVE_LRINTF */ | 235 #endif /* HAVE_LRINTF */ |