Commit | Line | Data |
---|---|---|
c0eac5a8 MW |
1 | Copied from Debian. |
2 | ||
3 | From: Dave Martin | |
4 | Subject: "rsc" doesnt exist anymore in thumb2 | |
5 | ||
6 | diff --git a/fixed.h b/fixed.h | |
7 | index 4b58abf..ba4bc26 100644 | |
8 | --- a/fixed.h | |
9 | +++ b/fixed.h | |
10 | @@ -275,12 +275,25 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y) | |
11 | : "+r" (lo), "+r" (hi) \ | |
12 | : "%r" (x), "r" (y)) | |
13 | ||
14 | +#ifdef __thumb__ | |
15 | +/* In Thumb-2, the RSB-immediate instruction is only allowed with a zero | |
16 | + operand. If needed this code can also support Thumb-1 | |
17 | + (simply append "s" to the end of the second two instructions). */ | |
18 | +# define MAD_F_MLN(hi, lo) \ | |
19 | + asm ("rsbs %0, %0, #0\n\t" \ | |
20 | + "sbc %1, %1, %1\n\t" \ | |
21 | + "sub %1, %1, %2" \ | |
22 | + : "+&r" (lo), "=&r" (hi) \ | |
23 | + : "r" (hi) \ | |
24 | + : "cc") | |
25 | +#else /* ! __thumb__ */ | |
26 | # define MAD_F_MLN(hi, lo) \ | |
27 | asm ("rsbs %0, %2, #0\n\t" \ | |
28 | "rsc %1, %3, #0" \ | |
29 | - : "=r" (lo), "=r" (hi) \ | |
30 | + : "=&r" (lo), "=r" (hi) \ | |
31 | : "0" (lo), "1" (hi) \ | |
32 | : "cc") | |
33 | +#endif /* __thumb__ */ | |
34 | ||
35 | # define mad_f_scale64(hi, lo) \ | |
36 | ({ mad_fixed_t __result; \ |