summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuan Zhang <victzhang@gmail.com>2012-06-11 23:17:19 +0200
committerFrank Gevaerts <frank@gevaerts.be>2012-06-11 23:17:19 +0200
commitfbe33e07285c2915cc0d9b5ff427ec6683c8c385 (patch)
tree36e626f6bf829cb87b9483c4f6cdc1bdb2df5608
parent10b2143fbf56bd03a2050f06617d5af7dbb911df (diff)
downloadrockbox-fbe33e07285c2915cc0d9b5ff427ec6683c8c385.tar.gz
rockbox-fbe33e07285c2915cc0d9b5ff427ec6683c8c385.zip
Fix libmad compilation on MIPS with newer gcc. FS#12013
Since gcc 4.4 the MIPS port no longer recognizes the "h" asm constraint. It was necessary to remove this constraint in order to avoid generating unpredictable code sequences. We can achieve the same effect using 128-bit types. See also:GCC 4.4 release notes at http://gcc.gnu.org/gcc-4.4/ Change-Id: I713cdf57cde1a989ad960aa441ab1ccf51f1cdc6
-rw-r--r--lib/rbcodec/codecs/libmad/fixed.h11
-rwxr-xr-xtools/configure3
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libmad/fixed.h b/lib/rbcodec/codecs/libmad/fixed.h
index 6015684644..1b4d29dad6 100644
--- a/lib/rbcodec/codecs/libmad/fixed.h
+++ b/lib/rbcodec/codecs/libmad/fixed.h
@@ -292,6 +292,15 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
292 292
293# elif defined(FPM_MIPS) 293# elif defined(FPM_MIPS)
294 294
295#if GCCNUM >= 404
296typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
297# define MAD_F_MLX(hi, lo, x, y) \
298do { \
299 u64_di_t __ll = (u64_di_t) (x) * (y); \
300 hi = __ll >> 32; \
301 lo = __ll; \
302}while(0)
303#else
295/* 304/*
296 * This MIPS version is fast and accurate; the disposition of the least 305 * This MIPS version is fast and accurate; the disposition of the least
297 * significant bit depends on OPT_ACCURACY via mad_f_scale64(). 306 * significant bit depends on OPT_ACCURACY via mad_f_scale64().
@@ -322,6 +331,8 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
322# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo)) 331# define MAD_F_MLZ(hi, lo) ((mad_fixed_t) (lo))
323# endif 332# endif
324 333
334#endif /* GCCNUM */
335
325# if defined(OPT_SPEED) 336# if defined(OPT_SPEED)
326# define mad_f_scale64(hi, lo) \ 337# define mad_f_scale64(hi, lo) \
327 ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS))) 338 ((mad_fixed_t) ((hi) << (32 - MAD_F_SCALEBITS)))
diff --git a/tools/configure b/tools/configure
index c008395d7c..7d860683cf 100755
--- a/tools/configure
+++ b/tools/configure
@@ -3840,6 +3840,9 @@ ${Darch_version}
3840/* Define endianess for the target or simulator platform */ 3840/* Define endianess for the target or simulator platform */
3841#define ${defendian} 1 3841#define ${defendian} 1
3842 3842
3843/* Define the GCC version used for the build */
3844#define GCCNUM ${GCCNUM}
3845
3843/* Define this if you build rockbox to support the logf logging and display */ 3846/* Define this if you build rockbox to support the logf logging and display */
3844${use_logf} 3847${use_logf}
3845 3848