Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
multi_arith.h File Reference

Go to the source code of this file.

Macros

#define fp_mul64(desth, destl, src1, src2)
 
#define fp_div64(quot, rem, srch, srcl, div)
 
#define fp_add64(dest1, dest2, src1, src2)
 
#define fp_addx96(dest, src)
 
#define fp_sub64(dest, src)
 
#define fp_sub96c(dest, srch, srcm, srcl)
 

Macro Definition Documentation

#define fp_add64 (   dest1,
  dest2,
  src1,
  src2 
)
Value:
({ \
asm ("add.l %1,%0" : "=d,dm" (dest2) \
: "dm,d" (src2), "0,0" (dest2)); \
asm ("addx.l %1,%0" : "=d" (dest1) \
: "d" (src1), "0" (dest1)); \
})

Definition at line 134 of file multi_arith.h.

#define fp_addx96 (   dest,
  src 
)
Value:
({ \
/* we assume here, gcc only insert move and a clr instr */ \
asm volatile ("add.l %1,%0" : "=d,g" (dest->m32[2]) \
: "g,d" (temp.m32[1]), "0,0" (dest->m32[2])); \
asm volatile ("addx.l %1,%0" : "=d" (dest->m32[1]) \
: "d" (temp.m32[0]), "0" (dest->m32[1])); \
asm volatile ("addx.l %1,%0" : "=d" (dest->m32[0]) \
: "d" (0), "0" (dest->m32[0])); \
})

Definition at line 140 of file multi_arith.h.

#define fp_div64 (   quot,
  rem,
  srch,
  srcl,
  div 
)
Value:
asm ("divu.l %2,%1:%0" : "=d" (quot), "=d" (rem) \
: "dm" (div), "1" (srch), "0" (srcl))

Definition at line 131 of file multi_arith.h.

#define fp_mul64 (   desth,
  destl,
  src1,
  src2 
)
Value:
({ \
asm ("mulu.l %2,%1:%0" : "=d" (destl), "=d" (desth) \
: "dm" (src1), "0" (src2)); \
})

Definition at line 127 of file multi_arith.h.

#define fp_sub64 (   dest,
  src 
)
Value:
({ \
asm ("sub.l %1,%0" : "=d,dm" (dest.m32[1]) \
: "dm,d" (src.m32[1]), "0,0" (dest.m32[1])); \
asm ("subx.l %1,%0" : "=d" (dest.m32[0]) \
: "d" (src.m32[0]), "0" (dest.m32[0])); \
})

Definition at line 149 of file multi_arith.h.

#define fp_sub96c (   dest,
  srch,
  srcm,
  srcl 
)
Value:
({ \
char carry; \
asm ("sub.l %1,%0" : "=d,dm" (dest.m32[2]) \
: "dm,d" (srcl), "0,0" (dest.m32[2])); \
asm ("subx.l %1,%0" : "=d" (dest.m32[1]) \
: "d" (srcm), "0" (dest.m32[1])); \
asm ("subx.l %2,%1; scs %0" : "=d" (carry), "=d" (dest.m32[0]) \
: "d" (srch), "1" (dest.m32[0])); \
carry; \
})

Definition at line 155 of file multi_arith.h.