Commit 2b4bd1bc by Jim Wilson

*** empty log message ***

From-SVN: r1023
parent 4d449554
...@@ -4686,9 +4686,10 @@ apply_distributive_law (x) ...@@ -4686,9 +4686,10 @@ apply_distributive_law (x)
case SUBREG: case SUBREG:
/* Non-paradoxical SUBREGs distributes over all operations, provided /* Non-paradoxical SUBREGs distributes over all operations, provided
the inner modes and word numbers are the same, this is an extraction the inner modes and word numbers are the same, this is an extraction
of a low-order part, and we would not be converting a single-word of a low-order part, we don't convert an fp operation to int or
vice versa, and we would not be converting a single-word
operation into a multi-word operation. The latter test is not operation into a multi-word operation. The latter test is not
required, but we prevents generating unneeded multi-word operations. required, but it prevents generating unneeded multi-word operations.
Some of the previous tests are redundant given the latter test, but Some of the previous tests are redundant given the latter test, but
are retained because they are required for correctness. are retained because they are required for correctness.
...@@ -4697,6 +4698,8 @@ apply_distributive_law (x) ...@@ -4697,6 +4698,8 @@ apply_distributive_law (x)
if (GET_MODE (SUBREG_REG (lhs)) != GET_MODE (SUBREG_REG (rhs)) if (GET_MODE (SUBREG_REG (lhs)) != GET_MODE (SUBREG_REG (rhs))
|| SUBREG_WORD (lhs) != SUBREG_WORD (rhs) || SUBREG_WORD (lhs) != SUBREG_WORD (rhs)
|| ! subreg_lowpart_p (lhs) || ! subreg_lowpart_p (lhs)
|| (GET_MODE_CLASS (GET_MODE (lhs))
!= GET_MODE_CLASS (GET_MODE (SUBREG_REG (lhs))))
|| (GET_MODE_SIZE (GET_MODE (lhs)) || (GET_MODE_SIZE (GET_MODE (lhs))
< GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs)))) < GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))))
|| GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD) || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD)
......
...@@ -1221,6 +1221,11 @@ ...@@ -1221,6 +1221,11 @@
"ldos %1,%0" "ldos %1,%0"
[(set_attr "type" "load")]) [(set_attr "type" "load")])
;; Using shifts here generates much better code than doing an `and 255'.
;; This is mainly because the `and' requires loading the constant separately,
;; the constant is likely to get optimized, and then the compiler can't
;; optimize the `and' because it doesn't know that one operand is a constant.
(define_expand "zero_extendqisi2" (define_expand "zero_extendqisi2"
[(set (match_operand:SI 0 "register_operand" "") [(set (match_operand:SI 0 "register_operand" "")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
......
...@@ -1461,10 +1461,15 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration, ...@@ -1461,10 +1461,15 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration,
for (tv = bl->giv; tv; tv = tv->next_iv) for (tv = bl->giv; tv; tv = tv->next_iv)
if (tv->giv_type == DEST_ADDR && tv->same == v) if (tv->giv_type == DEST_ADDR && tv->same == v)
{ {
/* Increment the giv by the amount that was calculated in int this_giv_inc = INTVAL (giv_inc);
find_splittable_givs, and saved in add_val. */
tv->dest_reg = plus_constant (tv->dest_reg, /* Scale this_giv_inc if the multiplicative factors of
INTVAL (tv->add_val)); the two givs are different. */
if (tv->mult_val != v->mult_val)
this_giv_inc = (this_giv_inc / INTVAL (v->mult_val)
* INTVAL (tv->mult_val));
tv->dest_reg = plus_constant (tv->dest_reg, this_giv_inc);
*tv->location = tv->dest_reg; *tv->location = tv->dest_reg;
if (last_iteration && unroll_type != UNROLL_COMPLETELY) if (last_iteration && unroll_type != UNROLL_COMPLETELY)
...@@ -2598,13 +2603,6 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment, ...@@ -2598,13 +2603,6 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
} }
} }
/* Overwrite the old add_val, which is no longer needed, and
substitute the amount that the giv is incremented on each
iteration. We need to save this somewhere, so we know how
much to increment split DEST_ADDR giv's in copy_loop_body. */
v->add_val = giv_inc;
if (loop_dump_stream) if (loop_dump_stream)
fprintf (loop_dump_stream, "DEST_ADDR giv being split.\n"); fprintf (loop_dump_stream, "DEST_ADDR giv being split.\n");
} }
......
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