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
96f153da
Commit
96f153da
authored
Jan 09, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_binop): For complex mult, compute res in each alternative, not before.
From-SVN: r3165
parent
676ce223
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
gcc/optabs.c
+12
-9
No files found.
gcc/optabs.c
View file @
96f153da
...
...
@@ -889,7 +889,9 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
switch
(
binoptab
->
code
)
{
case
PLUS
:
/* (a+ib) + (c+id) = (a+c) + i(b+d) */
case
MINUS
:
/* (a+ib) - (c+id) = (a-c) + i(b-d) */
res
=
expand_binop
(
submode
,
binoptab
,
real0
,
real1
,
realr
,
unsignedp
,
methods
);
if
(
res
!=
realr
)
...
...
@@ -912,15 +914,14 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
case
MULT
:
/* (a+ib) * (c+id) = (ac-bd) + i(ad+cb) */
res
=
expand_binop
(
submode
,
binoptab
,
real0
,
real1
,
realr
,
unsignedp
,
methods
);
if
(
imag0
&&
imag1
)
{
rtx
temp
=
expand_binop
(
submode
,
sub_optab
,
res
,
expand_binop
(
submode
,
binoptab
,
imag0
,
imag1
,
0
,
unsignedp
,
methods
),
expand_binop
(
submode
,
sub_optab
,
expand_binop
(
submode
,
binoptab
,
real0
,
real1
,
0
,
unsignedp
,
methods
),
expand_binop
(
submode
,
binoptab
,
imag0
,
imag1
,
0
,
unsignedp
,
methods
),
realr
,
unsignedp
,
methods
);
if
(
temp
!=
realr
)
...
...
@@ -939,6 +940,8 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
}
else
{
res
=
expand_binop
(
submode
,
binoptab
,
real0
,
real1
,
realr
,
unsignedp
,
methods
);
if
(
res
!=
realr
)
emit_move_insn
(
realr
,
res
);
...
...
@@ -954,11 +957,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
break
;
case
DIV
:
/* (
c+id)/(a+ib) == ((c+id)*(a-ib))/(a*a+b*b
) */
/* (
a+ib) / (c+id) = ((ac+bd)/(cc+dd)) + i((bc-ad)/(cc+dd)
) */
if
(
!
imag1
)
{
/* Simply divide the real and imaginary parts by `
a
' */
{
/* (a+ib) / (c+i0) = (a/c) + i(b/c) */
/* Simply divide the real and imaginary parts by `
c
' */
res
=
expand_binop
(
submode
,
binoptab
,
real0
,
real1
,
realr
,
unsignedp
,
methods
);
if
(
res
!=
realr
)
...
...
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