Hi, the attached patch fixes the smul_ppmm and sdiv_qrnnd patterns for zarch. Underscores were missing in local variables. DR referenced the wrong operand and the source and result regs were swapped.
Tested on s390 with -mzarch. Applied to 4.6 and mainline. Bye, -Andreas- 2011-10-04 Andreas Krebbel <andreas.kreb...@de.ibm.com> * longlong.h (smul_ppmm, sdiv_qrnnd): Add underscores to the local variables. Fix second operand of DR. Swap inputs for sdiv_qrnnd. Index: gcc/longlong.h =================================================================== *** gcc/longlong.h.orig --- gcc/longlong.h *************** UDItype __umulsidi3 (USItype, USItype); *** 365,387 **** #else #define smul_ppmm(xh, xl, m0, m1) \ do { \ ! register SItype r0 __asm__ ("0"); \ ! register SItype r1 __asm__ ("1") = m0; \ \ __asm__ ("mr\t%%r0,%3" \ ! : "=r" (r0), "=r" (r1) \ ! : "r" (r1), "r" (m1)); \ ! (xh) = r0; (xl) = r1; \ } while (0) #define sdiv_qrnnd(q, r, n1, n0, d) \ ! do { \ ! register SItype r0 __asm__ ("0") = n0; \ ! register SItype r1 __asm__ ("1") = n1; \ \ ! __asm__ ("dr\t%%r0,%3" \ ! : "=r" (r0), "=r" (r1) \ ! : "r" (r0), "r" (r1), "r" (d)); \ ! (q) = r0; (r) = r1; \ } while (0) #endif /* __zarch__ */ #endif --- 365,388 ---- #else #define smul_ppmm(xh, xl, m0, m1) \ do { \ ! register SItype __r0 __asm__ ("0"); \ ! register SItype __r1 __asm__ ("1") = (m0); \ \ __asm__ ("mr\t%%r0,%3" \ ! : "=r" (__r0), "=r" (__r1) \ ! : "r" (__r1), "r" (m1)); \ ! (xh) = __r0; (xl) = __r1; \ } while (0) + #define sdiv_qrnnd(q, r, n1, n0, d) \ ! do { \ ! register SItype __r0 __asm__ ("0") = (n1); \ ! register SItype __r1 __asm__ ("1") = (n0); \ \ ! __asm__ ("dr\t%%r0,%4" \ ! : "=r" (__r0), "=r" (__r1) \ ! : "r" (__r0), "r" (__r1), "r" (d)); \ ! (q) = __r1; (r) = __r0; \ } while (0) #endif /* __zarch__ */ #endif