Advertisement
Guest User

Untitled

a guest
Apr 28th, 2010
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #define PRECISION 16
  2. #define fixmul32(x, y)  \
  3.     ({ int32_t __hi;  \
  4.        uint32_t __lo;  \
  5.        int32_t __result;  \
  6.        asm ("smull   %0, %1, %3, %4\n\t"  \
  7.             "movs    %0, %0, lsr %5\n\t"  \
  8.             "adc    %2, %0, %1, lsl %6"  \
  9.             : "=&r" (__lo), "=&r" (__hi), "=r" (__result)  \
  10.             : "%r" (x), "r" (y),  \
  11.               "M" (PRECISION), "M" (32 - PRECISION)  \
  12.             : "cc");  \
  13.        __result;  \
  14.     })
  15.  
  16.  
  17.  
  18. tmp = fixmul32(output[i].r,  output[i].r) + fixmul32(output[i].i, output[i].i);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement