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
990a1e46
Commit
990a1e46
authored
Mar 31, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(check_float_value): New function.
From-SVN: r3959
parent
969e811d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
gcc/config/vax/vax.c
+60
-0
No files found.
gcc/config/vax/vax.c
View file @
990a1e46
...
...
@@ -577,6 +577,66 @@ vax_rtx_cost (x)
}
return
c
;
}
/* Check a `double' value for validity for a particular machine mode. */
static
char
*
float_strings
[]
=
{
"1.70141173319264430e+38"
,
/* 2^127 (2^24 - 1) / 2^24 */
"-1.70141173319264430e+38"
,
"2.93873587705571877e-39"
,
/* 2^-128 */
"-2.93873587705571877e-39"
};
static
REAL_VALUE_TYPE
float_values
[
4
];
static
int
inited_float_values
=
0
;
void
check_float_value
(
mode
,
d
)
enum
machine_mode
mode
;
REAL_VALUE_TYPE
*
d
;
{
if
(
inited_float_values
==
0
)
{
int
i
;
for
(
i
=
0
;
i
<
4
;
i
++
)
{
float_values
[
i
]
=
REAL_VALUE_ATOF
(
float_strings
[
i
],
DFmode
);
}
inited_float_values
=
1
;
}
if
((
mode
)
==
SFmode
)
{
REAL_VALUE_TYPE
r
;
bcopy
(
d
,
&
r
,
sizeof
(
REAL_VALUE_TYPE
));
if
(
REAL_VALUES_LESS
(
float_values
[
0
],
r
))
{
error
(
"magnitude of constant too large for `float'"
);
bcopy
(
&
float_values
[
0
],
d
,
sizeof
(
REAL_VALUE_TYPE
));
}
else
if
(
REAL_VALUES_LESS
(
r
,
float_values
[
1
]))
{
error
(
"magnitude of constant too large for `float'"
);
bcopy
(
&
float_values
[
1
],
d
,
sizeof
(
REAL_VALUE_TYPE
));
}
else
if
(
REAL_VALUES_LESS
(
dconst0
,
r
)
&&
REAL_VALUES_LESS
(
r
,
float_values
[
2
]))
{
warning
(
"`float' constant truncated to zero"
);
bcopy
(
&
dconst0
,
d
,
sizeof
(
REAL_VALUE_TYPE
));
}
else
if
(
REAL_VALUES_LESS
(
r
,
dconst0
)
&&
REAL_VALUES_LESS
(
float_values
[
3
],
r
))
{
warning
(
"`float' constant truncated to zero"
);
bcopy
(
&
dconst0
,
d
,
sizeof
(
REAL_VALUE_TYPE
));
}
}
}
/* Linked list of all externals that are to be emitted when optimizing
for the global pointer if they haven't been declared by the end of
...
...
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