Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#12013 - Build libmad using mips-sde-elf-gcc 4.5.1:impossible constraint in 'asm'

Attached to Project: Rockbox
Opened by Huan Zhang (victorzhang) - Wednesday, 16 March 2011, 18:00 GMT+2
Last edited by Frank Gevaerts (fg) - Monday, 11 June 2012, 23:19 GMT+2
Task Type Patches
Category Codecs
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Rbutil SVN
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

@rockbox/apps/codecs/libmad/fixed.h,line 299
# define MAD_F_MLX(hi, lo, x, y) \
asm ("mult %2,%3" \
: "=l" (lo), "=h" (hi) \
: "%r" (x), "r" (y))
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:
typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
# define MAD_F_MLX(hi, lo, x, y) \
do { \
u64_di_t __ll = (u64_di_t) (x) * (y); \
hi = __ll >> 32; \
lo = __ll; \
}while(0)

See also:GCC 4.4 release note
http://gcc.gnu.org/gcc-4.4/

This patch is a possible workaround that works on both old and new version of gcc.
   fixed.patch (1 KiB)
 b/apps/codecs/libmad/fixed.h |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

This task depends upon

Closed by  Frank Gevaerts (fg)
Monday, 11 June 2012, 23:19 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed in fbe33e0. Thanks!
Comment by Huan Zhang (victorzhang) - Thursday, 17 March 2011, 05:51 GMT+2
This patch applys to fixed.h r28532.

Loading...