tmp <- [0]*25
tmp[1:24] <- frac[0:23]
tmp[0:24] <- tmp[0:24] + inc
- carry_out <- tmp[24]
+ carry_out <- tmp[0]
frac[0:23] <- tmp[1:24]
else # tgt_precision = 'double-precision'
tmp <- [0]*54
tmp[1:53] <- frac[0:52]
tmp[0:53] <- tmp[0:53] + inc
- carry_out <- tmp[53]
+ carry_out <- tmp[0]
frac[0:52] <- tmp[1:53]
if carry_out = 1 then exp <- exp + 1
# TODO, later
# result should be -ve zero not +ve zero
self.assertEqual(sim.fpr(3), SelectableInt(0x8000000000000000, 64))
+ def test_fp_muls5(self):
+ """>>> lst = ["fmuls 3, 1, 2",
+ ]
+ """
+ lst = ["fmuls 3, 1, 2", #
+ ]
+
+ fprs = [0] * 32
+ fprs[1] = 0xbfb0ab5100000000
+ fprs[2] = 0xbdca000000000000
+
+ with Program(lst, bigendian=False) as program:
+ sim = self.run_tst_program(program, initial_fprs=fprs)
+ self.assertEqual(sim.fpr(3), SelectableInt(0x3d8b1663a0000000, 64))
+
def test_fp_mul(self):
""">>> lst = ["fmul 3, 1, 2",
]