Revision b068d6a7 target-ppc/op_helper.c

b/target-ppc/op_helper.c
601 601
}
602 602
#endif
603 603

  
604
static inline int popcnt (uint32_t val)
604
static always_inline int popcnt (uint32_t val)
605 605
{
606 606
    int i;
607 607

  
......
707 707

  
708 708
#endif
709 709

  
710
static inline void do_fri (int rounding_mode)
710
static always_inline void do_fri (int rounding_mode)
711 711
{
712 712
    int curmode;
713 713

  
......
1430 1430
    0x1, 0x9, 0x5, 0xD, 0x3, 0xB, 0x7, 0xF,
1431 1431
};
1432 1432

  
1433
static inline uint8_t byte_reverse (uint8_t val)
1433
static always_inline uint8_t byte_reverse (uint8_t val)
1434 1434
{
1435 1435
    return hbrev[val >> 4] | (hbrev[val & 0xF] << 4);
1436 1436
}
1437 1437

  
1438
static inline uint32_t word_reverse (uint32_t val)
1438
static always_inline uint32_t word_reverse (uint32_t val)
1439 1439
{
1440 1440
    return byte_reverse(val >> 24) | (byte_reverse(val >> 16) << 8) |
1441 1441
        (byte_reverse(val >> 8) << 16) | (byte_reverse(val) << 24);
......
1468 1468
}
1469 1469

  
1470 1470
/* Fixed-point vector arithmetic */
1471
static inline uint32_t _do_eabs (uint32_t val)
1471
static always_inline uint32_t _do_eabs (uint32_t val)
1472 1472
{
1473 1473
    if (val != 0x80000000)
1474 1474
        val &= ~0x80000000;
......
1476 1476
    return val;
1477 1477
}
1478 1478

  
1479
static inline uint32_t _do_eaddw (uint32_t op1, uint32_t op2)
1479
static always_inline uint32_t _do_eaddw (uint32_t op1, uint32_t op2)
1480 1480
{
1481 1481
    return op1 + op2;
1482 1482
}
1483 1483

  
1484
static inline int _do_ecntlsw (uint32_t val)
1484
static always_inline int _do_ecntlsw (uint32_t val)
1485 1485
{
1486 1486
    if (val & 0x80000000)
1487 1487
        return _do_cntlzw(~val);
......
1489 1489
        return _do_cntlzw(val);
1490 1490
}
1491 1491

  
1492
static inline int _do_ecntlzw (uint32_t val)
1492
static always_inline int _do_ecntlzw (uint32_t val)
1493 1493
{
1494 1494
    return _do_cntlzw(val);
1495 1495
}
1496 1496

  
1497
static inline uint32_t _do_eneg (uint32_t val)
1497
static always_inline uint32_t _do_eneg (uint32_t val)
1498 1498
{
1499 1499
    if (val != 0x80000000)
1500 1500
        val ^= 0x80000000;
......
1502 1502
    return val;
1503 1503
}
1504 1504

  
1505
static inline uint32_t _do_erlw (uint32_t op1, uint32_t op2)
1505
static always_inline uint32_t _do_erlw (uint32_t op1, uint32_t op2)
1506 1506
{
1507 1507
    return rotl32(op1, op2);
1508 1508
}
1509 1509

  
1510
static inline uint32_t _do_erndw (uint32_t val)
1510
static always_inline uint32_t _do_erndw (uint32_t val)
1511 1511
{
1512 1512
    return (val + 0x000080000000) & 0xFFFF0000;
1513 1513
}
1514 1514

  
1515
static inline uint32_t _do_eslw (uint32_t op1, uint32_t op2)
1515
static always_inline uint32_t _do_eslw (uint32_t op1, uint32_t op2)
1516 1516
{
1517 1517
    /* No error here: 6 bits are used */
1518 1518
    return op1 << (op2 & 0x3F);
1519 1519
}
1520 1520

  
1521
static inline int32_t _do_esrws (int32_t op1, uint32_t op2)
1521
static always_inline int32_t _do_esrws (int32_t op1, uint32_t op2)
1522 1522
{
1523 1523
    /* No error here: 6 bits are used */
1524 1524
    return op1 >> (op2 & 0x3F);
1525 1525
}
1526 1526

  
1527
static inline uint32_t _do_esrwu (uint32_t op1, uint32_t op2)
1527
static always_inline uint32_t _do_esrwu (uint32_t op1, uint32_t op2)
1528 1528
{
1529 1529
    /* No error here: 6 bits are used */
1530 1530
    return op1 >> (op2 & 0x3F);
1531 1531
}
1532 1532

  
1533
static inline uint32_t _do_esubfw (uint32_t op1, uint32_t op2)
1533
static always_inline uint32_t _do_esubfw (uint32_t op1, uint32_t op2)
1534 1534
{
1535 1535
    return op2 - op1;
1536 1536
}
......
1559 1559
DO_SPE_OP2(subfw);
1560 1560

  
1561 1561
/* evsel is a little bit more complicated... */
1562
static inline uint32_t _do_esel (uint32_t op1, uint32_t op2, int n)
1562
static always_inline uint32_t _do_esel (uint32_t op1, uint32_t op2, int n)
1563 1563
{
1564 1564
    if (n)
1565 1565
        return op1;
......
1582 1582
                         _do_e##name(T0_64, T1_64));                          \
1583 1583
}
1584 1584

  
1585
static inline uint32_t _do_evcmp_merge (int t0, int t1)
1585
static always_inline uint32_t _do_evcmp_merge (int t0, int t1)
1586 1586
{
1587 1587
    return (t0 << 3) | (t1 << 2) | ((t0 | t1) << 1) | (t0 & t1);
1588 1588
}
1589
static inline int _do_ecmpeq (uint32_t op1, uint32_t op2)
1589
static always_inline int _do_ecmpeq (uint32_t op1, uint32_t op2)
1590 1590
{
1591 1591
    return op1 == op2 ? 1 : 0;
1592 1592
}
1593 1593

  
1594
static inline int _do_ecmpgts (int32_t op1, int32_t op2)
1594
static always_inline int _do_ecmpgts (int32_t op1, int32_t op2)
1595 1595
{
1596 1596
    return op1 > op2 ? 1 : 0;
1597 1597
}
1598 1598

  
1599
static inline int _do_ecmpgtu (uint32_t op1, uint32_t op2)
1599
static always_inline int _do_ecmpgtu (uint32_t op1, uint32_t op2)
1600 1600
{
1601 1601
    return op1 > op2 ? 1 : 0;
1602 1602
}
1603 1603

  
1604
static inline int _do_ecmplts (int32_t op1, int32_t op2)
1604
static always_inline int _do_ecmplts (int32_t op1, int32_t op2)
1605 1605
{
1606 1606
    return op1 < op2 ? 1 : 0;
1607 1607
}
1608 1608

  
1609
static inline int _do_ecmpltu (uint32_t op1, uint32_t op2)
1609
static always_inline int _do_ecmpltu (uint32_t op1, uint32_t op2)
1610 1610
{
1611 1611
    return op1 < op2 ? 1 : 0;
1612 1612
}
......
1623 1623
DO_SPE_CMP(cmpltu);
1624 1624

  
1625 1625
/* Single precision floating-point conversions from/to integer */
1626
static inline uint32_t _do_efscfsi (int32_t val)
1626
static always_inline uint32_t _do_efscfsi (int32_t val)
1627 1627
{
1628 1628
    union {
1629 1629
        uint32_t u;
......
1635 1635
    return u.u;
1636 1636
}
1637 1637

  
1638
static inline uint32_t _do_efscfui (uint32_t val)
1638
static always_inline uint32_t _do_efscfui (uint32_t val)
1639 1639
{
1640 1640
    union {
1641 1641
        uint32_t u;
......
1647 1647
    return u.u;
1648 1648
}
1649 1649

  
1650
static inline int32_t _do_efsctsi (uint32_t val)
1650
static always_inline int32_t _do_efsctsi (uint32_t val)
1651 1651
{
1652 1652
    union {
1653 1653
        int32_t u;
......
1662 1662
    return float32_to_int32(u.f, &env->spe_status);
1663 1663
}
1664 1664

  
1665
static inline uint32_t _do_efsctui (uint32_t val)
1665
static always_inline uint32_t _do_efsctui (uint32_t val)
1666 1666
{
1667 1667
    union {
1668 1668
        int32_t u;
......
1677 1677
    return float32_to_uint32(u.f, &env->spe_status);
1678 1678
}
1679 1679

  
1680
static inline int32_t _do_efsctsiz (uint32_t val)
1680
static always_inline int32_t _do_efsctsiz (uint32_t val)
1681 1681
{
1682 1682
    union {
1683 1683
        int32_t u;
......
1692 1692
    return float32_to_int32_round_to_zero(u.f, &env->spe_status);
1693 1693
}
1694 1694

  
1695
static inline uint32_t _do_efsctuiz (uint32_t val)
1695
static always_inline uint32_t _do_efsctuiz (uint32_t val)
1696 1696
{
1697 1697
    union {
1698 1698
        int32_t u;
......
1738 1738
}
1739 1739

  
1740 1740
/* Single precision floating-point conversion to/from fractional */
1741
static inline uint32_t _do_efscfsf (uint32_t val)
1741
static always_inline uint32_t _do_efscfsf (uint32_t val)
1742 1742
{
1743 1743
    union {
1744 1744
        uint32_t u;
......
1753 1753
    return u.u;
1754 1754
}
1755 1755

  
1756
static inline uint32_t _do_efscfuf (uint32_t val)
1756
static always_inline uint32_t _do_efscfuf (uint32_t val)
1757 1757
{
1758 1758
    union {
1759 1759
        uint32_t u;
......
1768 1768
    return u.u;
1769 1769
}
1770 1770

  
1771
static inline int32_t _do_efsctsf (uint32_t val)
1771
static always_inline int32_t _do_efsctsf (uint32_t val)
1772 1772
{
1773 1773
    union {
1774 1774
        int32_t u;
......
1786 1786
    return float32_to_int32(u.f, &env->spe_status);
1787 1787
}
1788 1788

  
1789
static inline uint32_t _do_efsctuf (uint32_t val)
1789
static always_inline uint32_t _do_efsctuf (uint32_t val)
1790 1790
{
1791 1791
    union {
1792 1792
        int32_t u;
......
1804 1804
    return float32_to_uint32(u.f, &env->spe_status);
1805 1805
}
1806 1806

  
1807
static inline int32_t _do_efsctsfz (uint32_t val)
1807
static always_inline int32_t _do_efsctsfz (uint32_t val)
1808 1808
{
1809 1809
    union {
1810 1810
        int32_t u;
......
1822 1822
    return float32_to_int32_round_to_zero(u.f, &env->spe_status);
1823 1823
}
1824 1824

  
1825
static inline uint32_t _do_efsctufz (uint32_t val)
1825
static always_inline uint32_t _do_efsctufz (uint32_t val)
1826 1826
{
1827 1827
    union {
1828 1828
        int32_t u;
......
1871 1871
}
1872 1872

  
1873 1873
/* Double precision floating point helpers */
1874
static inline int _do_efdcmplt (uint64_t op1, uint64_t op2)
1874
static always_inline int _do_efdcmplt (uint64_t op1, uint64_t op2)
1875 1875
{
1876 1876
    /* XXX: TODO: test special values (NaN, infinites, ...) */
1877 1877
    return _do_efdtstlt(op1, op2);
1878 1878
}
1879 1879

  
1880
static inline int _do_efdcmpgt (uint64_t op1, uint64_t op2)
1880
static always_inline int _do_efdcmpgt (uint64_t op1, uint64_t op2)
1881 1881
{
1882 1882
    /* XXX: TODO: test special values (NaN, infinites, ...) */
1883 1883
    return _do_efdtstgt(op1, op2);
1884 1884
}
1885 1885

  
1886
static inline int _do_efdcmpeq (uint64_t op1, uint64_t op2)
1886
static always_inline int _do_efdcmpeq (uint64_t op1, uint64_t op2)
1887 1887
{
1888 1888
    /* XXX: TODO: test special values (NaN, infinites, ...) */
1889 1889
    return _do_efdtsteq(op1, op2);
......
1905 1905
}
1906 1906

  
1907 1907
/* Double precision floating-point conversion to/from integer */
1908
static inline uint64_t _do_efdcfsi (int64_t val)
1908
static always_inline uint64_t _do_efdcfsi (int64_t val)
1909 1909
{
1910 1910
    union {
1911 1911
        uint64_t u;
......
1917 1917
    return u.u;
1918 1918
}
1919 1919

  
1920
static inline uint64_t _do_efdcfui (uint64_t val)
1920
static always_inline uint64_t _do_efdcfui (uint64_t val)
1921 1921
{
1922 1922
    union {
1923 1923
        uint64_t u;
......
1929 1929
    return u.u;
1930 1930
}
1931 1931

  
1932
static inline int64_t _do_efdctsi (uint64_t val)
1932
static always_inline int64_t _do_efdctsi (uint64_t val)
1933 1933
{
1934 1934
    union {
1935 1935
        int64_t u;
......
1944 1944
    return float64_to_int64(u.f, &env->spe_status);
1945 1945
}
1946 1946

  
1947
static inline uint64_t _do_efdctui (uint64_t val)
1947
static always_inline uint64_t _do_efdctui (uint64_t val)
1948 1948
{
1949 1949
    union {
1950 1950
        int64_t u;
......
1959 1959
    return float64_to_uint64(u.f, &env->spe_status);
1960 1960
}
1961 1961

  
1962
static inline int64_t _do_efdctsiz (uint64_t val)
1962
static always_inline int64_t _do_efdctsiz (uint64_t val)
1963 1963
{
1964 1964
    union {
1965 1965
        int64_t u;
......
1974 1974
    return float64_to_int64_round_to_zero(u.f, &env->spe_status);
1975 1975
}
1976 1976

  
1977
static inline uint64_t _do_efdctuiz (uint64_t val)
1977
static always_inline uint64_t _do_efdctuiz (uint64_t val)
1978 1978
{
1979 1979
    union {
1980 1980
        int64_t u;
......
2020 2020
}
2021 2021

  
2022 2022
/* Double precision floating-point conversion to/from fractional */
2023
static inline uint64_t _do_efdcfsf (int64_t val)
2023
static always_inline uint64_t _do_efdcfsf (int64_t val)
2024 2024
{
2025 2025
    union {
2026 2026
        uint64_t u;
......
2035 2035
    return u.u;
2036 2036
}
2037 2037

  
2038
static inline uint64_t _do_efdcfuf (uint64_t val)
2038
static always_inline uint64_t _do_efdcfuf (uint64_t val)
2039 2039
{
2040 2040
    union {
2041 2041
        uint64_t u;
......
2050 2050
    return u.u;
2051 2051
}
2052 2052

  
2053
static inline int64_t _do_efdctsf (uint64_t val)
2053
static always_inline int64_t _do_efdctsf (uint64_t val)
2054 2054
{
2055 2055
    union {
2056 2056
        int64_t u;
......
2068 2068
    return float64_to_int32(u.f, &env->spe_status);
2069 2069
}
2070 2070

  
2071
static inline uint64_t _do_efdctuf (uint64_t val)
2071
static always_inline uint64_t _do_efdctuf (uint64_t val)
2072 2072
{
2073 2073
    union {
2074 2074
        int64_t u;
......
2086 2086
    return float64_to_uint32(u.f, &env->spe_status);
2087 2087
}
2088 2088

  
2089
static inline int64_t _do_efdctsfz (uint64_t val)
2089
static always_inline int64_t _do_efdctsfz (uint64_t val)
2090 2090
{
2091 2091
    union {
2092 2092
        int64_t u;
......
2104 2104
    return float64_to_int32_round_to_zero(u.f, &env->spe_status);
2105 2105
}
2106 2106

  
2107
static inline uint64_t _do_efdctufz (uint64_t val)
2107
static always_inline uint64_t _do_efdctufz (uint64_t val)
2108 2108
{
2109 2109
    union {
2110 2110
        int64_t u;
......
2153 2153
}
2154 2154

  
2155 2155
/* Floating point conversion between single and double precision */
2156
static inline uint32_t _do_efscfd (uint64_t val)
2156
static always_inline uint32_t _do_efscfd (uint64_t val)
2157 2157
{
2158 2158
    union {
2159 2159
        uint64_t u;
......
2170 2170
    return u2.u;
2171 2171
}
2172 2172

  
2173
static inline uint64_t _do_efdcfs (uint32_t val)
2173
static always_inline uint64_t _do_efdcfs (uint32_t val)
2174 2174
{
2175 2175
    union {
2176 2176
        uint64_t u;
......
2214 2214
DO_SPE_OP2(fsdiv);
2215 2215

  
2216 2216
/* Single-precision floating-point comparisons */
2217
static inline int _do_efscmplt (uint32_t op1, uint32_t op2)
2217
static always_inline int _do_efscmplt (uint32_t op1, uint32_t op2)
2218 2218
{
2219 2219
    /* XXX: TODO: test special values (NaN, infinites, ...) */
2220 2220
    return _do_efststlt(op1, op2);
2221 2221
}
2222 2222

  
2223
static inline int _do_efscmpgt (uint32_t op1, uint32_t op2)
2223
static always_inline int _do_efscmpgt (uint32_t op1, uint32_t op2)
2224 2224
{
2225 2225
    /* XXX: TODO: test special values (NaN, infinites, ...) */
2226 2226
    return _do_efststgt(op1, op2);
2227 2227
}
2228 2228

  
2229
static inline int _do_efscmpeq (uint32_t op1, uint32_t op2)
2229
static always_inline int _do_efscmpeq (uint32_t op1, uint32_t op2)
2230 2230
{
2231 2231
    /* XXX: TODO: test special values (NaN, infinites, ...) */
2232 2232
    return _do_efststeq(op1, op2);

Also available in: Unified diff