diff options
Diffstat (limited to 'arch/s390/math-emu/sfp-util.h')
-rw-r--r-- | arch/s390/math-emu/sfp-util.h | 73 |
1 files changed, 38 insertions, 35 deletions
diff --git a/arch/s390/math-emu/sfp-util.h b/arch/s390/math-emu/sfp-util.h index ab556b600f73..5b6ca4570ea4 100644 --- a/arch/s390/math-emu/sfp-util.h +++ b/arch/s390/math-emu/sfp-util.h | |||
@@ -4,48 +4,51 @@ | |||
4 | #include <asm/byteorder.h> | 4 | #include <asm/byteorder.h> |
5 | 5 | ||
6 | #define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \ | 6 | #define add_ssaaaa(sh, sl, ah, al, bh, bl) ({ \ |
7 | unsigned int __sh = (ah); \ | 7 | unsigned int __sh = (ah); \ |
8 | unsigned int __sl = (al); \ | 8 | unsigned int __sl = (al); \ |
9 | __asm__ (" alr %1,%3\n" \ | 9 | asm volatile( \ |
10 | " brc 12,0f\n" \ | 10 | " alr %1,%3\n" \ |
11 | " ahi %0,1\n" \ | 11 | " brc 12,0f\n" \ |
12 | "0: alr %0,%2" \ | 12 | " ahi %0,1\n" \ |
13 | : "+&d" (__sh), "+d" (__sl) \ | 13 | "0: alr %0,%2" \ |
14 | : "d" (bh), "d" (bl) : "cc" ); \ | 14 | : "+&d" (__sh), "+d" (__sl) \ |
15 | (sh) = __sh; \ | 15 | : "d" (bh), "d" (bl) : "cc"); \ |
16 | (sl) = __sl; \ | 16 | (sh) = __sh; \ |
17 | (sl) = __sl; \ | ||
17 | }) | 18 | }) |
18 | 19 | ||
19 | #define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \ | 20 | #define sub_ddmmss(sh, sl, ah, al, bh, bl) ({ \ |
20 | unsigned int __sh = (ah); \ | 21 | unsigned int __sh = (ah); \ |
21 | unsigned int __sl = (al); \ | 22 | unsigned int __sl = (al); \ |
22 | __asm__ (" slr %1,%3\n" \ | 23 | asm volatile( \ |
23 | " brc 3,0f\n" \ | 24 | " slr %1,%3\n" \ |
24 | " ahi %0,-1\n" \ | 25 | " brc 3,0f\n" \ |
25 | "0: slr %0,%2" \ | 26 | " ahi %0,-1\n" \ |
26 | : "+&d" (__sh), "+d" (__sl) \ | 27 | "0: slr %0,%2" \ |
27 | : "d" (bh), "d" (bl) : "cc" ); \ | 28 | : "+&d" (__sh), "+d" (__sl) \ |
28 | (sh) = __sh; \ | 29 | : "d" (bh), "d" (bl) : "cc"); \ |
29 | (sl) = __sl; \ | 30 | (sh) = __sh; \ |
31 | (sl) = __sl; \ | ||
30 | }) | 32 | }) |
31 | 33 | ||
32 | /* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */ | 34 | /* a umul b = a mul b + (a>=2<<31) ? b<<32:0 + (b>=2<<31) ? a<<32:0 */ |
33 | #define umul_ppmm(wh, wl, u, v) ({ \ | 35 | #define umul_ppmm(wh, wl, u, v) ({ \ |
34 | unsigned int __wh = u; \ | 36 | unsigned int __wh = u; \ |
35 | unsigned int __wl = v; \ | 37 | unsigned int __wl = v; \ |
36 | __asm__ (" ltr 1,%0\n" \ | 38 | asm volatile( \ |
37 | " mr 0,%1\n" \ | 39 | " ltr 1,%0\n" \ |
38 | " jnm 0f\n" \ | 40 | " mr 0,%1\n" \ |
39 | " alr 0,%1\n" \ | 41 | " jnm 0f\n" \ |
40 | "0: ltr %1,%1\n" \ | 42 | " alr 0,%1\n" \ |
41 | " jnm 1f\n" \ | 43 | "0: ltr %1,%1\n" \ |
42 | " alr 0,%0\n" \ | 44 | " jnm 1f\n" \ |
43 | "1: lr %0,0\n" \ | 45 | " alr 0,%0\n" \ |
44 | " lr %1,1\n" \ | 46 | "1: lr %0,0\n" \ |
45 | : "+d" (__wh), "+d" (__wl) \ | 47 | " lr %1,1\n" \ |
46 | : : "0", "1", "cc" ); \ | 48 | : "+d" (__wh), "+d" (__wl) \ |
47 | wh = __wh; \ | 49 | : : "0", "1", "cc"); \ |
48 | wl = __wl; \ | 50 | wh = __wh; \ |
51 | wl = __wl; \ | ||
49 | }) | 52 | }) |
50 | 53 | ||
51 | #define udiv_qrnnd(q, r, n1, n0, d) \ | 54 | #define udiv_qrnnd(q, r, n1, n0, d) \ |