summaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1998-08-14 09:20:23 +0000
committerobrien <obrien@FreeBSD.org>1998-08-14 09:20:23 +0000
commit1db15076e8d083fcafcda3552255be00f64a4489 (patch)
tree13ece2d3b7d9857f8a8c276027e2c190f9fd908f /lang
parentb64f463d6b6ce22094e04b423bd92ed033210852 (diff)
downloadFreeBSD-ports-1db15076e8d083fcafcda3552255be00f64a4489.zip
FreeBSD-ports-1db15076e8d083fcafcda3552255be00f64a4489.tar.gz
* expmed.c (expand_mult): Use 0 as add_target if should preserve
subexpressions. * expmed.c (expand_divmod): Save last divison constant and if rem is same as div, don't adjust rem cost. Submitted by: Peter Jeremy <peter.jeremy@auss2.alcatel.com.au>
Diffstat (limited to 'lang')
-rw-r--r--lang/gcc28/files/patch-1137
1 files changed, 37 insertions, 0 deletions
diff --git a/lang/gcc28/files/patch-11 b/lang/gcc28/files/patch-11
new file mode 100644
index 0000000..dd0bbe0f
--- /dev/null
+++ b/lang/gcc28/files/patch-11
@@ -0,0 +1,37 @@
+--- expmed.c.dist Sat Nov 8 14:11:58 1997
++++ expmed.c Thu Aug 13 11:18:13 1998
+@@ -2249,7 +2249,8 @@
+ rtx shift_subtarget = preserve ? 0 : accum;
+ rtx add_target
+ = (opno == alg.ops - 1 && target != 0 && variant != add_variant
+- ? target : 0);
++ && ! preserve)
++ ? target : 0;
+ rtx accum_target = preserve ? 0 : accum;
+
+ switch (alg.op[opno])
+@@ -2716,6 +2717,7 @@
+ optab optab1, optab2;
+ int op1_is_constant, op1_is_pow2;
+ int max_cost, extra_cost;
++ static HOST_WIDE_INT last_div_const = 0;
+
+ op1_is_constant = GET_CODE (op1) == CONST_INT;
+ op1_is_pow2 = (op1_is_constant
+@@ -2825,8 +2827,15 @@
+ size = GET_MODE_BITSIZE (mode);
+ #endif
+
++ /* Only deduct something for a REM if the last divide done was
++ for a different constant. Then set the constant of the last
++ divide. */
+ max_cost = div_cost[(int) compute_mode]
+- - (rem_flag ? mul_cost[(int) compute_mode] + add_cost : 0);
++ - (rem_flag && ! (last_div_const != 0 && op1_is_constant
++ && INTVAL (op1) == last_div_const)
++ ? mul_cost[(int) compute_mode] + add_cost : 0);
++
++ last_div_const = ! rem_flag && op1_is_constant ? INTVAL (op1) : 0;
+
+ /* Now convert to the best mode to use. */
+ if (compute_mode != mode)
OpenPOWER on IntegriCloud