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
ea9be077
Commit
ea9be077
authored
30 years ago
by
Michael Meissner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate better code for sne on PowerPC.
From-SVN: r9184
parent
22859ae8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletions
+61
-1
gcc/config/rs6000/rs6000.md
+61
-1
No files found.
gcc/config/rs6000/rs6000.md
View file @
ea9be077
...
...
@@ -1020,18 +1020,67 @@
;; We don't need abs with condition code because such comparisons should
;; never be done.
(define_insn "abssi2"
(define_expand "abssi2"
[
(set (match_operand:SI 0 "gpc_reg_operand" "")
(abs:SI (match_operand:SI 1 "gpc_reg_operand" "")))]
""
"
{
if (!TARGET_POWER)
{
emit_insn (gen_abssi2_nopower (operands
[
0
]
, operands
[
1
]
));
DONE;
}
}")
(define_insn "abssi2_power"
[
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
"TARGET_POWER"
"abs %0,%1")
(define_insn "abssi2_nopower"
[
(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
(clobber (match_scratch:SI 2 "=&r,&r"))]
"!TARGET_POWER"
"{srai|srawi} %2,%1,31
\;
xor %0,%2,%1
\;
subf %0,%2,%0"
[
(set_attr "length" "12")
]
)
(define_split
[
(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0")))
(clobber (match_scratch:SI 2 "=&r,&r"))]
"!TARGET_POWER && reload_completed"
[
(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
(set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
(set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))]
"")
(define_insn ""
[
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r"))))]
"TARGET_POWER"
"nabs %0,%1")
(define_insn ""
[
(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
(clobber (match_scratch:SI 2 "=&r,&r"))]
"!TARGET_POWER"
"{srai|srawi} %2,%1,31
\;
xor %0,%2,%1
\;
subf %0,%0,%2"
[
(set_attr "length" "12")
]
)
(define_split
[
(set (match_operand:SI 0 "gpc_reg_operand" "=&r,r")
(neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r,0"))))
(clobber (match_scratch:SI 2 "=&r,&r"))]
"!TARGET_POWER && reload_completed"
[
(set (match_dup 2) (ashiftrt:SI (match_dup 1) (const_int 31)))
(set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))
(set (match_dup 0) (minus:SI (match_dup 0) (match_dup 2)))]
"")
(define_insn "negsi2"
[
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))]
...
...
@@ -5704,6 +5753,17 @@
{sfi|subfic} %0,%1,%2
\;
{ai|addic} %0,%0,-1
\;
{sfe|subfe} %0,%0,%0"
[
(set_attr "length" "12,8,12,12,12")
]
)
;; Simplify (ne X (const_int 0)) on the PowerPC. No need to on the Power,
;; since it nabs/sr is just as fast.
(define_insn ""
[
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(lshiftrt:SI (neg:SI (abs:SI (match_operand:SI 1 "gpc_reg_operand" "r")))
(const_int 31)))
(clobber (match_scratch:SI 2 "=&r"))]
"!TARGET_POWER"
"{ai|addic} %2,%1,-1
\;
{sfe|subfe} %0,%2,%1"
[
(set_attr "length" "8")
]
)
;; This is what (plus (ne X (const_int 0)) Y) looks like.
(define_insn ""
[
(set (match_operand:SI 0 "gpc_reg_operand" "=r")
...
...
This diff is collapsed.
Click to expand it.
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