• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Codecs
  • Assigned To No-one
  • Operating System All players
  • Severity Low
  • Priority Very Low
  • Reported Version Rbutil git
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by victorzhang - 2011-03-16
Last edited by fg - 2012-06-11

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

@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 1));
# define MAD_F_MLX(hi, lo, x, y) \
do { \

 u64_di_t __ll = (u64_di_t) (x) * (y); \
 hi = __ll >> 32; \
 lo = __ll; \


See also:GCC 4.4 release note

This patch is a possible workaround that works on both old and new version of gcc.

1) mode (DI
Closed by  fg
2012-06-11 21:19
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

Committed in fbe33e0. Thanks!

This patch applys to fixed.h r28532.


Available keyboard shortcuts


Task Details

Task Editing