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
0af5da7f
Commit
0af5da7f
authored
Mar 30, 2004
by
Fariborz Jahanian
Committed by
Fariborz Jahanian
Mar 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reassociate multiply expression with an adjacent non-multiply expression.
Reviewed by Roger Sayle. From-SVN: r80093
parent
cfdfa110
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
gcc/ChangeLog
+6
-0
gcc/fold-const.c
+30
-0
No files found.
gcc/ChangeLog
View file @
0af5da7f
2004-03-29 Fariborz Jahanian <fjahanian@apple.com>
* fold-const.c (fold): Reassociate multiply expression
with an adjacent non-multiply expression to use
architecture's multiply-add instruction.
2004-03-30 Zack Weinberg <zack@codesourcery.com>
* gengtype.c (create_option): New function.
...
...
gcc/fold-const.c
View file @
0af5da7f
...
...
@@ -6042,6 +6042,36 @@ fold (tree expr)
TREE_OPERAND
(
arg0
,
0
),
build_real
(
type
,
c1
)));
}
/* Convert a + (b*c + d*e) into (a + b*c) + d*e */
if
(
flag_unsafe_math_optimizations
&&
TREE_CODE
(
arg1
)
==
PLUS_EXPR
&&
TREE_CODE
(
arg0
)
!=
MULT_EXPR
)
{
tree
tree10
=
TREE_OPERAND
(
arg1
,
0
);
tree
tree11
=
TREE_OPERAND
(
arg1
,
1
);
if
(
TREE_CODE
(
tree11
)
==
MULT_EXPR
&&
TREE_CODE
(
tree10
)
==
MULT_EXPR
)
{
tree
tree0
;
tree0
=
fold
(
build
(
PLUS_EXPR
,
type
,
arg0
,
tree10
));
return
fold
(
build
(
PLUS_EXPR
,
type
,
tree0
,
tree11
));
}
}
/* Convert (b*c + d*e) + a into b*c + (d*e +a) */
if
(
flag_unsafe_math_optimizations
&&
TREE_CODE
(
arg0
)
==
PLUS_EXPR
&&
TREE_CODE
(
arg1
)
!=
MULT_EXPR
)
{
tree
tree00
=
TREE_OPERAND
(
arg0
,
0
);
tree
tree01
=
TREE_OPERAND
(
arg0
,
1
);
if
(
TREE_CODE
(
tree01
)
==
MULT_EXPR
&&
TREE_CODE
(
tree00
)
==
MULT_EXPR
)
{
tree
tree0
;
tree0
=
fold
(
build
(
PLUS_EXPR
,
type
,
tree01
,
arg1
));
return
fold
(
build
(
PLUS_EXPR
,
type
,
tree00
,
tree0
));
}
}
}
bit_rotate
:
...
...
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