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
d56390c4
Commit
d56390c4
authored
Aug 15, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ediv, emul): Set sign bit of IEEE -0.0 result.
From-SVN: r10244
parent
f4510f37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
33 deletions
+41
-33
gcc/real.c
+41
-33
No files found.
gcc/real.c
View file @
d56390c4
...
...
@@ -2635,9 +2635,13 @@ ediv (a, b, c)
unsigned
EMUSHORT
*
a
,
*
b
,
*
c
;
{
unsigned
EMUSHORT
ai
[
NI
],
bi
[
NI
];
int
i
;
int
i
,
sign
;
EMULONG
lt
,
lta
,
ltb
;
/* IEEE says if result is not a NaN, the sign is "-" if and only if
operands have opposite signs -- but flush -0 to 0 later if not IEEE. */
sign
=
eisneg
(
a
)
^
eisneg
(
b
);
#ifdef NANS
/* Return any NaN input. */
if
(
eisnan
(
a
))
...
...
@@ -2655,7 +2659,7 @@ ediv (a, b, c)
||
(
eisinf
(
a
)
&&
eisinf
(
b
)))
{
mtherr
(
"ediv"
,
INVALID
);
enan
(
c
,
eisneg
(
a
)
^
eisneg
(
b
)
);
enan
(
c
,
sign
);
return
;
}
#endif
...
...
@@ -2663,18 +2667,14 @@ ediv (a, b, c)
#ifdef INFINITY
if
(
eisinf
(
b
))
{
if
(
eisneg
(
a
)
^
eisneg
(
b
))
*
(
c
+
(
NE
-
1
))
=
0x8000
;
else
*
(
c
+
(
NE
-
1
))
=
0
;
einfin
(
c
);
retur
n
;
goto
divsig
n
;
}
/* Anything else over infinity is zero. */
if
(
eisinf
(
a
))
{
eclear
(
c
);
retur
n
;
goto
divsig
n
;
}
#endif
emovi
(
a
,
ai
);
...
...
@@ -2692,7 +2692,7 @@ ediv (a, b, c)
}
}
eclear
(
c
);
retur
n
;
goto
divsig
n
;
}
dnzro1
:
...
...
@@ -2706,15 +2706,11 @@ ediv (a, b, c)
goto
dnzro2
;
}
}
if
(
ai
[
0
]
==
bi
[
0
])
*
(
c
+
(
NE
-
1
))
=
0
;
else
*
(
c
+
(
NE
-
1
))
=
0x8000
;
/* Divide by zero is not an invalid operation.
It is a divide-by-zero operation! */
einfin
(
c
);
mtherr
(
"ediv"
,
SING
);
retur
n
;
goto
divsig
n
;
}
dnzro2
:
...
...
@@ -2722,12 +2718,18 @@ ediv (a, b, c)
/* calculate exponent */
lt
=
ltb
-
lta
+
EXONE
;
emdnorm
(
bi
,
i
,
0
,
lt
,
64
);
/* set the sign */
if
(
ai
[
0
]
==
bi
[
0
])
bi
[
0
]
=
0
;
else
bi
[
0
]
=
0Xffff
;
emovo
(
bi
,
c
);
divsign
:
if
(
sign
#ifndef IEEE
&&
(
ecmp
(
c
,
ezero
)
!=
0
)
#endif
)
*
(
c
+
(
NE
-
1
))
|=
0x8000
;
else
*
(
c
+
(
NE
-
1
))
&=
~
0x8000
;
}
/* Multiply e-types A and B, return e-type product C. */
...
...
@@ -2737,9 +2739,13 @@ emul (a, b, c)
unsigned
EMUSHORT
*
a
,
*
b
,
*
c
;
{
unsigned
EMUSHORT
ai
[
NI
],
bi
[
NI
];
int
i
,
j
;
int
i
,
j
,
sign
;
EMULONG
lt
,
lta
,
ltb
;
/* IEEE says if result is not a NaN, the sign is "-" if and only if
operands have opposite signs -- but flush -0 to 0 later if not IEEE. */
sign
=
eisneg
(
a
)
^
eisneg
(
b
);
#ifdef NANS
/* NaN times anything is the same NaN. */
if
(
eisnan
(
a
))
...
...
@@ -2757,7 +2763,7 @@ emul (a, b, c)
||
(
eisinf
(
b
)
&&
(
ecmp
(
a
,
ezero
)
==
0
)))
{
mtherr
(
"emul"
,
INVALID
);
enan
(
c
,
eisneg
(
a
)
^
eisneg
(
b
)
);
enan
(
c
,
sign
);
return
;
}
#endif
...
...
@@ -2765,12 +2771,8 @@ emul (a, b, c)
#ifdef INFINITY
if
(
eisinf
(
a
)
||
eisinf
(
b
))
{
if
(
eisneg
(
a
)
^
eisneg
(
b
))
*
(
c
+
(
NE
-
1
))
=
0x8000
;
else
*
(
c
+
(
NE
-
1
))
=
0
;
einfin
(
c
);
retur
n
;
goto
mulsig
n
;
}
#endif
emovi
(
a
,
ai
);
...
...
@@ -2788,7 +2790,7 @@ emul (a, b, c)
}
}
eclear
(
c
);
retur
n
;
goto
mulsig
n
;
}
mnzer1
:
...
...
@@ -2803,7 +2805,7 @@ emul (a, b, c)
}
}
eclear
(
c
);
retur
n
;
goto
mulsig
n
;
}
mnzer2
:
...
...
@@ -2812,12 +2814,18 @@ emul (a, b, c)
/* calculate exponent */
lt
=
lta
+
ltb
-
(
EXONE
-
1
);
emdnorm
(
bi
,
j
,
0
,
lt
,
64
);
/* calculate sign of product */
if
(
ai
[
0
]
==
bi
[
0
])
bi
[
0
]
=
0
;
else
bi
[
0
]
=
0xffff
;
emovo
(
bi
,
c
);
mulsign
:
if
(
sign
#ifndef IEEE
&&
(
ecmp
(
c
,
ezero
)
!=
0
)
#endif
)
*
(
c
+
(
NE
-
1
))
|=
0x8000
;
else
*
(
c
+
(
NE
-
1
))
&=
~
0x8000
;
}
/* Convert double precision PE to e-type Y. */
...
...
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