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
2882702b
Commit
2882702b
authored
Jan 17, 2011
by
Richard Henderson
Committed by
Richard Henderson
Jan 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rx: Split movsicc post-reload.
This will allow elimination of the compare. From-SVN: r168921
parent
6f7310f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
38 deletions
+73
-38
gcc/ChangeLog
+4
-0
gcc/config/rx/rx.md
+69
-38
No files found.
gcc/ChangeLog
View file @
2882702b
2011-01-17 Richard Henderson <rth@redhat.com>
2011-01-17 Richard Henderson <rth@redhat.com>
* config/rx/rx.md (movsicc): Split after reload.
(*movsicc): Merge *movsieq and *movsine via match_operator.
(*stcc): New pattern.
* config/rx/rx.c (rx_float_compare_mode): Remove.
* config/rx/rx.c (rx_float_compare_mode): Remove.
* config/rx/rx.h (rx_float_compare_mode): Remove.
* config/rx/rx.h (rx_float_compare_mode): Remove.
* config/rx/rx.md (cstoresi4): Split after reload.
* config/rx/rx.md (cstoresi4): Split after reload.
...
...
gcc/config/rx/rx.md
View file @
2882702b
...
@@ -744,47 +744,78 @@
...
@@ -744,47 +744,78 @@
[
(set (match_operand:SI 0 "register_operand")
[
(set (match_operand:SI 0 "register_operand")
(if_then_else:SI (match_operand:SI 1 "comparison_operator")
(if_then_else:SI (match_operand:SI 1 "comparison_operator")
(match_operand:SI 2 "nonmemory_operand")
(match_operand:SI 2 "nonmemory_operand")
(match_operand:SI 3 "
immediate
_operand")))
(match_operand:SI 3 "
nonmemory
_operand")))
(clobber (reg:CC CC_REG))])]
;; See cstoresi4
(clobber (reg:CC CC_REG))])]
""
""
{
{
if (GET_CODE (operands
[
1
]
) != EQ && GET_CODE (operands
[
1
]
) != NE)
/
* ??? Support other conditions via cstore into a temporary? *
/
FAIL;
if (GET_CODE (operands
[
1
]
) != EQ && GET_CODE (operands
[
1
]
) != NE)
if (! CONST_INT_P (operands
[
3
]
))
FAIL;
FAIL;
/
* One operand must be a constant. *
/
}
if (!CONSTANT_P (operands
[
2
]
) && !CONSTANT_P (operands
[
3
]
))
)
FAIL;
})
(define_insn "
*
movsieq"
(define_insn_and_split "
*
movsicc"
[
(set (match_operand:SI 0 "register_operand" "=r,r,r")
[
(set (match_operand:SI 0 "register_operand" "=r,r")
(if_then_else:SI (eq (match_operand:SI 3 "register_operand" "r,r,r")
(if_then_else:SI
(match_operand:SI 4 "rx_source_operand" "riQ,riQ,riQ"))
(match_operator 5 "rx_z_comparison_operator"
(match_operand:SI 1 "nonmemory_operand" "0,i,r")
[
(match_operand:SI 3 "register_operand" "r,r")
(match_operand:SI 2 "immediate_operand" "i,i,i")))
(match_operand:SI 4 "rx_source_operand" "riQ,riQ")])
(clobber (reg:CC CC_REG))] ;; See cstoresi4
(match_operand:SI 1 "nonmemory_operand" "i,ri")
""
(match_operand:SI 2 "nonmemory_operand" "ri,i")))
"@
(clobber (reg:CC CC_REG))]
cmp
\t
%Q4, %Q3
\n\t
stnz
\t
%2, %0
"CONSTANT_P (operands
[
1
]
) || CONSTANT_P (operands
[
2
]
)"
cmp
\t
%Q4, %Q3
\n\t
mov.l
\t
%2, %0
\n\t
stz
\t
%1, %0
"#"
cmp
\t
%Q4, %Q3
\n\t
mov.l
\t
%1, %0
\n\t
stnz
\t
%2, %0"
"&& reload_completed"
[
(set_attr "length" "13,19,15")
[
(const_int 0)
]
(set_attr "timings" "22,33,33")]
{
)
rtx x, flags, op0, op1, op2;
enum rtx_code cmp_code;
(define_insn "
*
movsine"
flags = gen_rtx_REG (CCmode, CC_REG);
[
(set (match_operand:SI 0 "register_operand" "=r,r,r")
x = gen_rtx_COMPARE (CCmode, operands
[
3
]
, operands
[
4
]
);
(if_then_else:SI (ne (match_operand:SI 3 "register_operand" "r,r,r")
emit_insn (gen_rtx_SET (VOIDmode, flags, x));
(match_operand:SI 4 "rx_source_operand" "riQ,riQ,riQ"))
(match_operand:SI 1 "nonmemory_operand" "0,i,r")
cmp_code = GET_CODE (operands
[
5
]
);
(match_operand:SI 2 "immediate_operand" "i,i,i")))
op0 = operands
[
0
]
;
(clobber (reg:CC CC_REG))] ;; See cstoresi4
op1 = operands
[
1
]
;
""
op2 = operands
[
2
]
;
"@
cmp
\t
%Q4, %Q3
\n\t
stz
\t
%2, %0
/
* If OP2 is the constant, reverse the sense of the move. *
/
cmp
\t
%Q4, %Q3
\n\t
mov.l
\t
%2, %0
\n\t
stnz
\t
%1, %0
if (!CONSTANT_P (operands
[
1
]
))
cmp
\t
%Q4, %Q3
\n\t
mov.l
\t
%1, %0
\n\t
stz
\t
%2, %0"
{
[
(set_attr "length" "13,19,15")
x = op1, op1 = op2, op2 = x;
(set_attr "timings" "22,33,33")]
cmp_code = reverse_condition (cmp_code);
}
/
*
If OP2 does not match the output, copy it into place. We have allowed
these alternatives so that the destination can legitimately be one of
the comparison operands without increasing register pressure.
*
/
if (!rtx_equal_p (op0, op2))
emit_move_insn (op0, op2);
x = gen_rtx_fmt_ee (cmp_code, VOIDmode, flags, const0_rtx);
x = gen_rtx_IF_THEN_ELSE (SImode, x, op1, op0);
emit_insn (gen_rtx_SET (VOIDmode, op0, x));
DONE;
})
(define_insn "
*
stcc"
[
(set (match_operand:SI 0 "register_operand" "+r,r,r,r")
(if_then_else:SI
(match_operator 2 "rx_z_comparison_operator"
[
(reg CC_REG) (const_int 0)
]
)
(match_operand:SI 1 "immediate_operand" "Sint08,Sint16,Sint24,i")
(match_dup 0)))]
"reload_completed"
{
if (GET_CODE (operands
[
2
]
) == EQ)
return "stz
\t
%1, %0";
else
return "stnz
\t
%1, %0";
}
[
(set_attr "length" "4,5,6,7")
]
)
)
;; Arithmetic Instructions
;; Arithmetic Instructions
...
...
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