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
a6f71af5
Commit
a6f71af5
authored
Mar 29, 1995
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(andcosts): Modify costs to match the hardware, and add
explanatory comments. From-SVN: r9245
parent
71851aaa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
gcc/config/sh/sh.c
+13
-5
No files found.
gcc/config/sh/sh.c
View file @
a6f71af5
...
...
@@ -1400,16 +1400,24 @@ andcosts (RTX)
rtx
RTX
;
{
int
i
;
/* Anding with a register is a single cycle and instruction. */
if
(
GET_CODE
(
XEXP
(
RTX
,
1
))
!=
CONST_INT
)
return
2
;
return
1
;
i
=
INTVAL
(
XEXP
(
RTX
,
1
));
/*
And can use the extend insns cheaply
. */
/*
These constants are single cycle extu.[bw] instructions
. */
if
(
i
==
0xff
||
i
==
0xffff
)
return
1
;
/* Constants that can be used in an and immediate instruction is a single
cycle, but this requires r0, so make it a little more expensive. */
if
(
CONST_OK_FOR_L
(
i
))
return
2
;
/* Any small constant is reasonably cheap - but requires r0. */
/* Constants that can be loaded with a mov immediate and an and.
This case is probably unnecessary. */
if
(
CONST_OK_FOR_I
(
i
))
return
3
;
return
5
;
return
2
;
/* Any other constants requires a 2 cycle pc-relative load plus an and.
This case is probably unnecessary. */
return
3
;
}
/* Return the cost of a multiply. */
...
...
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