Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
2aff9508
Commit
2aff9508
authored
Nov 04, 2002
by
Dale Johannesen
Committed by
Dale Johannesen
Nov 04, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bugs that showed up building Spec on ppc darwin.
From-SVN: r58800
parent
e86e721f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
13 deletions
+29
-13
gcc/ChangeLog
+6
-0
gcc/doloop.c
+16
-13
gcc/loop.c
+7
-0
No files found.
gcc/ChangeLog
View file @
2aff9508
2002
-
11
-
04
Dale
Johannesen
<
dalej
@apple
.
com
>
*
doloop
.
c
(
doloop_modify_runtime
)
:
Fix
loop
count
computation
for
unrolled
loops
.
*
loop
.
c
(
loop_invariant_p
)
:
Support
calling
from
unroller
.
2002
-
11
-
04
Ulrich
Weigand
<
uweigand
@de
.
ibm
.
com
>
*
config
/
s390
/
s390
.
c
(
s390_decompose_address
)
:
Use
arg_pointer_rtx
...
...
gcc/doloop.c
View file @
2aff9508
...
...
@@ -599,16 +599,19 @@ doloop_modify_runtime (loop, iterations_max,
If the loop has been unrolled, the full calculation is
t1 = abs_inc * unroll_number; increment per loop
n = abs (final - initial) / t1; full loops
n += (abs (final - initial) % t1) != 0; partial loop
t1 = abs_inc * unroll_number; increment per loop
n = (abs (final - initial) + abs_inc - 1) / t1; full loops
n += (abs (final - initial) + abs_inc - 1) % t1) >= abs_inc;
partial loop
which works out to be equivalent to
However, in certain cases the unrolled loop will be preconditioned
by emitting copies of the loop body with conditional branches,
so that the unrolled loop is always a full loop and thus needs
no exit tests. In this case we don't want to add the partial
loop count. As above, when t1 is a power of two we don't need to
worry about overflow.
n = (abs (final - initial) + t1 - 1) / t1;
In the case where the loop was preconditioned, a few iterations
may have been executed earlier; but 'initial' was adjusted as they
were executed, so we don't need anything special for that case here.
As above, when t1 is a power of two we don't need to worry about
overflow.
The division and modulo operations can be avoided by requiring
that the increment is a power of 2 (precondition_loop_p enforces
...
...
@@ -683,10 +686,10 @@ doloop_modify_runtime (loop, iterations_max,
if
(
shift_count
<
0
)
abort
();
if
(
!
loop_info
->
preconditioned
)
diff
=
expand_simple_binop
(
GET_MODE
(
diff
),
PLUS
,
diff
,
GEN_INT
(
abs_loop_inc
-
1
),
diff
,
1
,
OPTAB_LIB_WIDEN
);
/* (abs (final - initial) + abs_inc * unroll_number - 1) */
diff
=
expand_simple_binop
(
GET_MODE
(
diff
),
PLUS
,
diff
,
GEN_INT
(
abs_loop_inc
-
1
),
diff
,
1
,
OPTAB_LIB_WIDEN
);
/* (abs (final - initial) + abs_inc * unroll_number - 1)
/ (abs_inc * unroll_number) */
...
...
gcc/loop.c
View file @
2aff9508
...
...
@@ -3273,6 +3273,13 @@ loop_invariant_p (loop, x)
&&
REGNO
(
x
)
<
FIRST_PSEUDO_REGISTER
&&
call_used_regs
[
REGNO
(
x
)])
return
0
;
/* Out-of-range regs can occur when we are called from unrolling.
These have always been created by the unroller and are set in
the loop, hence are never invariant. */
if
(
REGNO
(
x
)
>=
regs
->
num
)
return
0
;
if
(
regs
->
array
[
REGNO
(
x
)].
set_in_loop
<
0
)
return
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment