Commit cf4139d8 authored by yb9976's avatar yb9976
Browse files

Improved dca transfer function for Shr and Shrs.

parent ff8ad9ba
......@@ -56,6 +56,12 @@ static void care_for(ir_node *irn, ir_tarval *care, pdeq *q)
}
}
/* Creates a bit mask that have the lsb and all more significant bits set. */
static ir_tarval *create_lsb_mask(ir_tarval *tv)
{
return tarval_or(tv, tarval_neg(tv));
}
/* Creates a bit mask that have the msb and all less significant bits set. */
static ir_tarval *create_msb_mask(ir_tarval *tv)
{
......@@ -214,8 +220,9 @@ static void dca_transfer(ir_node *irn, pdeq *q)
care_for(left, get_tarval_min(mode), q);
}
else
care_for(left, 0, q);
care_for(left, create_lsb_mask(care), q);
// TODO Consider modulo shift
care_for(right, 0, q);
return;
......@@ -229,6 +236,7 @@ static void dca_transfer(ir_node *irn, pdeq *q)
else
care_for(left, create_msb_mask(care), q);
// TODO Consider modulo shift
care_for(right, 0, q);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment