This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Mon, Jun 30, 2008 at 2:09 AM, H.J. Lu <hjl.tools@gmail.com> wrote: > Here is the updated patch. > +#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \ > + do { \ > + __asm__ volatile("addl %5,%1; adcl %3,%0" \ > + : "=r"(r1), "=r"(r0) \ > + : "%0"(x1), "g"(y1), "%1"(x0), "g"(y0) \ > + : "cc"); \ > + __asm__ volatile("adcl %5,%1; adcl %3,%0" \ > + : "=r"(r3), "=r"(r2) \ > + : "%0"(x3), "g"(y3), "%1"(x2), "g"(y2) \ > + : "cc"); \ > + } while (0) This is wrong, carry flag propagation is broken between these two asm insns. Also, clobbers should be added (please look at attached source). > +#define _i386_div_64_32(q, r, nh, nl, d) \ > + __asm__ ("divl %4" : "=a"(q), "=d"(r) : "0"(nl), "1"(nh), "g"(d) : "cc") The definition above is also unused and should be removed. udiv_qrnnd from longlong.h is used by default through soft-fp sources. Attached to this message, please find definitions of __FP_FRAC_{ADD,SUB}_{3,4} macros, together with a test application. Uros.
Attachment:
frac.c
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |