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
c764eafd
Commit
c764eafd
authored
Feb 14, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(eifrac): If FIXUNS_TRUNC_LIKE_FIX_TRUNC, convert on positive overflow
as if unsigned. From-SVN: r6554
parent
7aaf8abb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
12 deletions
+18
-12
gcc/real.c
+18
-12
No files found.
gcc/real.c
View file @
c764eafd
/* real.c - implementation of REAL_ARITHMETIC, REAL_VALUE_ATOF,
and support for XFmode IEEE extended real floating point arithmetic.
Contributed by Stephen L. Moshier (moshier@world.std.com).
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
Contributed by Stephen L. Moshier (moshier@world.std.com).
This file is part of GNU CC.
...
...
@@ -3822,16 +3821,13 @@ ultoe (lp, y)
}
/*
; Find signed HOST_WIDE_INT integer and floating point fractional parts
; HOST_WIDE_INT i;
; unsigned EMUSHORT x[NE], frac[NE];
; xifrac (x, &i, frac);
/*
Find signed HOST_WIDE_INT integer and floating point fractional
parts of e-type (packed internal format) floating point input X.
The integer output I has the sign of the input, except that
positive overflow is permitted if FIXUNS_TRUNC_LIKE_FIX_TRUNC.
The output e-type fraction FRAC is the positive fractional
part of abs (X). */
The integer output has the sign of the input. The fraction is
the positive fractional part of abs (x).
*/
void
eifrac
(
x
,
i
,
frac
)
unsigned
EMUSHORT
*
x
;
...
...
@@ -3858,7 +3854,17 @@ eifrac (x, i, frac)
if
(
xi
[
0
])
*
i
=
((
unsigned
HOST_WIDE_INT
)
1
)
<<
(
HOST_BITS_PER_WIDE_INT
-
1
);
else
*
i
=
(((
unsigned
HOST_WIDE_INT
)
1
)
<<
(
HOST_BITS_PER_WIDE_INT
-
1
))
-
1
;
{
#ifdef FIXUNS_TRUNC_LIKE_FIX_TRUNC
/* In this case, let it overflow and convert as if unsigned. */
euifrac
(
x
,
&
ll
,
frac
);
*
i
=
(
HOST_WIDE_INT
)
ll
;
return
;
#else
/* In other cases, return the largest positive integer. */
*
i
=
(((
unsigned
HOST_WIDE_INT
)
1
)
<<
(
HOST_BITS_PER_WIDE_INT
-
1
))
-
1
;
#endif
}
eshift
(
xi
,
k
);
if
(
extra_warnings
)
warning
(
"overflow on truncation to integer"
);
...
...
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