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
98ee7e6c
Commit
98ee7e6c
authored
Sep 29, 2002
by
Richard Henderson
Committed by
Richard Henderson
Sep 29, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* real.c (real_from_string): Apply sign last. Tidy exponent handling.
From-SVN: r57637
parent
d3cc3f10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
18 deletions
+25
-18
gcc/ChangeLog
+4
-0
gcc/real.c
+21
-18
No files found.
gcc/ChangeLog
View file @
98ee7e6c
2002
-
09
-
29
Richard
Henderson
<
rth
@redhat
.
com
>
*
real
.
c
(
real_from_string
)
:
Apply
sign
last
.
Tidy
exponent
handling
.
2002
-
09
-
29
Richard
Henderson
<
rth
@redhat
.
com
>
*
combine
.
c
(
force_to_mode
)
:
Handle
FLOAT_MODE
destinations
for
CONST_INT
.
...
...
gcc/real.c
View file @
98ee7e6c
...
...
@@ -1579,12 +1579,13 @@ real_from_string (r, str)
const
char
*
str
;
{
int
exp
=
0
;
bool
sign
=
false
;
get_zero
(
r
,
0
);
if
(
*
str
==
'-'
)
{
r
->
sign
=
1
;
sign
=
true
;
str
++
;
}
else
if
(
*
str
==
'+'
)
...
...
@@ -1616,6 +1617,11 @@ real_from_string (r, str)
if
(
*
str
==
'.'
)
{
str
++
;
if
(
pos
==
SIGNIFICAND_BITS
-
4
)
{
while
(
*
str
==
'0'
)
str
++
,
exp
-=
4
;
}
while
(
1
)
{
d
=
hex_value
(
*
str
);
...
...
@@ -1632,12 +1638,12 @@ real_from_string (r, str)
}
if
(
*
str
==
'p'
||
*
str
==
'P'
)
{
int
exp_neg
=
0
;
bool
exp_neg
=
false
;
str
++
;
if
(
*
str
==
'-'
)
{
exp_neg
=
1
;
exp_neg
=
true
;
str
++
;
}
else
if
(
*
str
==
'+'
)
...
...
@@ -1646,10 +1652,9 @@ real_from_string (r, str)
d
=
0
;
while
(
ISDIGIT
(
*
str
))
{
int
t
=
d
;
d
*=
10
;
d
+=
*
str
-
'0'
;
if
(
d
<
t
)
if
(
d
>
MAX_EXP
)
{
/* Overflowed the exponent. */
if
(
exp_neg
)
...
...
@@ -1667,13 +1672,6 @@ real_from_string (r, str)
r
->
class
=
rvc_normal
;
r
->
exp
=
exp
;
if
(
r
->
exp
!=
exp
)
{
if
(
exp
<
0
)
goto
underflow
;
else
goto
overflow
;
}
normalize
(
r
);
}
...
...
@@ -1695,6 +1693,11 @@ real_from_string (r, str)
if
(
*
str
==
'.'
)
{
str
++
;
if
(
r
->
class
==
rvc_zero
)
{
while
(
*
str
==
'0'
)
str
++
,
exp
--
;
}
while
(
ISDIGIT
(
*
str
))
{
d
=
*
str
++
-
'0'
;
...
...
@@ -1707,12 +1710,12 @@ real_from_string (r, str)
if
(
*
str
==
'e'
||
*
str
==
'E'
)
{
int
exp_neg
=
0
;
bool
exp_neg
=
false
;
str
++
;
if
(
*
str
==
'-'
)
{
exp_neg
=
1
;
exp_neg
=
true
;
str
++
;
}
else
if
(
*
str
==
'+'
)
...
...
@@ -1721,10 +1724,9 @@ real_from_string (r, str)
d
=
0
;
while
(
ISDIGIT
(
*
str
))
{
int
t
=
d
;
d
*=
10
;
d
+=
*
str
-
'0'
;
if
(
d
<
t
)
if
(
d
>
MAX_EXP
)
{
/* Overflowed the exponent. */
if
(
exp_neg
)
...
...
@@ -1754,14 +1756,15 @@ real_from_string (r, str)
}
}
r
->
sign
=
sign
;
return
;
underflow
:
get_zero
(
r
,
r
->
sign
);
get_zero
(
r
,
sign
);
return
;
overflow
:
get_inf
(
r
,
r
->
sign
);
get_inf
(
r
,
sign
);
return
;
}
...
...
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