projects
/
riscv-isa-sim.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Softfloat fcvt.{w/l}.d now returns -MaxInt for -NaN
[riscv-isa-sim.git]
/
softfloat
/
i64_to_f64.c
1
2
#include <stdbool.h>
3
#include <stdint.h>
4
#include
"platform.h"
5
#include
"internals.h"
6
#include
"softfloat.h"
7
8
float64_t
i64_to_f64
(
int_fast64_t
a
)
9
{
10
bool
sign
;
11
union
ui64_f64 uZ
;
12
13
sign
= (
a
<
0
);
14
if
( ! (
a
&
UINT64_C
(
0x7FFFFFFFFFFFFFFF
) ) ) {
15
uZ
.
ui
=
sign
?
packToF64UI
(
1
,
0x43E
,
0
) :
0
;
16
return
uZ
.
f
;
17
}
18
return
softfloat_normRoundPackToF64
(
sign
,
0x43C
,
sign
? -
a
:
a
);
19
20
}
21