projects
/
ieee754fpu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
special cases, sign of zero and inf matters: a.s ^ b.s
[ieee754fpu.git]
/
src
/
add
/
fmul.py
diff --git
a/src/add/fmul.py
b/src/add/fmul.py
index 1b9f461826775dd3c1b51eaa2ce0482a031d062d..1e02fa87ee31a61fe29ab79d1bd4ccfdfd8648aa 100644
(file)
--- a/
src/add/fmul.py
+++ b/
src/add/fmul.py
@@
-54,14
+54,14
@@
class FPMUL(FPBase):
#if a is inf return inf
with m.Elif(a.is_inf()):
m.next = "put_z"
#if a is inf return inf
with m.Elif(a.is_inf()):
m.next = "put_z"
- m.d.sync += z.inf(
0
)
+ m.d.sync += z.inf(
a.s ^ b.s
)
#if b is zero return NaN
with m.If(b.is_zero()):
m.d.sync += z.nan(1)
#if b is inf return inf
with m.Elif(b.is_inf()):
m.next = "put_z"
#if b is zero return NaN
with m.If(b.is_zero()):
m.d.sync += z.nan(1)
#if b is inf return inf
with m.Elif(b.is_inf()):
m.next = "put_z"
- m.d.sync += z.inf(
0
)
+ m.d.sync += z.inf(
a.s ^ b.s
)
#if a is zero return NaN
with m.If(a.is_zero()):
m.next = "put_z"
#if a is zero return NaN
with m.If(a.is_zero()):
m.next = "put_z"
@@
-69,11
+69,11
@@
class FPMUL(FPBase):
#if a is zero return zero
with m.Elif(a.is_zero()):
m.next = "put_z"
#if a is zero return zero
with m.Elif(a.is_zero()):
m.next = "put_z"
- m.d.sync += z.zero(
0
)
+ m.d.sync += z.zero(
a.s ^ b.s
)
#if b is zero return zero
with m.Elif(b.is_zero()):
m.next = "put_z"
#if b is zero return zero
with m.Elif(b.is_zero()):
m.next = "put_z"
- m.d.sync += z.zero(
0
)
+ m.d.sync += z.zero(
a.s ^ b.s
)
# Denormalised Number checks
with m.Else():
m.next = "normalise_a"
# Denormalised Number checks
with m.Else():
m.next = "normalise_a"