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
c0a08574
Commit
c0a08574
authored
Dec 23, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_mult): Preserve useful sub-expressions when
expanding a synthesized mult. From-SVN: r6287
parent
cfc327a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
gcc/expmed.c
+15
-10
No files found.
gcc/expmed.c
View file @
c0a08574
...
...
@@ -2153,9 +2153,11 @@ expand_mult (mode, op0, op1, target, unsignedp)
for
(
opno
=
1
;
opno
<
alg
.
ops
;
opno
++
)
{
int
log
=
alg
.
log
[
opno
];
rtx
shift_subtarget
=
preserve_subexpressions_p
()
?
0
:
accum
;
int
preserve
=
preserve_subexpressions_p
();
rtx
shift_subtarget
=
preserve
?
0
:
accum
;
rtx
add_target
=
opno
==
alg
.
ops
-
1
&&
target
!=
0
?
target
:
0
;
rtx
accum_target
=
preserve
?
0
:
accum
;
switch
(
alg
.
op
[
opno
])
{
case
alg_shift
:
...
...
@@ -2168,7 +2170,7 @@ expand_mult (mode, op0, op1, target, unsignedp)
tem
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
op0
,
build_int_2
(
log
,
0
),
NULL_RTX
,
0
);
accum
=
force_operand
(
gen_rtx
(
PLUS
,
mode
,
accum
,
tem
),
add_target
?
add_target
:
accum
);
add_target
?
add_target
:
accum
_target
);
val_so_far
+=
(
HOST_WIDE_INT
)
1
<<
log
;
break
;
...
...
@@ -2176,23 +2178,25 @@ expand_mult (mode, op0, op1, target, unsignedp)
tem
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
op0
,
build_int_2
(
log
,
0
),
NULL_RTX
,
0
);
accum
=
force_operand
(
gen_rtx
(
MINUS
,
mode
,
accum
,
tem
),
add_target
?
add_target
:
accum
);
add_target
?
add_target
:
accum
_target
);
val_so_far
-=
(
HOST_WIDE_INT
)
1
<<
log
;
break
;
case
alg_add_t2_m
:
accum
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
accum
,
build_int_2
(
log
,
0
),
accum
,
0
);
build_int_2
(
log
,
0
),
shift_subtarget
,
0
);
accum
=
force_operand
(
gen_rtx
(
PLUS
,
mode
,
accum
,
op0
),
add_target
?
add_target
:
accum
);
add_target
?
add_target
:
accum
_target
);
val_so_far
=
(
val_so_far
<<
log
)
+
1
;
break
;
case
alg_sub_t2_m
:
accum
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
accum
,
build_int_2
(
log
,
0
),
accum
,
0
);
build_int_2
(
log
,
0
),
shift_subtarget
,
0
);
accum
=
force_operand
(
gen_rtx
(
MINUS
,
mode
,
accum
,
op0
),
add_target
?
add_target
:
accum
);
add_target
?
add_target
:
accum
_target
);
val_so_far
=
(
val_so_far
<<
log
)
-
1
;
break
;
...
...
@@ -2200,7 +2204,7 @@ expand_mult (mode, op0, op1, target, unsignedp)
tem
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
accum
,
build_int_2
(
log
,
0
),
NULL_RTX
,
0
);
accum
=
force_operand
(
gen_rtx
(
PLUS
,
mode
,
accum
,
tem
),
add_target
?
add_target
:
accum
);
add_target
?
add_target
:
accum
_target
);
val_so_far
+=
val_so_far
<<
log
;
break
;
...
...
@@ -2208,7 +2212,8 @@ expand_mult (mode, op0, op1, target, unsignedp)
tem
=
expand_shift
(
LSHIFT_EXPR
,
mode
,
accum
,
build_int_2
(
log
,
0
),
NULL_RTX
,
0
);
accum
=
force_operand
(
gen_rtx
(
MINUS
,
mode
,
tem
,
accum
),
add_target
?
add_target
:
tem
);
(
add_target
?
add_target
:
preserve
?
0
:
tem
));
val_so_far
=
(
val_so_far
<<
log
)
-
val_so_far
;
break
;
...
...
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