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
470f5b53
Commit
470f5b53
authored
Apr 21, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use mpfr_prec_round, not real_convert, to constraint floats.
From-SVN: r172811
parent
fa9ef321
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
gcc/go/gofrontend/expressions.cc
+3
-17
No files found.
gcc/go/gofrontend/expressions.cc
View file @
470f5b53
...
...
@@ -1909,13 +1909,7 @@ Float_expression::constrain_float(mpfr_t val, Type* type)
{
Float_type
*
ftype
=
type
->
float_type
();
if
(
ftype
!=
NULL
&&
!
ftype
->
is_abstract
())
{
tree
type_tree
=
ftype
->
type_tree
();
REAL_VALUE_TYPE
rvt
;
real_from_mpfr
(
&
rvt
,
val
,
type_tree
,
GMP_RNDN
);
real_convert
(
&
rvt
,
TYPE_MODE
(
type_tree
),
&
rvt
);
mpfr_from_real
(
val
,
&
rvt
,
GMP_RNDN
);
}
mpfr_prec_round
(
val
,
ftype
->
bits
(),
GMP_RNDN
);
}
// Return a floating point constant value.
...
...
@@ -2158,16 +2152,8 @@ Complex_expression::constrain_complex(mpfr_t real, mpfr_t imag, Type* type)
Complex_type
*
ctype
=
type
->
complex_type
();
if
(
ctype
!=
NULL
&&
!
ctype
->
is_abstract
())
{
tree
type_tree
=
ctype
->
type_tree
();
REAL_VALUE_TYPE
rvt
;
real_from_mpfr
(
&
rvt
,
real
,
TREE_TYPE
(
type_tree
),
GMP_RNDN
);
real_convert
(
&
rvt
,
TYPE_MODE
(
TREE_TYPE
(
type_tree
)),
&
rvt
);
mpfr_from_real
(
real
,
&
rvt
,
GMP_RNDN
);
real_from_mpfr
(
&
rvt
,
imag
,
TREE_TYPE
(
type_tree
),
GMP_RNDN
);
real_convert
(
&
rvt
,
TYPE_MODE
(
TREE_TYPE
(
type_tree
)),
&
rvt
);
mpfr_from_real
(
imag
,
&
rvt
,
GMP_RNDN
);
mpfr_prec_round
(
real
,
ctype
->
bits
()
/
2
,
GMP_RNDN
);
mpfr_prec_round
(
imag
,
ctype
->
bits
()
/
2
,
GMP_RNDN
);
}
}
...
...
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