Revision 9c7e37e7 target-ppc/op_helper.c

b/target-ppc/op_helper.c
1512 1512
/* PowerPC 601 specific instructions (POWER bridge) */
1513 1513
void do_POWER_abso (void)
1514 1514
{
1515
    if ((uint32_t)T0 == INT32_MIN) {
1515
    if ((int32_t)T0 == INT32_MIN) {
1516 1516
        T0 = INT32_MAX;
1517 1517
        xer_ov = 1;
1518
        xer_so = 1;
1519
    } else {
1518
    } else if ((int32_t)T0 < 0) {
1520 1519
        T0 = -T0;
1521 1520
        xer_ov = 0;
1521
    } else {
1522
        xer_ov = 0;
1522 1523
    }
1524
    xer_so |= xer_ov;
1523 1525
}
1524 1526

  
1525 1527
void do_POWER_clcs (void)
......
1896 1898
/* Fixed-point vector arithmetic */
1897 1899
static always_inline uint32_t _do_eabs (uint32_t val)
1898 1900
{
1899
    if (val != 0x80000000)
1900
        val &= ~0x80000000;
1901
    if ((val & 0x80000000) && val != 0x80000000)
1902
        val -= val;
1901 1903

  
1902 1904
    return val;
1903 1905
}
......
1923 1925
static always_inline uint32_t _do_eneg (uint32_t val)
1924 1926
{
1925 1927
    if (val != 0x80000000)
1926
        val ^= 0x80000000;
1928
        val -= val;
1927 1929

  
1928 1930
    return val;
1929 1931
}

Also available in: Unified diff