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
b31c244f
Commit
b31c244f
authored
Jun 13, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ereal_from_float, ereal_from_double): New functions.
From-SVN: r4670
parent
5d5ea909
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
gcc/real.c
+64
-0
No files found.
gcc/real.c
View file @
b31c244f
...
...
@@ -4975,4 +4975,68 @@ enum machine_mode mode;
*
nan
++
=
*
p
++
;
}
/* Convert an SFmode target `float' value to a REAL_VALUE_TYPE.
This is the inverse of the function `etarsingle' invoked by
REAL_VALUE_TO_TARGET_SINGLE. */
REAL_VALUE_TYPE
ereal_from_float
(
f
)
unsigned
long
f
;
{
REAL_VALUE_TYPE
r
;
unsigned
EMUSHORT
s
[
2
];
unsigned
EMUSHORT
e
[
NE
];
/* Convert 32 bit integer to array of 16 bit pieces in target machine order.
This is the inverse operation to what the function `endian' does. */
#if WORDS_BIG_ENDIAN
s
[
0
]
=
(
unsigned
EMUSHORT
)
(
f
>>
16
);
s
[
1
]
=
(
unsigned
EMUSHORT
)
f
;
#else
s
[
0
]
=
(
unsigned
EMUSHORT
)
f
;
s
[
1
]
=
(
unsigned
EMUSHORT
)
(
f
>>
16
);
#endif
/* Convert and promote the target float to E-type. */
e24toe
(
s
,
e
);
/* Output E-type to REAL_VALUE_TYPE. */
PUT_REAL
(
e
,
&
r
);
return
r
;
}
/* Convert a DFmode target `double' value to a REAL_VALUE_TYPE.
This is the inverse of the function `etardouble' invoked by
REAL_VALUE_TO_TARGET_DOUBLE.
The DFmode is stored as an array of longs (i.e., HOST_WIDE_INTs)
with 32 bits of the value per each long. The first element
of the input array holds the bits that would come first in the
target computer's memory. */
REAL_VALUE_TYPE
ereal_from_double
(
d
)
unsigned
long
d
[];
{
REAL_VALUE_TYPE
r
;
unsigned
EMUSHORT
s
[
4
];
unsigned
EMUSHORT
e
[
NE
];
/* Convert array of 32 bit pieces to equivalent array of 16 bit pieces.
This is the inverse of `endian'. */
#if WORDS_BIG_ENDIAN
s
[
0
]
=
(
unsigned
EMUSHORT
)
(
d
[
0
]
>>
16
);
s
[
1
]
=
(
unsigned
EMUSHORT
)
d
[
0
];
s
[
2
]
=
(
unsigned
EMUSHORT
)
(
d
[
1
]
>>
16
);
s
[
3
]
=
(
unsigned
EMUSHORT
)
d
[
1
];
#else
s
[
0
]
=
(
unsigned
EMUSHORT
)
d
[
0
];
s
[
1
]
=
(
unsigned
EMUSHORT
)
(
d
[
0
]
>>
16
);
s
[
2
]
=
(
unsigned
EMUSHORT
)
d
[
1
];
s
[
3
]
=
(
unsigned
EMUSHORT
)
(
d
[
1
]
>>
16
);
#endif
/* Convert target double to E-type. */
e53toe
(
s
,
e
);
/* Output E-type to REAL_VALUE_TYPE. */
PUT_REAL
(
e
,
&
r
);
return
r
;
}
#endif
/* EMU_NON_COMPILE not defined */
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