Lines Matching refs:rhs
1217 add_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int max_wl)
1224 if (lhs.is_nan() || rhs.is_nan() ||
1225 (lhs.is_inf() && rhs.is_inf() && lhs.m_sign != rhs.m_sign)) {
1235 if (rhs.is_inf()) {
1236 result.set_inf(rhs.m_sign);
1249 align(lhs, rhs, new_wp, len_mant, lhs_mant, rhs_mant);
1260 if (lhs.m_sign == rhs.m_sign) {
1264 int cmp = compare_abs(lhs, rhs);
1271 result.m_sign = rhs.m_sign;
1326 sub_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int max_wl)
1333 if (lhs.is_nan() || rhs.is_nan() ||
1334 (lhs.is_inf() && rhs.is_inf() && lhs.m_sign == rhs.m_sign)) {
1344 if (rhs.is_inf()) {
1345 result.set_inf(-1 * rhs.m_sign);
1358 align(lhs, rhs, new_wp, len_mant, lhs_mant, rhs_mant);
1369 if (lhs.m_sign != rhs.m_sign) {
1373 int cmp = compare_abs(lhs, rhs);
1380 result.m_sign = -rhs.m_sign;
1420 multiply(scfx_rep &result, const scfx_rep &lhs, const scfx_rep &rhs,
1426 if (lhs.is_nan() || rhs.is_nan() ||
1427 (lhs.is_inf() && rhs.is_zero()) ||
1428 (lhs.is_zero() && rhs.is_inf())) {
1433 if (lhs.is_inf() || rhs.is_inf()) {
1434 result.set_inf(lhs.m_sign * rhs.m_sign);
1438 if (lhs.is_zero() || rhs.is_zero()) {
1439 result.set_zero(lhs.m_sign * rhs.m_sign);
1447 int len_rhs = rhs.m_msw - rhs.m_lsw + 1;
1450 int new_wp = (lhs.m_wp - lhs.m_lsw) + (rhs.m_wp - rhs.m_lsw);
1451 int new_sign = lhs.m_sign * rhs.m_sign;
1460 half_word *s2 = rhs.m_mant.half_addr(rhs.m_lsw);
1495 div_scfx_rep(const scfx_rep &lhs, const scfx_rep &rhs, int div_wl)
1502 if (lhs.is_nan() || rhs.is_nan() || (lhs.is_inf() && rhs.is_inf()) ||
1503 (lhs.is_zero() && rhs.is_zero())) {
1508 if (lhs.is_inf() || rhs.is_zero()) {
1509 result.set_inf(lhs.m_sign * rhs.m_sign);
1513 if (lhs.is_zero() || rhs.is_inf()) {
1514 result.set_zero(lhs.m_sign * rhs.m_sign);
1527 result.m_sign = lhs.m_sign * rhs.m_sign;
1531 int msb_rhs = scfx_find_msb(rhs.m_mant[rhs.m_msw]) +
1532 (rhs.m_msw - rhs.m_wp) * bits_in_word;
1545 // align msb from remainder to msb from rhs
1552 // make sure msw(remainder) >= msw(rhs)!
1553 int msw_diff = rhs.m_msw - remainder.m_msw;
1560 if (compare_msw_ff(rhs, remainder) <= 0) {
1563 rhs.m_mant, rhs.m_msw, rhs.m_lsw);
2051 align(const scfx_rep &lhs, const scfx_rep &rhs, int &new_wp,
2057 if (lhs.m_wp != rhs.m_wp || lhs.size() != rhs.size()) {
2060 int lower_bound_rhs = rhs.m_lsw - rhs.m_wp;
2061 int upper_bound_rhs = rhs.m_msw - rhs.m_wp;
2074 if (new_wp != rhs.m_wp || len_mant != rhs.size()) {
2075 rhs_mant = rhs.resize(len_mant, new_wp);
2085 rhs_mant = rhs.m_mant;
2095 compare_msw_ff(const scfx_rep &lhs, const scfx_rep &rhs)
2097 // special case: rhs.m_mant[rhs.m_msw + 1] == 1
2098 if (rhs.m_msw < rhs.size() - 1 && rhs.m_mant[rhs.m_msw + 1 ] != 0) {
2103 int rhs_size = rhs.m_msw - rhs.m_lsw + 1;
2108 int rhs_index = rhs.m_msw;
2113 i < size && lhs.m_mant[lhs_index] == rhs.m_mant[rhs_index];
2131 if (lhs.m_mant[lhs_index] < rhs.m_mant[rhs_index]) {