Ticket #8660: diff

File diff, 672 bytes (added by SF/robinwatts, 17 years ago)

Inline assembly ARM version of clampedAdd

  • rate.h

     
    4444#define ST_SUCCESS (0)
    4545
    4646static inline void clampedAdd(int16& a, int b) {
     47#if defined(ARM) && !defined(OUTPUT_UNSIGNED_AUDIO)
     48        asm("MOV     %1,%1,LSL #16\n\t"
     49            "ADDS    %0,%1,%0,LSL #16\n\t"
     50            "MOVVS   %0,#0\n\t"
     51            "RSCVS   %0,%0,#1<<31\n\t"
     52            "MOV     %0,%0,LSR #16\n\t" :
     53            "+r" (a), "+r" (b) : : "cc"
     54        );
     55#else
    4756        register int val;
    4857#ifdef OUTPUT_UNSIGNED_AUDIO
    4958        val = (a ^ 0x8000) + b;
     
    6170#else
    6271        a = val;
    6372#endif
     73#endif
    6474}
    6575
    6676// Q&D hack to get this SOX stuff to work