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
a9d9c108
Commit
a9d9c108
authored
Mar 24, 1999
by
Geoff Keating
Committed by
Jeff Law
Mar 23, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fold-const.c (fold): Recognise a rotate by an unsigned amount.
From-SVN: r25937
parent
db4237a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
16 deletions
+40
-16
gcc/ChangeLog
+4
-0
gcc/fold-const.c
+36
-16
No files found.
gcc/ChangeLog
View file @
a9d9c108
Wed
Mar
24
01
:
35
:
01
1999
Geoff
Keating
<
geoffk
@ozemail
.
com
.
au
>
*
fold
-
const
.
c
(
fold
)
:
Recognise
a
rotate
by
an
unsigned
amount
.
Tue
Mar
23
23
:
32
:
14
1999
Jeffrey
A
Law
(
law
@cygnus
.
com
)
Tue
Mar
23
23
:
32
:
14
1999
Jeffrey
A
Law
(
law
@cygnus
.
com
)
*
pa
.
md
(
rotlsi3
)
:
New
expander
.
Synthesize
a
variable
rotate
*
pa
.
md
(
rotlsi3
)
:
New
expander
.
Synthesize
a
variable
rotate
...
...
gcc/fold-const.c
View file @
a9d9c108
...
@@ -5007,6 +5007,8 @@ fold (expr)
...
@@ -5007,6 +5007,8 @@ fold (expr)
tree01
=
TREE_OPERAND
(
arg0
,
1
);
tree01
=
TREE_OPERAND
(
arg0
,
1
);
tree11
=
TREE_OPERAND
(
arg1
,
1
);
tree11
=
TREE_OPERAND
(
arg1
,
1
);
STRIP_NOPS
(
tree01
);
STRIP_NOPS
(
tree11
);
code01
=
TREE_CODE
(
tree01
);
code01
=
TREE_CODE
(
tree01
);
code11
=
TREE_CODE
(
tree11
);
code11
=
TREE_CODE
(
tree11
);
if
(
code01
==
INTEGER_CST
if
(
code01
==
INTEGER_CST
...
@@ -5017,22 +5019,40 @@ fold (expr)
...
@@ -5017,22 +5019,40 @@ fold (expr)
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
)))))
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
)))))
return
build
(
LROTATE_EXPR
,
type
,
TREE_OPERAND
(
arg0
,
0
),
return
build
(
LROTATE_EXPR
,
type
,
TREE_OPERAND
(
arg0
,
0
),
code0
==
LSHIFT_EXPR
?
tree01
:
tree11
);
code0
==
LSHIFT_EXPR
?
tree01
:
tree11
);
else
if
(
code11
==
MINUS_EXPR
else
if
(
code11
==
MINUS_EXPR
)
&&
TREE_CODE
(
TREE_OPERAND
(
tree11
,
0
))
==
INTEGER_CST
{
&&
TREE_INT_CST_HIGH
(
TREE_OPERAND
(
tree11
,
0
))
==
0
tree
tree110
,
tree111
;
&&
TREE_INT_CST_LOW
(
TREE_OPERAND
(
tree11
,
0
))
tree110
=
TREE_OPERAND
(
tree11
,
0
);
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
)))
tree111
=
TREE_OPERAND
(
tree11
,
1
);
&&
operand_equal_p
(
tree01
,
TREE_OPERAND
(
tree11
,
1
),
0
))
STRIP_NOPS
(
tree110
);
return
build
(
code0
==
LSHIFT_EXPR
?
LROTATE_EXPR
:
RROTATE_EXPR
,
STRIP_NOPS
(
tree111
);
type
,
TREE_OPERAND
(
arg0
,
0
),
tree01
);
if
(
TREE_CODE
(
tree110
)
==
INTEGER_CST
else
if
(
code01
==
MINUS_EXPR
&&
TREE_INT_CST_HIGH
(
tree110
)
==
0
&&
TREE_CODE
(
TREE_OPERAND
(
tree01
,
0
))
==
INTEGER_CST
&&
(
TREE_INT_CST_LOW
(
tree110
)
&&
TREE_INT_CST_HIGH
(
TREE_OPERAND
(
tree01
,
0
))
==
0
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
))))
&&
TREE_INT_CST_LOW
(
TREE_OPERAND
(
tree01
,
0
))
&&
operand_equal_p
(
tree01
,
tree111
,
0
))
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
)))
return
build
((
code0
==
LSHIFT_EXPR
&&
operand_equal_p
(
tree11
,
TREE_OPERAND
(
tree01
,
1
),
0
))
?
LROTATE_EXPR
return
build
(
code0
!=
LSHIFT_EXPR
?
LROTATE_EXPR
:
RROTATE_EXPR
,
:
RROTATE_EXPR
),
type
,
TREE_OPERAND
(
arg0
,
0
),
tree11
);
type
,
TREE_OPERAND
(
arg0
,
0
),
tree01
);
}
else
if
(
code01
==
MINUS_EXPR
)
{
tree
tree010
,
tree011
;
tree010
=
TREE_OPERAND
(
tree01
,
0
);
tree011
=
TREE_OPERAND
(
tree01
,
1
);
STRIP_NOPS
(
tree010
);
STRIP_NOPS
(
tree011
);
if
(
TREE_CODE
(
tree010
)
==
INTEGER_CST
&&
TREE_INT_CST_HIGH
(
tree010
)
==
0
&&
(
TREE_INT_CST_LOW
(
tree010
)
==
TYPE_PRECISION
(
TREE_TYPE
(
TREE_OPERAND
(
arg0
,
0
))))
&&
operand_equal_p
(
tree11
,
tree011
,
0
))
return
build
((
code0
!=
LSHIFT_EXPR
?
LROTATE_EXPR
:
RROTATE_EXPR
),
type
,
TREE_OPERAND
(
arg0
,
0
),
tree11
);
}
}
}
goto
associate
;
goto
associate
;
...
...
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