diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2014-04-15 19:31:11 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-05-21 05:12:48 -0400 |
commit | 2209bcb1310ffa9ee1af12573f1413581c712b15 (patch) | |
tree | eba9f53adc3bb83dc499f15873d4e49886662122 /arch/mips | |
parent | 23708818210cec367083ce9c09c6e71a5767d7e3 (diff) |
MIPS: math-emu: Get rid of typedefs.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
40 files changed, 212 insertions, 212 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 7b3c9acae689..d670e3973bf1 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -1349,8 +1349,8 @@ static const unsigned char cmptab[8] = { | |||
1349 | */ | 1349 | */ |
1350 | 1350 | ||
1351 | #define DEF3OP(name, p, f1, f2, f3) \ | 1351 | #define DEF3OP(name, p, f1, f2, f3) \ |
1352 | static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \ | 1352 | static union ieee754##p fpemu_##p##_##name(union ieee754##p r, union ieee754##p s, \ |
1353 | ieee754##p t) \ | 1353 | union ieee754##p t) \ |
1354 | { \ | 1354 | { \ |
1355 | struct _ieee754_csr ieee754_csr_save; \ | 1355 | struct _ieee754_csr ieee754_csr_save; \ |
1356 | s = f1(s, t); \ | 1356 | s = f1(s, t); \ |
@@ -1364,22 +1364,22 @@ static ieee754##p fpemu_##p##_##name(ieee754##p r, ieee754##p s, \ | |||
1364 | return s; \ | 1364 | return s; \ |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | static ieee754dp fpemu_dp_recip(ieee754dp d) | 1367 | static union ieee754dp fpemu_dp_recip(union ieee754dp d) |
1368 | { | 1368 | { |
1369 | return ieee754dp_div(ieee754dp_one(0), d); | 1369 | return ieee754dp_div(ieee754dp_one(0), d); |
1370 | } | 1370 | } |
1371 | 1371 | ||
1372 | static ieee754dp fpemu_dp_rsqrt(ieee754dp d) | 1372 | static union ieee754dp fpemu_dp_rsqrt(union ieee754dp d) |
1373 | { | 1373 | { |
1374 | return ieee754dp_div(ieee754dp_one(0), ieee754dp_sqrt(d)); | 1374 | return ieee754dp_div(ieee754dp_one(0), ieee754dp_sqrt(d)); |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | static ieee754sp fpemu_sp_recip(ieee754sp s) | 1377 | static union ieee754sp fpemu_sp_recip(union ieee754sp s) |
1378 | { | 1378 | { |
1379 | return ieee754sp_div(ieee754sp_one(0), s); | 1379 | return ieee754sp_div(ieee754sp_one(0), s); |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | static ieee754sp fpemu_sp_rsqrt(ieee754sp s) | 1382 | static union ieee754sp fpemu_sp_rsqrt(union ieee754sp s) |
1383 | { | 1383 | { |
1384 | return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s)); | 1384 | return ieee754sp_div(ieee754sp_one(0), ieee754sp_sqrt(s)); |
1385 | } | 1385 | } |
@@ -1403,8 +1403,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1403 | switch (MIPSInst_FMA_FFMT(ir)) { | 1403 | switch (MIPSInst_FMA_FFMT(ir)) { |
1404 | case s_fmt:{ /* 0 */ | 1404 | case s_fmt:{ /* 0 */ |
1405 | 1405 | ||
1406 | ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp); | 1406 | union ieee754sp(*handler) (union ieee754sp, union ieee754sp, union ieee754sp); |
1407 | ieee754sp fd, fr, fs, ft; | 1407 | union ieee754sp fd, fr, fs, ft; |
1408 | u32 __user *va; | 1408 | u32 __user *va; |
1409 | u32 val; | 1409 | u32 val; |
1410 | 1410 | ||
@@ -1492,8 +1492,8 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | case d_fmt:{ /* 1 */ | 1494 | case d_fmt:{ /* 1 */ |
1495 | ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp); | 1495 | union ieee754dp(*handler) (union ieee754dp, union ieee754dp, union ieee754dp); |
1496 | ieee754dp fd, fr, fs, ft; | 1496 | union ieee754dp fd, fr, fs, ft; |
1497 | u64 __user *va; | 1497 | u64 __user *va; |
1498 | u64 val; | 1498 | u64 val; |
1499 | 1499 | ||
@@ -1588,8 +1588,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1588 | unsigned rcsr = 0; /* resulting csr */ | 1588 | unsigned rcsr = 0; /* resulting csr */ |
1589 | unsigned cond; | 1589 | unsigned cond; |
1590 | union { | 1590 | union { |
1591 | ieee754dp d; | 1591 | union ieee754dp d; |
1592 | ieee754sp s; | 1592 | union ieee754sp s; |
1593 | int w; | 1593 | int w; |
1594 | #ifdef __mips64 | 1594 | #ifdef __mips64 |
1595 | s64 l; | 1595 | s64 l; |
@@ -1600,8 +1600,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1600 | switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) { | 1600 | switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) { |
1601 | case s_fmt:{ /* 0 */ | 1601 | case s_fmt:{ /* 0 */ |
1602 | union { | 1602 | union { |
1603 | ieee754sp(*b) (ieee754sp, ieee754sp); | 1603 | union ieee754sp(*b) (union ieee754sp, union ieee754sp); |
1604 | ieee754sp(*u) (ieee754sp); | 1604 | union ieee754sp(*u) (union ieee754sp); |
1605 | } handler; | 1605 | } handler; |
1606 | 1606 | ||
1607 | switch (MIPSInst_FUNC(ir)) { | 1607 | switch (MIPSInst_FUNC(ir)) { |
@@ -1666,7 +1666,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1666 | /* binary op on handler */ | 1666 | /* binary op on handler */ |
1667 | scopbop: | 1667 | scopbop: |
1668 | { | 1668 | { |
1669 | ieee754sp fs, ft; | 1669 | union ieee754sp fs, ft; |
1670 | 1670 | ||
1671 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1671 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1672 | SPFROMREG(ft, MIPSInst_FT(ir)); | 1672 | SPFROMREG(ft, MIPSInst_FT(ir)); |
@@ -1676,7 +1676,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1676 | } | 1676 | } |
1677 | scopuop: | 1677 | scopuop: |
1678 | { | 1678 | { |
1679 | ieee754sp fs; | 1679 | union ieee754sp fs; |
1680 | 1680 | ||
1681 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1681 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1682 | rv.s = (*handler.u) (fs); | 1682 | rv.s = (*handler.u) (fs); |
@@ -1699,7 +1699,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1699 | case fcvts_op: | 1699 | case fcvts_op: |
1700 | return SIGILL; /* not defined */ | 1700 | return SIGILL; /* not defined */ |
1701 | case fcvtd_op:{ | 1701 | case fcvtd_op:{ |
1702 | ieee754sp fs; | 1702 | union ieee754sp fs; |
1703 | 1703 | ||
1704 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1704 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1705 | rv.d = ieee754dp_fsp(fs); | 1705 | rv.d = ieee754dp_fsp(fs); |
@@ -1707,7 +1707,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1707 | goto copcsr; | 1707 | goto copcsr; |
1708 | } | 1708 | } |
1709 | case fcvtw_op:{ | 1709 | case fcvtw_op:{ |
1710 | ieee754sp fs; | 1710 | union ieee754sp fs; |
1711 | 1711 | ||
1712 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1712 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1713 | rv.w = ieee754sp_tint(fs); | 1713 | rv.w = ieee754sp_tint(fs); |
@@ -1721,7 +1721,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1721 | case fceil_op: | 1721 | case fceil_op: |
1722 | case ffloor_op:{ | 1722 | case ffloor_op:{ |
1723 | unsigned int oldrm = ieee754_csr.rm; | 1723 | unsigned int oldrm = ieee754_csr.rm; |
1724 | ieee754sp fs; | 1724 | union ieee754sp fs; |
1725 | 1725 | ||
1726 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1726 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1727 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; | 1727 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; |
@@ -1734,7 +1734,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1734 | 1734 | ||
1735 | #if defined(__mips64) | 1735 | #if defined(__mips64) |
1736 | case fcvtl_op:{ | 1736 | case fcvtl_op:{ |
1737 | ieee754sp fs; | 1737 | union ieee754sp fs; |
1738 | 1738 | ||
1739 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1739 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1740 | rv.l = ieee754sp_tlong(fs); | 1740 | rv.l = ieee754sp_tlong(fs); |
@@ -1747,7 +1747,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1747 | case fceill_op: | 1747 | case fceill_op: |
1748 | case ffloorl_op:{ | 1748 | case ffloorl_op:{ |
1749 | unsigned int oldrm = ieee754_csr.rm; | 1749 | unsigned int oldrm = ieee754_csr.rm; |
1750 | ieee754sp fs; | 1750 | union ieee754sp fs; |
1751 | 1751 | ||
1752 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1752 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1753 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; | 1753 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; |
@@ -1761,7 +1761,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1761 | default: | 1761 | default: |
1762 | if (MIPSInst_FUNC(ir) >= fcmp_op) { | 1762 | if (MIPSInst_FUNC(ir) >= fcmp_op) { |
1763 | unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; | 1763 | unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; |
1764 | ieee754sp fs, ft; | 1764 | union ieee754sp fs, ft; |
1765 | 1765 | ||
1766 | SPFROMREG(fs, MIPSInst_FS(ir)); | 1766 | SPFROMREG(fs, MIPSInst_FS(ir)); |
1767 | SPFROMREG(ft, MIPSInst_FT(ir)); | 1767 | SPFROMREG(ft, MIPSInst_FT(ir)); |
@@ -1785,8 +1785,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1785 | 1785 | ||
1786 | case d_fmt:{ | 1786 | case d_fmt:{ |
1787 | union { | 1787 | union { |
1788 | ieee754dp(*b) (ieee754dp, ieee754dp); | 1788 | union ieee754dp(*b) (union ieee754dp, union ieee754dp); |
1789 | ieee754dp(*u) (ieee754dp); | 1789 | union ieee754dp(*u) (union ieee754dp); |
1790 | } handler; | 1790 | } handler; |
1791 | 1791 | ||
1792 | switch (MIPSInst_FUNC(ir)) { | 1792 | switch (MIPSInst_FUNC(ir)) { |
@@ -1852,7 +1852,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1852 | 1852 | ||
1853 | /* binary op on handler */ | 1853 | /* binary op on handler */ |
1854 | dcopbop:{ | 1854 | dcopbop:{ |
1855 | ieee754dp fs, ft; | 1855 | union ieee754dp fs, ft; |
1856 | 1856 | ||
1857 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1857 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1858 | DPFROMREG(ft, MIPSInst_FT(ir)); | 1858 | DPFROMREG(ft, MIPSInst_FT(ir)); |
@@ -1861,7 +1861,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1861 | goto copcsr; | 1861 | goto copcsr; |
1862 | } | 1862 | } |
1863 | dcopuop:{ | 1863 | dcopuop:{ |
1864 | ieee754dp fs; | 1864 | union ieee754dp fs; |
1865 | 1865 | ||
1866 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1866 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1867 | rv.d = (*handler.u) (fs); | 1867 | rv.d = (*handler.u) (fs); |
@@ -1870,7 +1870,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1870 | 1870 | ||
1871 | /* unary conv ops */ | 1871 | /* unary conv ops */ |
1872 | case fcvts_op:{ | 1872 | case fcvts_op:{ |
1873 | ieee754dp fs; | 1873 | union ieee754dp fs; |
1874 | 1874 | ||
1875 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1875 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1876 | rv.s = ieee754sp_fdp(fs); | 1876 | rv.s = ieee754sp_fdp(fs); |
@@ -1881,7 +1881,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1881 | return SIGILL; /* not defined */ | 1881 | return SIGILL; /* not defined */ |
1882 | 1882 | ||
1883 | case fcvtw_op:{ | 1883 | case fcvtw_op:{ |
1884 | ieee754dp fs; | 1884 | union ieee754dp fs; |
1885 | 1885 | ||
1886 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1886 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1887 | rv.w = ieee754dp_tint(fs); /* wrong */ | 1887 | rv.w = ieee754dp_tint(fs); /* wrong */ |
@@ -1895,7 +1895,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1895 | case fceil_op: | 1895 | case fceil_op: |
1896 | case ffloor_op:{ | 1896 | case ffloor_op:{ |
1897 | unsigned int oldrm = ieee754_csr.rm; | 1897 | unsigned int oldrm = ieee754_csr.rm; |
1898 | ieee754dp fs; | 1898 | union ieee754dp fs; |
1899 | 1899 | ||
1900 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1900 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1901 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; | 1901 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; |
@@ -1908,7 +1908,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1908 | 1908 | ||
1909 | #if defined(__mips64) | 1909 | #if defined(__mips64) |
1910 | case fcvtl_op:{ | 1910 | case fcvtl_op:{ |
1911 | ieee754dp fs; | 1911 | union ieee754dp fs; |
1912 | 1912 | ||
1913 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1913 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1914 | rv.l = ieee754dp_tlong(fs); | 1914 | rv.l = ieee754dp_tlong(fs); |
@@ -1921,7 +1921,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1921 | case fceill_op: | 1921 | case fceill_op: |
1922 | case ffloorl_op:{ | 1922 | case ffloorl_op:{ |
1923 | unsigned int oldrm = ieee754_csr.rm; | 1923 | unsigned int oldrm = ieee754_csr.rm; |
1924 | ieee754dp fs; | 1924 | union ieee754dp fs; |
1925 | 1925 | ||
1926 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1926 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1927 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; | 1927 | ieee754_csr.rm = ieee_rm[modeindex(MIPSInst_FUNC(ir))]; |
@@ -1935,7 +1935,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1935 | default: | 1935 | default: |
1936 | if (MIPSInst_FUNC(ir) >= fcmp_op) { | 1936 | if (MIPSInst_FUNC(ir) >= fcmp_op) { |
1937 | unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; | 1937 | unsigned cmpop = MIPSInst_FUNC(ir) - fcmp_op; |
1938 | ieee754dp fs, ft; | 1938 | union ieee754dp fs, ft; |
1939 | 1939 | ||
1940 | DPFROMREG(fs, MIPSInst_FS(ir)); | 1940 | DPFROMREG(fs, MIPSInst_FS(ir)); |
1941 | DPFROMREG(ft, MIPSInst_FT(ir)); | 1941 | DPFROMREG(ft, MIPSInst_FT(ir)); |
@@ -1960,7 +1960,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1960 | } | 1960 | } |
1961 | 1961 | ||
1962 | case w_fmt:{ | 1962 | case w_fmt:{ |
1963 | ieee754sp fs; | 1963 | union ieee754sp fs; |
1964 | 1964 | ||
1965 | switch (MIPSInst_FUNC(ir)) { | 1965 | switch (MIPSInst_FUNC(ir)) { |
1966 | case fcvts_op: | 1966 | case fcvts_op: |
diff --git a/arch/mips/math-emu/dp_add.c b/arch/mips/math-emu/dp_add.c index c57c8adc42c4..b5aac129e9f1 100644 --- a/arch/mips/math-emu/dp_add.c +++ b/arch/mips/math-emu/dp_add.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #include "ieee754dp.h" | 28 | #include "ieee754dp.h" |
29 | 29 | ||
30 | ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y) | 30 | union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y) |
31 | { | 31 | { |
32 | COMPXDP; | 32 | COMPXDP; |
33 | COMPYDP; | 33 | COMPYDP; |
diff --git a/arch/mips/math-emu/dp_cmp.c b/arch/mips/math-emu/dp_cmp.c index 0f32486b0ed9..a3b4984d2e83 100644 --- a/arch/mips/math-emu/dp_cmp.c +++ b/arch/mips/math-emu/dp_cmp.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | int ieee754dp_cmp(ieee754dp x, ieee754dp y, int cmp, int sig) | 29 | int ieee754dp_cmp(union ieee754dp x, union ieee754dp y, int cmp, int sig) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | COMPYDP; | 32 | COMPYDP; |
diff --git a/arch/mips/math-emu/dp_div.c b/arch/mips/math-emu/dp_div.c index a1bce1b7c09c..30cc7fa3ce37 100644 --- a/arch/mips/math-emu/dp_div.c +++ b/arch/mips/math-emu/dp_div.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y) | 29 | union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | COMPYDP; | 32 | COMPYDP; |
diff --git a/arch/mips/math-emu/dp_fint.c b/arch/mips/math-emu/dp_fint.c index 88571288c9e0..60ed6ec7ddc7 100644 --- a/arch/mips/math-emu/dp_fint.c +++ b/arch/mips/math-emu/dp_fint.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_fint(int x) | 29 | union ieee754dp ieee754dp_fint(int x) |
30 | { | 30 | { |
31 | u64 xm; | 31 | u64 xm; |
32 | int xe; | 32 | int xe; |
@@ -70,7 +70,7 @@ ieee754dp ieee754dp_fint(int x) | |||
70 | #endif | 70 | #endif |
71 | } | 71 | } |
72 | 72 | ||
73 | ieee754dp ieee754dp_funs(unsigned int u) | 73 | union ieee754dp ieee754dp_funs(unsigned int u) |
74 | { | 74 | { |
75 | if ((int) u < 0) | 75 | if ((int) u < 0) |
76 | return ieee754dp_add(ieee754dp_1e31(), | 76 | return ieee754dp_add(ieee754dp_1e31(), |
diff --git a/arch/mips/math-emu/dp_flong.c b/arch/mips/math-emu/dp_flong.c index 14fc01ec742d..2418f9d03055 100644 --- a/arch/mips/math-emu/dp_flong.c +++ b/arch/mips/math-emu/dp_flong.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_flong(s64 x) | 29 | union ieee754dp ieee754dp_flong(s64 x) |
30 | { | 30 | { |
31 | u64 xm; | 31 | u64 xm; |
32 | int xe; | 32 | int xe; |
@@ -68,7 +68,7 @@ ieee754dp ieee754dp_flong(s64 x) | |||
68 | DPNORMRET1(xs, xe, xm, "dp_flong", x); | 68 | DPNORMRET1(xs, xe, xm, "dp_flong", x); |
69 | } | 69 | } |
70 | 70 | ||
71 | ieee754dp ieee754dp_fulong(u64 u) | 71 | union ieee754dp ieee754dp_fulong(u64 u) |
72 | { | 72 | { |
73 | if ((s64) u < 0) | 73 | if ((s64) u < 0) |
74 | return ieee754dp_add(ieee754dp_1e63(), | 74 | return ieee754dp_add(ieee754dp_1e63(), |
diff --git a/arch/mips/math-emu/dp_frexp.c b/arch/mips/math-emu/dp_frexp.c index cb15a5eaecbb..6ab7df958362 100644 --- a/arch/mips/math-emu/dp_frexp.c +++ b/arch/mips/math-emu/dp_frexp.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | /* close to ieeep754dp_logb | 29 | /* close to ieeep754dp_logb |
30 | */ | 30 | */ |
31 | ieee754dp ieee754dp_frexp(ieee754dp x, int *eptr) | 31 | union ieee754dp ieee754dp_frexp(union ieee754dp x, int *eptr) |
32 | { | 32 | { |
33 | COMPXDP; | 33 | COMPXDP; |
34 | CLEARCX; | 34 | CLEARCX; |
diff --git a/arch/mips/math-emu/dp_fsp.c b/arch/mips/math-emu/dp_fsp.c index daed6834dc15..d69cb1ad3f60 100644 --- a/arch/mips/math-emu/dp_fsp.c +++ b/arch/mips/math-emu/dp_fsp.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_fsp(ieee754sp x) | 29 | union ieee754dp ieee754dp_fsp(union ieee754sp x) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | 32 | ||
diff --git a/arch/mips/math-emu/dp_logb.c b/arch/mips/math-emu/dp_logb.c index 151127e59f5c..80116e2f331f 100644 --- a/arch/mips/math-emu/dp_logb.c +++ b/arch/mips/math-emu/dp_logb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_logb(ieee754dp x) | 29 | union ieee754dp ieee754dp_logb(union ieee754dp x) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | 32 | ||
diff --git a/arch/mips/math-emu/dp_modf.c b/arch/mips/math-emu/dp_modf.c index b01f9cf6d402..cbc1386cdfca 100644 --- a/arch/mips/math-emu/dp_modf.c +++ b/arch/mips/math-emu/dp_modf.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | /* modf function is always exact for a finite number | 29 | /* modf function is always exact for a finite number |
30 | */ | 30 | */ |
31 | ieee754dp ieee754dp_modf(ieee754dp x, ieee754dp *ip) | 31 | union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp *ip) |
32 | { | 32 | { |
33 | COMPXDP; | 33 | COMPXDP; |
34 | 34 | ||
diff --git a/arch/mips/math-emu/dp_mul.c b/arch/mips/math-emu/dp_mul.c index 09175f461920..c4cad69c377e 100644 --- a/arch/mips/math-emu/dp_mul.c +++ b/arch/mips/math-emu/dp_mul.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y) | 29 | union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | COMPYDP; | 32 | COMPYDP; |
diff --git a/arch/mips/math-emu/dp_scalb.c b/arch/mips/math-emu/dp_scalb.c index 6f5df438dda8..4f8b65622942 100644 --- a/arch/mips/math-emu/dp_scalb.c +++ b/arch/mips/math-emu/dp_scalb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_scalb(ieee754dp x, int n) | 29 | union ieee754dp ieee754dp_scalb(union ieee754dp x, int n) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | 32 | ||
@@ -51,7 +51,7 @@ ieee754dp ieee754dp_scalb(ieee754dp x, int n) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
54 | ieee754dp ieee754dp_ldexp(ieee754dp x, int n) | 54 | union ieee754dp ieee754dp_ldexp(union ieee754dp x, int n) |
55 | { | 55 | { |
56 | return ieee754dp_scalb(x, n); | 56 | return ieee754dp_scalb(x, n); |
57 | } | 57 | } |
diff --git a/arch/mips/math-emu/dp_simple.c b/arch/mips/math-emu/dp_simple.c index 79ce2673a714..b341cc83eeb0 100644 --- a/arch/mips/math-emu/dp_simple.c +++ b/arch/mips/math-emu/dp_simple.c | |||
@@ -26,12 +26,12 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | int ieee754dp_finite(ieee754dp x) | 29 | int ieee754dp_finite(union ieee754dp x) |
30 | { | 30 | { |
31 | return DPBEXP(x) != DP_EMAX + 1 + DP_EBIAS; | 31 | return DPBEXP(x) != DP_EMAX + 1 + DP_EBIAS; |
32 | } | 32 | } |
33 | 33 | ||
34 | ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y) | 34 | union ieee754dp ieee754dp_copysign(union ieee754dp x, union ieee754dp y) |
35 | { | 35 | { |
36 | CLEARCX; | 36 | CLEARCX; |
37 | DPSIGN(x) = DPSIGN(y); | 37 | DPSIGN(x) = DPSIGN(y); |
@@ -39,7 +39,7 @@ ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y) | |||
39 | } | 39 | } |
40 | 40 | ||
41 | 41 | ||
42 | ieee754dp ieee754dp_neg(ieee754dp x) | 42 | union ieee754dp ieee754dp_neg(union ieee754dp x) |
43 | { | 43 | { |
44 | COMPXDP; | 44 | COMPXDP; |
45 | 45 | ||
@@ -55,7 +55,7 @@ ieee754dp ieee754dp_neg(ieee754dp x) | |||
55 | DPSIGN(x) ^= 1; | 55 | DPSIGN(x) ^= 1; |
56 | 56 | ||
57 | if (xc == IEEE754_CLASS_SNAN) { | 57 | if (xc == IEEE754_CLASS_SNAN) { |
58 | ieee754dp y = ieee754dp_indef(); | 58 | union ieee754dp y = ieee754dp_indef(); |
59 | SETCX(IEEE754_INVALID_OPERATION); | 59 | SETCX(IEEE754_INVALID_OPERATION); |
60 | DPSIGN(y) = DPSIGN(x); | 60 | DPSIGN(y) = DPSIGN(x); |
61 | return ieee754dp_nanxcpt(y, "neg"); | 61 | return ieee754dp_nanxcpt(y, "neg"); |
@@ -65,7 +65,7 @@ ieee754dp ieee754dp_neg(ieee754dp x) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | ieee754dp ieee754dp_abs(ieee754dp x) | 68 | union ieee754dp ieee754dp_abs(union ieee754dp x) |
69 | { | 69 | { |
70 | COMPXDP; | 70 | COMPXDP; |
71 | 71 | ||
diff --git a/arch/mips/math-emu/dp_sqrt.c b/arch/mips/math-emu/dp_sqrt.c index b874d60a942b..cee9f3c2700d 100644 --- a/arch/mips/math-emu/dp_sqrt.c +++ b/arch/mips/math-emu/dp_sqrt.c | |||
@@ -34,10 +34,10 @@ static const unsigned table[] = { | |||
34 | 1742, 661, 130 | 34 | 1742, 661, 130 |
35 | }; | 35 | }; |
36 | 36 | ||
37 | ieee754dp ieee754dp_sqrt(ieee754dp x) | 37 | union ieee754dp ieee754dp_sqrt(union ieee754dp x) |
38 | { | 38 | { |
39 | struct _ieee754_csr oldcsr; | 39 | struct _ieee754_csr oldcsr; |
40 | ieee754dp y, z, t; | 40 | union ieee754dp y, z, t; |
41 | unsigned scalx, yh; | 41 | unsigned scalx, yh; |
42 | COMPXDP; | 42 | COMPXDP; |
43 | 43 | ||
diff --git a/arch/mips/math-emu/dp_sub.c b/arch/mips/math-emu/dp_sub.c index 91e0a4b5cbc7..1e8f19ae6cd5 100644 --- a/arch/mips/math-emu/dp_sub.c +++ b/arch/mips/math-emu/dp_sub.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y) | 29 | union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | COMPYDP; | 32 | COMPYDP; |
diff --git a/arch/mips/math-emu/dp_tint.c b/arch/mips/math-emu/dp_tint.c index 0ebe8598b94a..2a00805fdbeb 100644 --- a/arch/mips/math-emu/dp_tint.c +++ b/arch/mips/math-emu/dp_tint.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include "ieee754dp.h" | 28 | #include "ieee754dp.h" |
29 | 29 | ||
30 | int ieee754dp_tint(ieee754dp x) | 30 | int ieee754dp_tint(union ieee754dp x) |
31 | { | 31 | { |
32 | COMPXDP; | 32 | COMPXDP; |
33 | 33 | ||
@@ -109,9 +109,9 @@ int ieee754dp_tint(ieee754dp x) | |||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | unsigned int ieee754dp_tuns(ieee754dp x) | 112 | unsigned int ieee754dp_tuns(union ieee754dp x) |
113 | { | 113 | { |
114 | ieee754dp hb = ieee754dp_1e31(); | 114 | union ieee754dp hb = ieee754dp_1e31(); |
115 | 115 | ||
116 | /* what if x < 0 ?? */ | 116 | /* what if x < 0 ?? */ |
117 | if (ieee754dp_lt(x, hb)) | 117 | if (ieee754dp_lt(x, hb)) |
diff --git a/arch/mips/math-emu/dp_tlong.c b/arch/mips/math-emu/dp_tlong.c index 133ce2ba0012..3366399eebe8 100644 --- a/arch/mips/math-emu/dp_tlong.c +++ b/arch/mips/math-emu/dp_tlong.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754dp.h" | 27 | #include "ieee754dp.h" |
28 | 28 | ||
29 | s64 ieee754dp_tlong(ieee754dp x) | 29 | s64 ieee754dp_tlong(union ieee754dp x) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | 32 | ||
@@ -112,9 +112,9 @@ s64 ieee754dp_tlong(ieee754dp x) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | 114 | ||
115 | u64 ieee754dp_tulong(ieee754dp x) | 115 | u64 ieee754dp_tulong(union ieee754dp x) |
116 | { | 116 | { |
117 | ieee754dp hb = ieee754dp_1e63(); | 117 | union ieee754dp hb = ieee754dp_1e63(); |
118 | 118 | ||
119 | /* what if x < 0 ?? */ | 119 | /* what if x < 0 ?? */ |
120 | if (ieee754dp_lt(x, hb)) | 120 | if (ieee754dp_lt(x, hb)) |
diff --git a/arch/mips/math-emu/ieee754.h b/arch/mips/math-emu/ieee754.h index 9e8c26e850fe..05705fa785c3 100644 --- a/arch/mips/math-emu/ieee754.h +++ b/arch/mips/math-emu/ieee754.h | |||
@@ -46,7 +46,7 @@ struct ieee754dp_const { | |||
46 | ;)))) | 46 | ;)))) |
47 | }; | 47 | }; |
48 | 48 | ||
49 | typedef union _ieee754dp { | 49 | union ieee754dp { |
50 | struct ieee754dp_const oparts; | 50 | struct ieee754dp_const oparts; |
51 | struct { | 51 | struct { |
52 | __BITFIELD_FIELD(unsigned int sign:1, | 52 | __BITFIELD_FIELD(unsigned int sign:1, |
@@ -56,7 +56,7 @@ typedef union _ieee754dp { | |||
56 | } parts; | 56 | } parts; |
57 | double d; | 57 | double d; |
58 | u64 bits; | 58 | u64 bits; |
59 | } ieee754dp; | 59 | }; |
60 | 60 | ||
61 | struct ieee754sp_const { | 61 | struct ieee754sp_const { |
62 | __BITFIELD_FIELD(unsigned sign:1, | 62 | __BITFIELD_FIELD(unsigned sign:1, |
@@ -65,106 +65,106 @@ struct ieee754sp_const { | |||
65 | ;))) | 65 | ;))) |
66 | }; | 66 | }; |
67 | 67 | ||
68 | typedef union _ieee754sp { | 68 | union ieee754sp { |
69 | struct ieee754sp_const parts; | 69 | struct ieee754sp_const parts; |
70 | float f; | 70 | float f; |
71 | u32 bits; | 71 | u32 bits; |
72 | } ieee754sp; | 72 | }; |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * single precision (often aka float) | 75 | * single precision (often aka float) |
76 | */ | 76 | */ |
77 | int ieee754sp_finite(ieee754sp x); | 77 | int ieee754sp_finite(union ieee754sp x); |
78 | int ieee754sp_class(ieee754sp x); | 78 | int ieee754sp_class(union ieee754sp x); |
79 | 79 | ||
80 | ieee754sp ieee754sp_abs(ieee754sp x); | 80 | union ieee754sp ieee754sp_abs(union ieee754sp x); |
81 | ieee754sp ieee754sp_neg(ieee754sp x); | 81 | union ieee754sp ieee754sp_neg(union ieee754sp x); |
82 | ieee754sp ieee754sp_scalb(ieee754sp x, int); | 82 | union ieee754sp ieee754sp_scalb(union ieee754sp x, int); |
83 | ieee754sp ieee754sp_logb(ieee754sp x); | 83 | union ieee754sp ieee754sp_logb(union ieee754sp x); |
84 | 84 | ||
85 | /* x with sign of y */ | 85 | /* x with sign of y */ |
86 | ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y); | 86 | union ieee754sp ieee754sp_copysign(union ieee754sp x, union ieee754sp y); |
87 | 87 | ||
88 | ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y); | 88 | union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y); |
89 | ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y); | 89 | union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y); |
90 | ieee754sp ieee754sp_mul(ieee754sp x, ieee754sp y); | 90 | union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y); |
91 | ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y); | 91 | union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y); |
92 | 92 | ||
93 | ieee754sp ieee754sp_fint(int x); | 93 | union ieee754sp ieee754sp_fint(int x); |
94 | ieee754sp ieee754sp_funs(unsigned x); | 94 | union ieee754sp ieee754sp_funs(unsigned x); |
95 | ieee754sp ieee754sp_flong(s64 x); | 95 | union ieee754sp ieee754sp_flong(s64 x); |
96 | ieee754sp ieee754sp_fulong(u64 x); | 96 | union ieee754sp ieee754sp_fulong(u64 x); |
97 | ieee754sp ieee754sp_fdp(ieee754dp x); | 97 | union ieee754sp ieee754sp_fdp(union ieee754dp x); |
98 | 98 | ||
99 | int ieee754sp_tint(ieee754sp x); | 99 | int ieee754sp_tint(union ieee754sp x); |
100 | unsigned int ieee754sp_tuns(ieee754sp x); | 100 | unsigned int ieee754sp_tuns(union ieee754sp x); |
101 | s64 ieee754sp_tlong(ieee754sp x); | 101 | s64 ieee754sp_tlong(union ieee754sp x); |
102 | u64 ieee754sp_tulong(ieee754sp x); | 102 | u64 ieee754sp_tulong(union ieee754sp x); |
103 | 103 | ||
104 | int ieee754sp_cmp(ieee754sp x, ieee754sp y, int cop, int sig); | 104 | int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cop, int sig); |
105 | /* | 105 | /* |
106 | * basic sp math | 106 | * basic sp math |
107 | */ | 107 | */ |
108 | ieee754sp ieee754sp_modf(ieee754sp x, ieee754sp * ip); | 108 | union ieee754sp ieee754sp_modf(union ieee754sp x, union ieee754sp * ip); |
109 | ieee754sp ieee754sp_frexp(ieee754sp x, int *exp); | 109 | union ieee754sp ieee754sp_frexp(union ieee754sp x, int *exp); |
110 | ieee754sp ieee754sp_ldexp(ieee754sp x, int exp); | 110 | union ieee754sp ieee754sp_ldexp(union ieee754sp x, int exp); |
111 | 111 | ||
112 | ieee754sp ieee754sp_ceil(ieee754sp x); | 112 | union ieee754sp ieee754sp_ceil(union ieee754sp x); |
113 | ieee754sp ieee754sp_floor(ieee754sp x); | 113 | union ieee754sp ieee754sp_floor(union ieee754sp x); |
114 | ieee754sp ieee754sp_trunc(ieee754sp x); | 114 | union ieee754sp ieee754sp_trunc(union ieee754sp x); |
115 | 115 | ||
116 | ieee754sp ieee754sp_sqrt(ieee754sp x); | 116 | union ieee754sp ieee754sp_sqrt(union ieee754sp x); |
117 | 117 | ||
118 | /* | 118 | /* |
119 | * double precision (often aka double) | 119 | * double precision (often aka double) |
120 | */ | 120 | */ |
121 | int ieee754dp_finite(ieee754dp x); | 121 | int ieee754dp_finite(union ieee754dp x); |
122 | int ieee754dp_class(ieee754dp x); | 122 | int ieee754dp_class(union ieee754dp x); |
123 | 123 | ||
124 | /* x with sign of y */ | 124 | /* x with sign of y */ |
125 | ieee754dp ieee754dp_copysign(ieee754dp x, ieee754dp y); | 125 | union ieee754dp ieee754dp_copysign(union ieee754dp x, union ieee754dp y); |
126 | 126 | ||
127 | ieee754dp ieee754dp_add(ieee754dp x, ieee754dp y); | 127 | union ieee754dp ieee754dp_add(union ieee754dp x, union ieee754dp y); |
128 | ieee754dp ieee754dp_sub(ieee754dp x, ieee754dp y); | 128 | union ieee754dp ieee754dp_sub(union ieee754dp x, union ieee754dp y); |
129 | ieee754dp ieee754dp_mul(ieee754dp x, ieee754dp y); | 129 | union ieee754dp ieee754dp_mul(union ieee754dp x, union ieee754dp y); |
130 | ieee754dp ieee754dp_div(ieee754dp x, ieee754dp y); | 130 | union ieee754dp ieee754dp_div(union ieee754dp x, union ieee754dp y); |
131 | 131 | ||
132 | ieee754dp ieee754dp_abs(ieee754dp x); | 132 | union ieee754dp ieee754dp_abs(union ieee754dp x); |
133 | ieee754dp ieee754dp_neg(ieee754dp x); | 133 | union ieee754dp ieee754dp_neg(union ieee754dp x); |
134 | ieee754dp ieee754dp_scalb(ieee754dp x, int); | 134 | union ieee754dp ieee754dp_scalb(union ieee754dp x, int); |
135 | 135 | ||
136 | /* return exponent as integer in floating point format | 136 | /* return exponent as integer in floating point format |
137 | */ | 137 | */ |
138 | ieee754dp ieee754dp_logb(ieee754dp x); | 138 | union ieee754dp ieee754dp_logb(union ieee754dp x); |
139 | 139 | ||
140 | ieee754dp ieee754dp_fint(int x); | 140 | union ieee754dp ieee754dp_fint(int x); |
141 | ieee754dp ieee754dp_funs(unsigned x); | 141 | union ieee754dp ieee754dp_funs(unsigned x); |
142 | ieee754dp ieee754dp_flong(s64 x); | 142 | union ieee754dp ieee754dp_flong(s64 x); |
143 | ieee754dp ieee754dp_fulong(u64 x); | 143 | union ieee754dp ieee754dp_fulong(u64 x); |
144 | ieee754dp ieee754dp_fsp(ieee754sp x); | 144 | union ieee754dp ieee754dp_fsp(union ieee754sp x); |
145 | 145 | ||
146 | ieee754dp ieee754dp_ceil(ieee754dp x); | 146 | union ieee754dp ieee754dp_ceil(union ieee754dp x); |
147 | ieee754dp ieee754dp_floor(ieee754dp x); | 147 | union ieee754dp ieee754dp_floor(union ieee754dp x); |
148 | ieee754dp ieee754dp_trunc(ieee754dp x); | 148 | union ieee754dp ieee754dp_trunc(union ieee754dp x); |
149 | 149 | ||
150 | int ieee754dp_tint(ieee754dp x); | 150 | int ieee754dp_tint(union ieee754dp x); |
151 | unsigned int ieee754dp_tuns(ieee754dp x); | 151 | unsigned int ieee754dp_tuns(union ieee754dp x); |
152 | s64 ieee754dp_tlong(ieee754dp x); | 152 | s64 ieee754dp_tlong(union ieee754dp x); |
153 | u64 ieee754dp_tulong(ieee754dp x); | 153 | u64 ieee754dp_tulong(union ieee754dp x); |
154 | 154 | ||
155 | int ieee754dp_cmp(ieee754dp x, ieee754dp y, int cop, int sig); | 155 | int ieee754dp_cmp(union ieee754dp x, union ieee754dp y, int cop, int sig); |
156 | /* | 156 | /* |
157 | * basic sp math | 157 | * basic sp math |
158 | */ | 158 | */ |
159 | ieee754dp ieee754dp_modf(ieee754dp x, ieee754dp * ip); | 159 | union ieee754dp ieee754dp_modf(union ieee754dp x, union ieee754dp * ip); |
160 | ieee754dp ieee754dp_frexp(ieee754dp x, int *exp); | 160 | union ieee754dp ieee754dp_frexp(union ieee754dp x, int *exp); |
161 | ieee754dp ieee754dp_ldexp(ieee754dp x, int exp); | 161 | union ieee754dp ieee754dp_ldexp(union ieee754dp x, int exp); |
162 | 162 | ||
163 | ieee754dp ieee754dp_ceil(ieee754dp x); | 163 | union ieee754dp ieee754dp_ceil(union ieee754dp x); |
164 | ieee754dp ieee754dp_floor(ieee754dp x); | 164 | union ieee754dp ieee754dp_floor(union ieee754dp x); |
165 | ieee754dp ieee754dp_trunc(ieee754dp x); | 165 | union ieee754dp ieee754dp_trunc(union ieee754dp x); |
166 | 166 | ||
167 | ieee754dp ieee754dp_sqrt(ieee754dp x); | 167 | union ieee754dp ieee754dp_sqrt(union ieee754dp x); |
168 | 168 | ||
169 | 169 | ||
170 | 170 | ||
@@ -204,65 +204,65 @@ ieee754dp ieee754dp_sqrt(ieee754dp x); | |||
204 | 204 | ||
205 | /* "normal" comparisons | 205 | /* "normal" comparisons |
206 | */ | 206 | */ |
207 | static inline int ieee754sp_eq(ieee754sp x, ieee754sp y) | 207 | static inline int ieee754sp_eq(union ieee754sp x, union ieee754sp y) |
208 | { | 208 | { |
209 | return ieee754sp_cmp(x, y, IEEE754_CEQ, 0); | 209 | return ieee754sp_cmp(x, y, IEEE754_CEQ, 0); |
210 | } | 210 | } |
211 | 211 | ||
212 | static inline int ieee754sp_ne(ieee754sp x, ieee754sp y) | 212 | static inline int ieee754sp_ne(union ieee754sp x, union ieee754sp y) |
213 | { | 213 | { |
214 | return ieee754sp_cmp(x, y, | 214 | return ieee754sp_cmp(x, y, |
215 | IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); | 215 | IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); |
216 | } | 216 | } |
217 | 217 | ||
218 | static inline int ieee754sp_lt(ieee754sp x, ieee754sp y) | 218 | static inline int ieee754sp_lt(union ieee754sp x, union ieee754sp y) |
219 | { | 219 | { |
220 | return ieee754sp_cmp(x, y, IEEE754_CLT, 0); | 220 | return ieee754sp_cmp(x, y, IEEE754_CLT, 0); |
221 | } | 221 | } |
222 | 222 | ||
223 | static inline int ieee754sp_le(ieee754sp x, ieee754sp y) | 223 | static inline int ieee754sp_le(union ieee754sp x, union ieee754sp y) |
224 | { | 224 | { |
225 | return ieee754sp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); | 225 | return ieee754sp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); |
226 | } | 226 | } |
227 | 227 | ||
228 | static inline int ieee754sp_gt(ieee754sp x, ieee754sp y) | 228 | static inline int ieee754sp_gt(union ieee754sp x, union ieee754sp y) |
229 | { | 229 | { |
230 | return ieee754sp_cmp(x, y, IEEE754_CGT, 0); | 230 | return ieee754sp_cmp(x, y, IEEE754_CGT, 0); |
231 | } | 231 | } |
232 | 232 | ||
233 | 233 | ||
234 | static inline int ieee754sp_ge(ieee754sp x, ieee754sp y) | 234 | static inline int ieee754sp_ge(union ieee754sp x, union ieee754sp y) |
235 | { | 235 | { |
236 | return ieee754sp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); | 236 | return ieee754sp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); |
237 | } | 237 | } |
238 | 238 | ||
239 | static inline int ieee754dp_eq(ieee754dp x, ieee754dp y) | 239 | static inline int ieee754dp_eq(union ieee754dp x, union ieee754dp y) |
240 | { | 240 | { |
241 | return ieee754dp_cmp(x, y, IEEE754_CEQ, 0); | 241 | return ieee754dp_cmp(x, y, IEEE754_CEQ, 0); |
242 | } | 242 | } |
243 | 243 | ||
244 | static inline int ieee754dp_ne(ieee754dp x, ieee754dp y) | 244 | static inline int ieee754dp_ne(union ieee754dp x, union ieee754dp y) |
245 | { | 245 | { |
246 | return ieee754dp_cmp(x, y, | 246 | return ieee754dp_cmp(x, y, |
247 | IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); | 247 | IEEE754_CLT | IEEE754_CGT | IEEE754_CUN, 0); |
248 | } | 248 | } |
249 | 249 | ||
250 | static inline int ieee754dp_lt(ieee754dp x, ieee754dp y) | 250 | static inline int ieee754dp_lt(union ieee754dp x, union ieee754dp y) |
251 | { | 251 | { |
252 | return ieee754dp_cmp(x, y, IEEE754_CLT, 0); | 252 | return ieee754dp_cmp(x, y, IEEE754_CLT, 0); |
253 | } | 253 | } |
254 | 254 | ||
255 | static inline int ieee754dp_le(ieee754dp x, ieee754dp y) | 255 | static inline int ieee754dp_le(union ieee754dp x, union ieee754dp y) |
256 | { | 256 | { |
257 | return ieee754dp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); | 257 | return ieee754dp_cmp(x, y, IEEE754_CLT | IEEE754_CEQ, 0); |
258 | } | 258 | } |
259 | 259 | ||
260 | static inline int ieee754dp_gt(ieee754dp x, ieee754dp y) | 260 | static inline int ieee754dp_gt(union ieee754dp x, union ieee754dp y) |
261 | { | 261 | { |
262 | return ieee754dp_cmp(x, y, IEEE754_CGT, 0); | 262 | return ieee754dp_cmp(x, y, IEEE754_CGT, 0); |
263 | } | 263 | } |
264 | 264 | ||
265 | static inline int ieee754dp_ge(ieee754dp x, ieee754dp y) | 265 | static inline int ieee754dp_ge(union ieee754dp x, union ieee754dp y) |
266 | { | 266 | { |
267 | return ieee754dp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); | 267 | return ieee754dp_cmp(x, y, IEEE754_CGT | IEEE754_CEQ, 0); |
268 | } | 268 | } |
@@ -271,8 +271,8 @@ static inline int ieee754dp_ge(ieee754dp x, ieee754dp y) | |||
271 | /* | 271 | /* |
272 | * Like strtod | 272 | * Like strtod |
273 | */ | 273 | */ |
274 | ieee754dp ieee754dp_fstr(const char *s, char **endp); | 274 | union ieee754dp ieee754dp_fstr(const char *s, char **endp); |
275 | char *ieee754dp_tstr(ieee754dp x, int prec, int fmt, int af); | 275 | char *ieee754dp_tstr(union ieee754dp x, int prec, int fmt, int af); |
276 | 276 | ||
277 | 277 | ||
278 | /* | 278 | /* |
@@ -338,8 +338,8 @@ static inline int ieee754_sxtest(unsigned n) | |||
338 | } | 338 | } |
339 | 339 | ||
340 | /* debugging */ | 340 | /* debugging */ |
341 | ieee754sp ieee754sp_dump(char *s, ieee754sp x); | 341 | union ieee754sp ieee754sp_dump(char *s, union ieee754sp x); |
342 | ieee754dp ieee754dp_dump(char *s, ieee754dp x); | 342 | union ieee754dp ieee754dp_dump(char *s, union ieee754dp x); |
343 | 343 | ||
344 | #define IEEE754_SPCVAL_PZERO 0 | 344 | #define IEEE754_SPCVAL_PZERO 0 |
345 | #define IEEE754_SPCVAL_NZERO 1 | 345 | #define IEEE754_SPCVAL_NZERO 1 |
@@ -361,8 +361,8 @@ ieee754dp ieee754dp_dump(char *s, ieee754dp x); | |||
361 | 361 | ||
362 | extern const struct ieee754dp_const __ieee754dp_spcvals[]; | 362 | extern const struct ieee754dp_const __ieee754dp_spcvals[]; |
363 | extern const struct ieee754sp_const __ieee754sp_spcvals[]; | 363 | extern const struct ieee754sp_const __ieee754sp_spcvals[]; |
364 | #define ieee754dp_spcvals ((const ieee754dp *)__ieee754dp_spcvals) | 364 | #define ieee754dp_spcvals ((const union ieee754dp *)__ieee754dp_spcvals) |
365 | #define ieee754sp_spcvals ((const ieee754sp *)__ieee754sp_spcvals) | 365 | #define ieee754sp_spcvals ((const union ieee754sp *)__ieee754sp_spcvals) |
366 | 366 | ||
367 | /* | 367 | /* |
368 | * Return infinity with given sign | 368 | * Return infinity with given sign |
@@ -404,8 +404,8 @@ struct ieee754xctx { | |||
404 | const char *op; /* operation name */ | 404 | const char *op; /* operation name */ |
405 | int rt; /* result type */ | 405 | int rt; /* result type */ |
406 | union { | 406 | union { |
407 | ieee754sp sp; /* single precision */ | 407 | union ieee754sp sp; /* single precision */ |
408 | ieee754dp dp; /* double precision */ | 408 | union ieee754dp dp; /* double precision */ |
409 | #ifdef IEEE854_XP | 409 | #ifdef IEEE854_XP |
410 | ieee754xp xp; /* extended precision */ | 410 | ieee754xp xp; /* extended precision */ |
411 | #endif | 411 | #endif |
diff --git a/arch/mips/math-emu/ieee754d.c b/arch/mips/math-emu/ieee754d.c index 9599bdd32585..627932839d57 100644 --- a/arch/mips/math-emu/ieee754d.c +++ b/arch/mips/math-emu/ieee754d.c | |||
@@ -56,7 +56,7 @@ | |||
56 | #define DPBEXP(dp) (dp.parts.bexp) | 56 | #define DPBEXP(dp) (dp.parts.bexp) |
57 | #define DPMANT(dp) (dp.parts.mant) | 57 | #define DPMANT(dp) (dp.parts.mant) |
58 | 58 | ||
59 | ieee754dp ieee754dp_dump(char *m, ieee754dp x) | 59 | union ieee754dp ieee754dp_dump(char *m, union ieee754dp x) |
60 | { | 60 | { |
61 | int i; | 61 | int i; |
62 | 62 | ||
@@ -96,7 +96,7 @@ ieee754dp ieee754dp_dump(char *m, ieee754dp x) | |||
96 | return x; | 96 | return x; |
97 | } | 97 | } |
98 | 98 | ||
99 | ieee754sp ieee754sp_dump(char *m, ieee754sp x) | 99 | union ieee754sp ieee754sp_dump(char *m, union ieee754sp x) |
100 | { | 100 | { |
101 | int i; | 101 | int i; |
102 | 102 | ||
diff --git a/arch/mips/math-emu/ieee754dp.c b/arch/mips/math-emu/ieee754dp.c index df59d16bd4fd..3692362b8072 100644 --- a/arch/mips/math-emu/ieee754dp.c +++ b/arch/mips/math-emu/ieee754dp.c | |||
@@ -27,26 +27,26 @@ | |||
27 | 27 | ||
28 | #include "ieee754dp.h" | 28 | #include "ieee754dp.h" |
29 | 29 | ||
30 | int ieee754dp_class(ieee754dp x) | 30 | int ieee754dp_class(union ieee754dp x) |
31 | { | 31 | { |
32 | COMPXDP; | 32 | COMPXDP; |
33 | EXPLODEXDP; | 33 | EXPLODEXDP; |
34 | return xc; | 34 | return xc; |
35 | } | 35 | } |
36 | 36 | ||
37 | int ieee754dp_isnan(ieee754dp x) | 37 | int ieee754dp_isnan(union ieee754dp x) |
38 | { | 38 | { |
39 | return ieee754dp_class(x) >= IEEE754_CLASS_SNAN; | 39 | return ieee754dp_class(x) >= IEEE754_CLASS_SNAN; |
40 | } | 40 | } |
41 | 41 | ||
42 | int ieee754dp_issnan(ieee754dp x) | 42 | int ieee754dp_issnan(union ieee754dp x) |
43 | { | 43 | { |
44 | assert(ieee754dp_isnan(x)); | 44 | assert(ieee754dp_isnan(x)); |
45 | return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1)); | 45 | return ((DPMANT(x) & DP_MBIT(DP_MBITS-1)) == DP_MBIT(DP_MBITS-1)); |
46 | } | 46 | } |
47 | 47 | ||
48 | 48 | ||
49 | ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...) | 49 | union ieee754dp __cold ieee754dp_xcpt(union ieee754dp r, const char *op, ...) |
50 | { | 50 | { |
51 | struct ieee754xctx ax; | 51 | struct ieee754xctx ax; |
52 | if (!TSTX()) | 52 | if (!TSTX()) |
@@ -61,7 +61,7 @@ ieee754dp __cold ieee754dp_xcpt(ieee754dp r, const char *op, ...) | |||
61 | return ax.rv.dp; | 61 | return ax.rv.dp; |
62 | } | 62 | } |
63 | 63 | ||
64 | ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) | 64 | union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp r, const char *op, ...) |
65 | { | 65 | { |
66 | struct ieee754xctx ax; | 66 | struct ieee754xctx ax; |
67 | 67 | ||
@@ -88,7 +88,7 @@ ieee754dp __cold ieee754dp_nanxcpt(ieee754dp r, const char *op, ...) | |||
88 | return ax.rv.dp; | 88 | return ax.rv.dp; |
89 | } | 89 | } |
90 | 90 | ||
91 | ieee754dp ieee754dp_bestnan(ieee754dp x, ieee754dp y) | 91 | union ieee754dp ieee754dp_bestnan(union ieee754dp x, union ieee754dp y) |
92 | { | 92 | { |
93 | assert(ieee754dp_isnan(x)); | 93 | assert(ieee754dp_isnan(x)); |
94 | assert(ieee754dp_isnan(y)); | 94 | assert(ieee754dp_isnan(y)); |
@@ -131,7 +131,7 @@ static u64 get_rounding(int sn, u64 xm) | |||
131 | * xe is an unbiased exponent | 131 | * xe is an unbiased exponent |
132 | * xm is 3bit extended precision value. | 132 | * xm is 3bit extended precision value. |
133 | */ | 133 | */ |
134 | ieee754dp ieee754dp_format(int sn, int xe, u64 xm) | 134 | union ieee754dp ieee754dp_format(int sn, int xe, u64 xm) |
135 | { | 135 | { |
136 | assert(xm); /* we don't gen exact zeros (probably should) */ | 136 | assert(xm); /* we don't gen exact zeros (probably should) */ |
137 | 137 | ||
diff --git a/arch/mips/math-emu/ieee754dp.h b/arch/mips/math-emu/ieee754dp.h index ce2af5b04b48..ad2568fa0b05 100644 --- a/arch/mips/math-emu/ieee754dp.h +++ b/arch/mips/math-emu/ieee754dp.h | |||
@@ -46,9 +46,9 @@ | |||
46 | #define DPDNORMX DPDNORMx(xm, xe) | 46 | #define DPDNORMX DPDNORMx(xm, xe) |
47 | #define DPDNORMY DPDNORMx(ym, ye) | 47 | #define DPDNORMY DPDNORMx(ym, ye) |
48 | 48 | ||
49 | static inline ieee754dp builddp(int s, int bx, u64 m) | 49 | static inline union ieee754dp builddp(int s, int bx, u64 m) |
50 | { | 50 | { |
51 | ieee754dp r; | 51 | union ieee754dp r; |
52 | 52 | ||
53 | assert((s) == 0 || (s) == 1); | 53 | assert((s) == 0 || (s) == 1); |
54 | assert((bx) >= DP_EMIN - 1 + DP_EBIAS | 54 | assert((bx) >= DP_EMIN - 1 + DP_EBIAS |
@@ -61,19 +61,19 @@ static inline ieee754dp builddp(int s, int bx, u64 m) | |||
61 | return r; | 61 | return r; |
62 | } | 62 | } |
63 | 63 | ||
64 | extern int ieee754dp_isnan(ieee754dp); | 64 | extern int ieee754dp_isnan(union ieee754dp); |
65 | extern int ieee754dp_issnan(ieee754dp); | 65 | extern int ieee754dp_issnan(union ieee754dp); |
66 | extern int __cold ieee754si_xcpt(int, const char *, ...); | 66 | extern int __cold ieee754si_xcpt(int, const char *, ...); |
67 | extern s64 __cold ieee754di_xcpt(s64, const char *, ...); | 67 | extern s64 __cold ieee754di_xcpt(s64, const char *, ...); |
68 | extern ieee754dp __cold ieee754dp_xcpt(ieee754dp, const char *, ...); | 68 | extern union ieee754dp __cold ieee754dp_xcpt(union ieee754dp, const char *, ...); |
69 | extern ieee754dp __cold ieee754dp_nanxcpt(ieee754dp, const char *, ...); | 69 | extern union ieee754dp __cold ieee754dp_nanxcpt(union ieee754dp, const char *, ...); |
70 | extern ieee754dp ieee754dp_bestnan(ieee754dp, ieee754dp); | 70 | extern union ieee754dp ieee754dp_bestnan(union ieee754dp, union ieee754dp); |
71 | extern ieee754dp ieee754dp_format(int, int, u64); | 71 | extern union ieee754dp ieee754dp_format(int, int, u64); |
72 | 72 | ||
73 | 73 | ||
74 | #define DPNORMRET2(s, e, m, name, a0, a1) \ | 74 | #define DPNORMRET2(s, e, m, name, a0, a1) \ |
75 | { \ | 75 | { \ |
76 | ieee754dp V = ieee754dp_format(s, e, m); \ | 76 | union ieee754dp V = ieee754dp_format(s, e, m); \ |
77 | if(TSTX()) \ | 77 | if(TSTX()) \ |
78 | return ieee754dp_xcpt(V, name, a0, a1); \ | 78 | return ieee754dp_xcpt(V, name, a0, a1); \ |
79 | else \ | 79 | else \ |
diff --git a/arch/mips/math-emu/ieee754m.c b/arch/mips/math-emu/ieee754m.c index 24190f3c9dd6..06224064333b 100644 --- a/arch/mips/math-emu/ieee754m.c +++ b/arch/mips/math-emu/ieee754m.c | |||
@@ -26,9 +26,9 @@ | |||
26 | 26 | ||
27 | #include "ieee754.h" | 27 | #include "ieee754.h" |
28 | 28 | ||
29 | ieee754dp ieee754dp_floor(ieee754dp x) | 29 | union ieee754dp ieee754dp_floor(union ieee754dp x) |
30 | { | 30 | { |
31 | ieee754dp i; | 31 | union ieee754dp i; |
32 | 32 | ||
33 | if (ieee754dp_lt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) | 33 | if (ieee754dp_lt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) |
34 | return ieee754dp_sub(i, ieee754dp_one(0)); | 34 | return ieee754dp_sub(i, ieee754dp_one(0)); |
@@ -36,9 +36,9 @@ ieee754dp ieee754dp_floor(ieee754dp x) | |||
36 | return i; | 36 | return i; |
37 | } | 37 | } |
38 | 38 | ||
39 | ieee754dp ieee754dp_ceil(ieee754dp x) | 39 | union ieee754dp ieee754dp_ceil(union ieee754dp x) |
40 | { | 40 | { |
41 | ieee754dp i; | 41 | union ieee754dp i; |
42 | 42 | ||
43 | if (ieee754dp_gt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) | 43 | if (ieee754dp_gt(ieee754dp_modf(x, &i), ieee754dp_zero(0))) |
44 | return ieee754dp_add(i, ieee754dp_one(0)); | 44 | return ieee754dp_add(i, ieee754dp_one(0)); |
@@ -46,9 +46,9 @@ ieee754dp ieee754dp_ceil(ieee754dp x) | |||
46 | return i; | 46 | return i; |
47 | } | 47 | } |
48 | 48 | ||
49 | ieee754dp ieee754dp_trunc(ieee754dp x) | 49 | union ieee754dp ieee754dp_trunc(union ieee754dp x) |
50 | { | 50 | { |
51 | ieee754dp i; | 51 | union ieee754dp i; |
52 | 52 | ||
53 | (void) ieee754dp_modf(x, &i); | 53 | (void) ieee754dp_modf(x, &i); |
54 | return i; | 54 | return i; |
diff --git a/arch/mips/math-emu/ieee754sp.c b/arch/mips/math-emu/ieee754sp.c index dd3ecd62e469..ac84d19e7c87 100644 --- a/arch/mips/math-emu/ieee754sp.c +++ b/arch/mips/math-emu/ieee754sp.c | |||
@@ -27,26 +27,26 @@ | |||
27 | 27 | ||
28 | #include "ieee754sp.h" | 28 | #include "ieee754sp.h" |
29 | 29 | ||
30 | int ieee754sp_class(ieee754sp x) | 30 | int ieee754sp_class(union ieee754sp x) |
31 | { | 31 | { |
32 | COMPXSP; | 32 | COMPXSP; |
33 | EXPLODEXSP; | 33 | EXPLODEXSP; |
34 | return xc; | 34 | return xc; |
35 | } | 35 | } |
36 | 36 | ||
37 | int ieee754sp_isnan(ieee754sp x) | 37 | int ieee754sp_isnan(union ieee754sp x) |
38 | { | 38 | { |
39 | return ieee754sp_class(x) >= IEEE754_CLASS_SNAN; | 39 | return ieee754sp_class(x) >= IEEE754_CLASS_SNAN; |
40 | } | 40 | } |
41 | 41 | ||
42 | int ieee754sp_issnan(ieee754sp x) | 42 | int ieee754sp_issnan(union ieee754sp x) |
43 | { | 43 | { |
44 | assert(ieee754sp_isnan(x)); | 44 | assert(ieee754sp_isnan(x)); |
45 | return (SPMANT(x) & SP_MBIT(SP_MBITS-1)); | 45 | return (SPMANT(x) & SP_MBIT(SP_MBITS-1)); |
46 | } | 46 | } |
47 | 47 | ||
48 | 48 | ||
49 | ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...) | 49 | union ieee754sp __cold ieee754sp_xcpt(union ieee754sp r, const char *op, ...) |
50 | { | 50 | { |
51 | struct ieee754xctx ax; | 51 | struct ieee754xctx ax; |
52 | 52 | ||
@@ -62,7 +62,7 @@ ieee754sp __cold ieee754sp_xcpt(ieee754sp r, const char *op, ...) | |||
62 | return ax.rv.sp; | 62 | return ax.rv.sp; |
63 | } | 63 | } |
64 | 64 | ||
65 | ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) | 65 | union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp r, const char *op, ...) |
66 | { | 66 | { |
67 | struct ieee754xctx ax; | 67 | struct ieee754xctx ax; |
68 | 68 | ||
@@ -89,7 +89,7 @@ ieee754sp __cold ieee754sp_nanxcpt(ieee754sp r, const char *op, ...) | |||
89 | return ax.rv.sp; | 89 | return ax.rv.sp; |
90 | } | 90 | } |
91 | 91 | ||
92 | ieee754sp ieee754sp_bestnan(ieee754sp x, ieee754sp y) | 92 | union ieee754sp ieee754sp_bestnan(union ieee754sp x, union ieee754sp y) |
93 | { | 93 | { |
94 | assert(ieee754sp_isnan(x)); | 94 | assert(ieee754sp_isnan(x)); |
95 | assert(ieee754sp_isnan(y)); | 95 | assert(ieee754sp_isnan(y)); |
@@ -132,7 +132,7 @@ static unsigned get_rounding(int sn, unsigned xm) | |||
132 | * xe is an unbiased exponent | 132 | * xe is an unbiased exponent |
133 | * xm is 3bit extended precision value. | 133 | * xm is 3bit extended precision value. |
134 | */ | 134 | */ |
135 | ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) | 135 | union ieee754sp ieee754sp_format(int sn, int xe, unsigned xm) |
136 | { | 136 | { |
137 | assert(xm); /* we don't gen exact zeros (probably should) */ | 137 | assert(xm); /* we don't gen exact zeros (probably should) */ |
138 | 138 | ||
diff --git a/arch/mips/math-emu/ieee754sp.h b/arch/mips/math-emu/ieee754sp.h index e3933bed0be4..5836fa1e69d8 100644 --- a/arch/mips/math-emu/ieee754sp.h +++ b/arch/mips/math-emu/ieee754sp.h | |||
@@ -51,9 +51,9 @@ | |||
51 | #define SPDNORMX SPDNORMx(xm, xe) | 51 | #define SPDNORMX SPDNORMx(xm, xe) |
52 | #define SPDNORMY SPDNORMx(ym, ye) | 52 | #define SPDNORMY SPDNORMx(ym, ye) |
53 | 53 | ||
54 | static inline ieee754sp buildsp(int s, int bx, unsigned m) | 54 | static inline union ieee754sp buildsp(int s, int bx, unsigned m) |
55 | { | 55 | { |
56 | ieee754sp r; | 56 | union ieee754sp r; |
57 | 57 | ||
58 | assert((s) == 0 || (s) == 1); | 58 | assert((s) == 0 || (s) == 1); |
59 | assert((bx) >= SP_EMIN - 1 + SP_EBIAS | 59 | assert((bx) >= SP_EMIN - 1 + SP_EBIAS |
@@ -67,19 +67,19 @@ static inline ieee754sp buildsp(int s, int bx, unsigned m) | |||
67 | return r; | 67 | return r; |
68 | } | 68 | } |
69 | 69 | ||
70 | extern int ieee754sp_isnan(ieee754sp); | 70 | extern int ieee754sp_isnan(union ieee754sp); |
71 | extern int ieee754sp_issnan(ieee754sp); | 71 | extern int ieee754sp_issnan(union ieee754sp); |
72 | extern int __cold ieee754si_xcpt(int, const char *, ...); | 72 | extern int __cold ieee754si_xcpt(int, const char *, ...); |
73 | extern s64 __cold ieee754di_xcpt(s64, const char *, ...); | 73 | extern s64 __cold ieee754di_xcpt(s64, const char *, ...); |
74 | extern ieee754sp __cold ieee754sp_xcpt(ieee754sp, const char *, ...); | 74 | extern union ieee754sp __cold ieee754sp_xcpt(union ieee754sp, const char *, ...); |
75 | extern ieee754sp __cold ieee754sp_nanxcpt(ieee754sp, const char *, ...); | 75 | extern union ieee754sp __cold ieee754sp_nanxcpt(union ieee754sp, const char *, ...); |
76 | extern ieee754sp ieee754sp_bestnan(ieee754sp, ieee754sp); | 76 | extern union ieee754sp ieee754sp_bestnan(union ieee754sp, union ieee754sp); |
77 | extern ieee754sp ieee754sp_format(int, int, unsigned); | 77 | extern union ieee754sp ieee754sp_format(int, int, unsigned); |
78 | 78 | ||
79 | 79 | ||
80 | #define SPNORMRET2(s, e, m, name, a0, a1) \ | 80 | #define SPNORMRET2(s, e, m, name, a0, a1) \ |
81 | { \ | 81 | { \ |
82 | ieee754sp V = ieee754sp_format(s, e, m); \ | 82 | union ieee754sp V = ieee754sp_format(s, e, m); \ |
83 | if(TSTX()) \ | 83 | if(TSTX()) \ |
84 | return ieee754sp_xcpt(V, name, a0, a1); \ | 84 | return ieee754sp_xcpt(V, name, a0, a1); \ |
85 | else \ | 85 | else \ |
diff --git a/arch/mips/math-emu/sp_add.c b/arch/mips/math-emu/sp_add.c index c446e64637e2..4938d8f1d4bc 100644 --- a/arch/mips/math-emu/sp_add.c +++ b/arch/mips/math-emu/sp_add.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_add(ieee754sp x, ieee754sp y) | 29 | union ieee754sp ieee754sp_add(union ieee754sp x, union ieee754sp y) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | COMPYSP; | 32 | COMPYSP; |
diff --git a/arch/mips/math-emu/sp_cmp.c b/arch/mips/math-emu/sp_cmp.c index 716cf37e2465..b98d68617cfe 100644 --- a/arch/mips/math-emu/sp_cmp.c +++ b/arch/mips/math-emu/sp_cmp.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | int ieee754sp_cmp(ieee754sp x, ieee754sp y, int cmp, int sig) | 29 | int ieee754sp_cmp(union ieee754sp x, union ieee754sp y, int cmp, int sig) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | COMPYSP; | 32 | COMPYSP; |
diff --git a/arch/mips/math-emu/sp_div.c b/arch/mips/math-emu/sp_div.c index d7747928c954..1f62865ffcbd 100644 --- a/arch/mips/math-emu/sp_div.c +++ b/arch/mips/math-emu/sp_div.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_div(ieee754sp x, ieee754sp y) | 29 | union ieee754sp ieee754sp_div(union ieee754sp x, union ieee754sp y) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | COMPYSP; | 32 | COMPYSP; |
diff --git a/arch/mips/math-emu/sp_fdp.c b/arch/mips/math-emu/sp_fdp.c index e1515aae0166..cbefb88a14ef 100644 --- a/arch/mips/math-emu/sp_fdp.c +++ b/arch/mips/math-emu/sp_fdp.c | |||
@@ -26,10 +26,10 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_fdp(ieee754dp x) | 29 | union ieee754sp ieee754sp_fdp(union ieee754dp x) |
30 | { | 30 | { |
31 | COMPXDP; | 31 | COMPXDP; |
32 | ieee754sp nan; | 32 | union ieee754sp nan; |
33 | 33 | ||
34 | EXPLODEXDP; | 34 | EXPLODEXDP; |
35 | 35 | ||
diff --git a/arch/mips/math-emu/sp_fint.c b/arch/mips/math-emu/sp_fint.c index 9694d6c016cb..7ba2b40348c4 100644 --- a/arch/mips/math-emu/sp_fint.c +++ b/arch/mips/math-emu/sp_fint.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_fint(int x) | 29 | union ieee754sp ieee754sp_fint(int x) |
30 | { | 30 | { |
31 | unsigned xm; | 31 | unsigned xm; |
32 | int xe; | 32 | int xe; |
@@ -70,7 +70,7 @@ ieee754sp ieee754sp_fint(int x) | |||
70 | } | 70 | } |
71 | 71 | ||
72 | 72 | ||
73 | ieee754sp ieee754sp_funs(unsigned int u) | 73 | union ieee754sp ieee754sp_funs(unsigned int u) |
74 | { | 74 | { |
75 | if ((int) u < 0) | 75 | if ((int) u < 0) |
76 | return ieee754sp_add(ieee754sp_1e31(), | 76 | return ieee754sp_add(ieee754sp_1e31(), |
diff --git a/arch/mips/math-emu/sp_flong.c b/arch/mips/math-emu/sp_flong.c index 16a651f29865..c457a9f8a148 100644 --- a/arch/mips/math-emu/sp_flong.c +++ b/arch/mips/math-emu/sp_flong.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_flong(s64 x) | 29 | union ieee754sp ieee754sp_flong(s64 x) |
30 | { | 30 | { |
31 | u64 xm; /* <--- need 64-bit mantissa temp */ | 31 | u64 xm; /* <--- need 64-bit mantissa temp */ |
32 | int xe; | 32 | int xe; |
@@ -69,7 +69,7 @@ ieee754sp ieee754sp_flong(s64 x) | |||
69 | } | 69 | } |
70 | 70 | ||
71 | 71 | ||
72 | ieee754sp ieee754sp_fulong(u64 u) | 72 | union ieee754sp ieee754sp_fulong(u64 u) |
73 | { | 73 | { |
74 | if ((s64) u < 0) | 74 | if ((s64) u < 0) |
75 | return ieee754sp_add(ieee754sp_1e63(), | 75 | return ieee754sp_add(ieee754sp_1e63(), |
diff --git a/arch/mips/math-emu/sp_frexp.c b/arch/mips/math-emu/sp_frexp.c index 5bc993c30044..668252bca513 100644 --- a/arch/mips/math-emu/sp_frexp.c +++ b/arch/mips/math-emu/sp_frexp.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | /* close to ieeep754sp_logb | 29 | /* close to ieeep754sp_logb |
30 | */ | 30 | */ |
31 | ieee754sp ieee754sp_frexp(ieee754sp x, int *eptr) | 31 | union ieee754sp ieee754sp_frexp(union ieee754sp x, int *eptr) |
32 | { | 32 | { |
33 | COMPXSP; | 33 | COMPXSP; |
34 | CLEARCX; | 34 | CLEARCX; |
diff --git a/arch/mips/math-emu/sp_logb.c b/arch/mips/math-emu/sp_logb.c index 9c14e0c75bd2..4dfe5386e89d 100644 --- a/arch/mips/math-emu/sp_logb.c +++ b/arch/mips/math-emu/sp_logb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_logb(ieee754sp x) | 29 | union ieee754sp ieee754sp_logb(union ieee754sp x) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | 32 | ||
diff --git a/arch/mips/math-emu/sp_modf.c b/arch/mips/math-emu/sp_modf.c index 25a0fbaa0556..30d53ec1f7eb 100644 --- a/arch/mips/math-emu/sp_modf.c +++ b/arch/mips/math-emu/sp_modf.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | /* modf function is always exact for a finite number | 29 | /* modf function is always exact for a finite number |
30 | */ | 30 | */ |
31 | ieee754sp ieee754sp_modf(ieee754sp x, ieee754sp *ip) | 31 | union ieee754sp ieee754sp_modf(union ieee754sp x, union ieee754sp *ip) |
32 | { | 32 | { |
33 | COMPXSP; | 33 | COMPXSP; |
34 | 34 | ||
diff --git a/arch/mips/math-emu/sp_mul.c b/arch/mips/math-emu/sp_mul.c index fa4675cf2aad..c628f3c495dc 100644 --- a/arch/mips/math-emu/sp_mul.c +++ b/arch/mips/math-emu/sp_mul.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_mul(ieee754sp x, ieee754sp y) | 29 | union ieee754sp ieee754sp_mul(union ieee754sp x, union ieee754sp y) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | COMPYSP; | 32 | COMPYSP; |
diff --git a/arch/mips/math-emu/sp_scalb.c b/arch/mips/math-emu/sp_scalb.c index dd76196984c8..9831d428af6f 100644 --- a/arch/mips/math-emu/sp_scalb.c +++ b/arch/mips/math-emu/sp_scalb.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_scalb(ieee754sp x, int n) | 29 | union ieee754sp ieee754sp_scalb(union ieee754sp x, int n) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | 32 | ||
@@ -51,7 +51,7 @@ ieee754sp ieee754sp_scalb(ieee754sp x, int n) | |||
51 | } | 51 | } |
52 | 52 | ||
53 | 53 | ||
54 | ieee754sp ieee754sp_ldexp(ieee754sp x, int n) | 54 | union ieee754sp ieee754sp_ldexp(union ieee754sp x, int n) |
55 | { | 55 | { |
56 | return ieee754sp_scalb(x, n); | 56 | return ieee754sp_scalb(x, n); |
57 | } | 57 | } |
diff --git a/arch/mips/math-emu/sp_simple.c b/arch/mips/math-emu/sp_simple.c index ae4fcfafd853..633c7a54cf1e 100644 --- a/arch/mips/math-emu/sp_simple.c +++ b/arch/mips/math-emu/sp_simple.c | |||
@@ -26,12 +26,12 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | int ieee754sp_finite(ieee754sp x) | 29 | int ieee754sp_finite(union ieee754sp x) |
30 | { | 30 | { |
31 | return SPBEXP(x) != SP_EMAX + 1 + SP_EBIAS; | 31 | return SPBEXP(x) != SP_EMAX + 1 + SP_EBIAS; |
32 | } | 32 | } |
33 | 33 | ||
34 | ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y) | 34 | union ieee754sp ieee754sp_copysign(union ieee754sp x, union ieee754sp y) |
35 | { | 35 | { |
36 | CLEARCX; | 36 | CLEARCX; |
37 | SPSIGN(x) = SPSIGN(y); | 37 | SPSIGN(x) = SPSIGN(y); |
@@ -39,7 +39,7 @@ ieee754sp ieee754sp_copysign(ieee754sp x, ieee754sp y) | |||
39 | } | 39 | } |
40 | 40 | ||
41 | 41 | ||
42 | ieee754sp ieee754sp_neg(ieee754sp x) | 42 | union ieee754sp ieee754sp_neg(union ieee754sp x) |
43 | { | 43 | { |
44 | COMPXSP; | 44 | COMPXSP; |
45 | 45 | ||
@@ -55,7 +55,7 @@ ieee754sp ieee754sp_neg(ieee754sp x) | |||
55 | SPSIGN(x) ^= 1; | 55 | SPSIGN(x) ^= 1; |
56 | 56 | ||
57 | if (xc == IEEE754_CLASS_SNAN) { | 57 | if (xc == IEEE754_CLASS_SNAN) { |
58 | ieee754sp y = ieee754sp_indef(); | 58 | union ieee754sp y = ieee754sp_indef(); |
59 | SETCX(IEEE754_INVALID_OPERATION); | 59 | SETCX(IEEE754_INVALID_OPERATION); |
60 | SPSIGN(y) = SPSIGN(x); | 60 | SPSIGN(y) = SPSIGN(x); |
61 | return ieee754sp_nanxcpt(y, "neg"); | 61 | return ieee754sp_nanxcpt(y, "neg"); |
@@ -65,7 +65,7 @@ ieee754sp ieee754sp_neg(ieee754sp x) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | ieee754sp ieee754sp_abs(ieee754sp x) | 68 | union ieee754sp ieee754sp_abs(union ieee754sp x) |
69 | { | 69 | { |
70 | COMPXSP; | 70 | COMPXSP; |
71 | 71 | ||
diff --git a/arch/mips/math-emu/sp_sqrt.c b/arch/mips/math-emu/sp_sqrt.c index fed20175f5fb..4c60d91961f4 100644 --- a/arch/mips/math-emu/sp_sqrt.c +++ b/arch/mips/math-emu/sp_sqrt.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_sqrt(ieee754sp x) | 29 | union ieee754sp ieee754sp_sqrt(union ieee754sp x) |
30 | { | 30 | { |
31 | int ix, s, q, m, t, i; | 31 | int ix, s, q, m, t, i; |
32 | unsigned int r; | 32 | unsigned int r; |
diff --git a/arch/mips/math-emu/sp_sub.c b/arch/mips/math-emu/sp_sub.c index e595c6f3d0bb..ed67acfb114f 100644 --- a/arch/mips/math-emu/sp_sub.c +++ b/arch/mips/math-emu/sp_sub.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | ieee754sp ieee754sp_sub(ieee754sp x, ieee754sp y) | 29 | union ieee754sp ieee754sp_sub(union ieee754sp x, union ieee754sp y) |
30 | { | 30 | { |
31 | COMPXSP; | 31 | COMPXSP; |
32 | COMPYSP; | 32 | COMPYSP; |
diff --git a/arch/mips/math-emu/sp_tint.c b/arch/mips/math-emu/sp_tint.c index 0fe9acc7716e..37cb096ee931 100644 --- a/arch/mips/math-emu/sp_tint.c +++ b/arch/mips/math-emu/sp_tint.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include "ieee754sp.h" | 28 | #include "ieee754sp.h" |
29 | 29 | ||
30 | int ieee754sp_tint(ieee754sp x) | 30 | int ieee754sp_tint(union ieee754sp x) |
31 | { | 31 | { |
32 | COMPXSP; | 32 | COMPXSP; |
33 | 33 | ||
@@ -113,9 +113,9 @@ int ieee754sp_tint(ieee754sp x) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
116 | unsigned int ieee754sp_tuns(ieee754sp x) | 116 | unsigned int ieee754sp_tuns(union ieee754sp x) |
117 | { | 117 | { |
118 | ieee754sp hb = ieee754sp_1e31(); | 118 | union ieee754sp hb = ieee754sp_1e31(); |
119 | 119 | ||
120 | /* what if x < 0 ?? */ | 120 | /* what if x < 0 ?? */ |
121 | if (ieee754sp_lt(x, hb)) | 121 | if (ieee754sp_lt(x, hb)) |
diff --git a/arch/mips/math-emu/sp_tlong.c b/arch/mips/math-emu/sp_tlong.c index d0ca6e22be29..da412d38d5ef 100644 --- a/arch/mips/math-emu/sp_tlong.c +++ b/arch/mips/math-emu/sp_tlong.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "ieee754sp.h" | 27 | #include "ieee754sp.h" |
28 | 28 | ||
29 | s64 ieee754sp_tlong(ieee754sp x) | 29 | s64 ieee754sp_tlong(union ieee754sp x) |
30 | { | 30 | { |
31 | COMPXDP; /* <-- need 64-bit mantissa tmp */ | 31 | COMPXDP; /* <-- need 64-bit mantissa tmp */ |
32 | 32 | ||
@@ -108,9 +108,9 @@ s64 ieee754sp_tlong(ieee754sp x) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
111 | u64 ieee754sp_tulong(ieee754sp x) | 111 | u64 ieee754sp_tulong(union ieee754sp x) |
112 | { | 112 | { |
113 | ieee754sp hb = ieee754sp_1e63(); | 113 | union ieee754sp hb = ieee754sp_1e63(); |
114 | 114 | ||
115 | /* what if x < 0 ?? */ | 115 | /* what if x < 0 ?? */ |
116 | if (ieee754sp_lt(x, hb)) | 116 | if (ieee754sp_lt(x, hb)) |