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
aeedc93f
Commit
aeedc93f
authored
Apr 18, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
From-SVN: r779
parent
19c98942
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
gcc/expmed.c
+9
-9
gcc/optabs.c
+10
-6
No files found.
gcc/expmed.c
View file @
aeedc93f
...
...
@@ -66,26 +66,26 @@ init_expmed ()
rtx
lea
;
int
i
,
dummy
;
add_cost
=
rtx_cost
(
gen_rtx
(
PLUS
,
word_mode
,
reg
,
reg
));
add_cost
=
rtx_cost
(
gen_rtx
(
PLUS
,
word_mode
,
reg
,
reg
)
,
SET
);
shift_cost
=
rtx_cost
(
gen_rtx
(
LSHIFT
,
word_mode
,
reg
,
/* Using a constant gives better
estimate of typical costs.
1 or 2 might have quirks. */
gen_rtx
(
CONST_INT
,
VOIDmode
,
3
)));
mult_cost
=
rtx_cost
(
gen_rtx
(
MULT
,
word_mode
,
reg
,
reg
));
negate_cost
=
rtx_cost
(
gen_rtx
(
NEG
,
word_mode
,
reg
));
gen_rtx
(
CONST_INT
,
VOIDmode
,
3
))
,
SET
);
mult_cost
=
rtx_cost
(
gen_rtx
(
MULT
,
word_mode
,
reg
,
reg
)
,
SET
);
negate_cost
=
rtx_cost
(
gen_rtx
(
NEG
,
word_mode
,
reg
)
,
SET
);
/* 999999 is chosen to avoid any plausible faster special case. */
mult_is_very_cheap
=
(
rtx_cost
(
gen_rtx
(
MULT
,
word_mode
,
reg
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
999999
)))
gen_rtx
(
CONST_INT
,
VOIDmode
,
999999
))
,
SET
)
<
rtx_cost
(
gen_rtx
(
LSHIFT
,
word_mode
,
reg
,
gen_rtx
(
CONST_INT
,
VOIDmode
,
7
))));
gen_rtx
(
CONST_INT
,
VOIDmode
,
7
))
,
SET
));
sdiv_pow2_cheap
=
rtx_cost
(
gen_rtx
(
DIV
,
word_mode
,
reg
,
pow2
))
<=
2
*
add_cost
;
=
rtx_cost
(
gen_rtx
(
DIV
,
word_mode
,
reg
,
pow2
)
,
SET
)
<=
2
*
add_cost
;
smod_pow2_cheap
=
rtx_cost
(
gen_rtx
(
MOD
,
word_mode
,
reg
,
pow2
))
<=
2
*
add_cost
;
=
rtx_cost
(
gen_rtx
(
MOD
,
word_mode
,
reg
,
pow2
)
,
SET
)
<=
2
*
add_cost
;
init_recog
();
for
(
i
=
2
;;
i
<<=
1
)
...
...
@@ -100,7 +100,7 @@ init_expmed ()
if
(
recog
(
lea
,
0
,
&
dummy
)
<
0
)
break
;
lea_max_mul
=
i
;
lea_cost
=
rtx_cost
(
SET_SRC
(
lea
));
lea_cost
=
rtx_cost
(
SET_SRC
(
lea
)
,
SET
);
}
/* Free the objects we just allocated. */
...
...
gcc/optabs.c
View file @
aeedc93f
...
...
@@ -229,10 +229,12 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
/* If we are inside an appropriately-short loop and one operand is an
expensive constant, force it into a register. */
if
(
CONSTANT_P
(
op0
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op0
)
>
2
)
if
(
CONSTANT_P
(
op0
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op0
,
binoptab
->
code
)
>
2
)
op0
=
force_reg
(
mode
,
op0
);
if
(
CONSTANT_P
(
op1
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op1
)
>
2
)
if
(
CONSTANT_P
(
op1
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op1
,
binoptab
->
code
)
>
2
)
op1
=
force_reg
(
shift_op
?
word_mode
:
mode
,
op1
);
#if 0 /* Turned off because it seems to be a kludgy method. */
...
...
@@ -871,10 +873,12 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
/* If we are inside an appropriately-short loop and one operand is an
expensive constant, force it into a register. */
if
(
CONSTANT_P
(
op0
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op0
)
>
2
)
if
(
CONSTANT_P
(
op0
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op0
,
binoptab
->
code
)
>
2
)
op0
=
force_reg
(
mode
,
op0
);
if
(
CONSTANT_P
(
op1
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op1
)
>
2
)
if
(
CONSTANT_P
(
op1
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
op1
,
binoptab
->
code
)
>
2
)
op1
=
force_reg
(
mode
,
op1
);
if
(
targ0
)
...
...
@@ -1450,10 +1454,10 @@ emit_cmp_insn (x, y, comparison, size, mode, unsignedp, align)
/* If we are inside an appropriately-short loop and one operand is an
expensive constant, force it into a register. */
if
(
CONSTANT_P
(
x
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
x
)
>
2
)
if
(
CONSTANT_P
(
x
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
x
,
COMPARE
)
>
2
)
x
=
force_reg
(
mode
,
x
);
if
(
CONSTANT_P
(
y
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
y
)
>
2
)
if
(
CONSTANT_P
(
y
)
&&
preserve_subexpressions_p
()
&&
rtx_cost
(
y
,
COMPARE
)
>
2
)
y
=
force_reg
(
mode
,
y
);
/* Don't let both operands fail to indicate the mode. */
...
...
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