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
90280148
Commit
90280148
authored
Jun 04, 2000
by
Michael Meissner
Committed by
Michael Meissner
Jun 04, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add IFCVT_MODIFY macros for the MD file to tweak the conditional execution support.
From-SVN: r34386
parent
7a50d891
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
1 deletions
+74
-1
gcc/ChangeLog
+15
-0
gcc/ifcvt.c
+34
-1
gcc/tm.texi
+25
-0
No files found.
gcc/ChangeLog
View file @
90280148
Sat Jun 3 19:05:30 2000 Michael Meissner <meissner@redhat.com>
* ifcvt (process_insns): If IFCVT_MODIFY_INSN is defined, call it
with the pattern to do machine dependent work.
(cond_exec_process_if_block): If IFCVT_MODIFY_TESTS is defined,
use it to modify the true/false tests used in conditional
execution. If IFCVT_MODIFY_FINAL and IFCVT_MODIFY_CANCEL are
defined, invoke them if the conversion to conditional execution
was successful or not.
* tm.texi (IFCVT_MODIFY_TESTS): Document.
(IFCVT_MODIFY_INSN): Ditto.
(IFCVT_MODIFY_FINAL): Ditto.
(IFCVT_MODIFY_CANCEL): Ditto.
Sat Jun 3 15:26:13 2000 Matt Kraai <kraai@alumni.carnegiemellon.edu>
* toplev.c (main): Fix misspellings of possibility and language.
...
...
gcc/ifcvt.c
View file @
90280148
...
...
@@ -207,6 +207,7 @@ cond_exec_process_insns (start, end, test, prob_val, mod_ok)
{
int
must_be_last
=
FALSE
;
rtx
insn
;
rtx
pattern
;
for
(
insn
=
start
;
;
insn
=
NEXT_INSN
(
insn
))
{
...
...
@@ -239,9 +240,20 @@ cond_exec_process_insns (start, end, test, prob_val, mod_ok)
}
/* Now build the conditional form of the instruction. */
pattern
=
PATTERN
(
insn
);
/* If the machine needs to modify the insn being conditionally executed,
say for example to force a constant integer operand into a temp
register, do so here. */
#ifdef IFCVT_MODIFY_INSN
IFCVT_MODIFY_INSN
(
pattern
,
insn
);
if
(
!
pattern
)
return
FALSE
;
#endif
validate_change
(
insn
,
&
PATTERN
(
insn
),
gen_rtx_COND_EXEC
(
VOIDmode
,
copy_rtx
(
test
),
PATTERN
(
insn
)
),
1
);
pattern
),
1
);
if
(
GET_CODE
(
insn
)
==
CALL_INSN
&&
prob_val
)
validate_change
(
insn
,
&
REG_NOTES
(
insn
),
...
...
@@ -369,6 +381,17 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
GET_MODE
(
true_expr
),
XEXP
(
true_expr
,
0
),
XEXP
(
true_expr
,
1
));
#ifdef IFCVT_MODIFY_TESTS
/* If the machine description needs to modify the tests, such as setting a
conditional execution register from a comparison, it can do so here. */
IFCVT_MODIFY_TESTS
(
true_expr
,
false_expr
,
test_bb
,
then_bb
,
else_bb
,
join_bb
);
/* See if the conversion failed */
if
(
!
true_expr
||
!
false_expr
)
goto
fail
;
#endif
true_prob_val
=
find_reg_note
(
test_bb
->
end
,
REG_BR_PROB
,
NULL_RTX
);
if
(
true_prob_val
)
{
...
...
@@ -398,6 +421,11 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
if
(
!
apply_change_group
())
return
FALSE
;
#ifdef IFCVT_MODIFY_FINAL
/* Do any machine dependent final modifications */
IFCVT_MODIFY_FINAL
(
test_bb
,
then_bb
,
else_bb
,
join_bb
);
#endif
/* Conversion succeeded. */
if
(
rtl_dump_file
)
fprintf
(
rtl_dump_file
,
"%d insn%s converted to conditional execution.
\n
"
,
...
...
@@ -408,6 +436,11 @@ cond_exec_process_if_block (test_bb, then_bb, else_bb, join_bb)
return
TRUE
;
fail
:
#ifdef IFCVT_MODIFY_CANCEL
/* Cancel any machine dependent changes. */
IFCVT_MODIFY_CANCEL
(
test_bb
,
then_bb
,
else_bb
,
join_bb
);
#endif
cancel_changes
(
0
);
return
FALSE
;
}
...
...
gcc/tm.texi
View file @
90280148
...
...
@@ -7973,4 +7973,29 @@ A C expression for the maximum number of instructions to execute via
conditional
execution
instructions
instead
of
a
branch
.
A
value
of
@code{
BRANCH_COST
}
+
1
is
the
default
if
the
machine
does
not
use
cc0
,
and
1
if
it
does
use
cc0
.
@findex
IFCVT_MODIFY_TESTS
@item
IFCVT_MODIFY_TESTS
A
C
expression
to
modify
the
tests
in
@code{
TRUE_EXPR
}
,
and
@code{
FALSE_EXPPR
}
for
use
in
converting
insns
in
@code{
TEST_BB
}
,
@code{
THEN_BB
}
,
@code{
ELSE_BB
}
,
and
@code{
JOIN_BB
}
basic
blocks
to
conditional
execution
.
Set
either
@code{
TRUE_EXPR
}
or
@code{
FALSE_EXPR
}
to
a
null
pointer
if
the
tests
cannot
be
converted
.
@findex
IFCVT_MODIFY_INSN
@item
IFCVT_MODIFY_INSN
A
C
expression
to
modify
the
@code{
PATTERN
}
of
an
@code{
INSN
}
that
is
to
be
converted
to
conditional
execution
format
.
@findex
IFCVT_MODIFY_FINAL
@item
IFCVT_MODIFY_FINAL
A
C
expression
to
perform
any
final
machine
dependent
modifications
in
converting
code
to
conditional
execution
in
the
basic
blocks
@code{
TEST_BB
}
,
@code{
THEN_BB
}
,
@code{
ELSE_BB
}
,
and
@code{
JOIN_BB
}
.
@findex
IFCVT_MODIFY_CANCEL
@item
IFCVT_MODIFY_CANCEL
A
C
expression
to
cancel
any
machine
dependent
modifications
in
converting
code
to
conditional
execution
in
the
basic
blocks
@code{
TEST_BB
}
,
@code{
THEN_BB
}
,
@code{
ELSE_BB
}
,
and
@code{
JOIN_BB
}
.
@end
table
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