Commit edbc4c22 authored by Jean-Claude Beaudoin's avatar Jean-Claude Beaudoin
Browse files

Make some macros using 'asm' in libmkcc1.c more palatable to clang.

parent 41413fdf
......@@ -114,6 +114,36 @@ union float_long {
/* XXX: use gcc/mkcc intrinsic ? */
# if defined(MKCC_TARGET_I386)
# if __clang__
# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("subl %5,%1\n\tsbbl %3,%0" \
: "=r" ((sh)), \
"=&r" ((sl)) \
: "0" ((ah)), \
"g" ((bh)), \
"1" ((al)), \
"g" ((bl)))
# define umul_ppmm(w1, w0, u, v) \
__asm__ ("mull %3" \
: "=a" ((w0)), \
"=d" ((w1)) \
: "%0" ((u)), \
"rm" ((v)))
# define udiv_qrnnd(q, r, n1, n0, dv) \
__asm__ ("divl %4" \
: "=a" ((q)), \
"=d" ((r)) \
: "0" ((n0)), \
"1" ((n1)), \
"rm" ((dv)))
# define count_leading_zeros(count, x) \
do { \
USItype __cbtmp; \
__asm__ ("bsrl %1,%0" \
: "=r" (__cbtmp) : "rm" ((x))); \
(count) = __cbtmp ^ 31; \
} while (0)
# else
# define sub_ddmmss(sh, sl, ah, al, bh, bl) \
__asm__ ("subl %5,%1\n\tsbbl %3,%0" \
: "=r" ((USItype) (sh)), \
......@@ -142,6 +172,7 @@ union float_long {
: "=r" (__cbtmp) : "rm" ((USItype) (x))); \
(count) = __cbtmp ^ 31; \
} while (0)
# endif
# else
# error unsupported CPU type
# endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment