return ((x & 0x7ff0000000000000) >> 52) - 1023
def set_exponent(x, e):
- return (x & ~0x7ff0000000000000) | ((e+1023) << 23)
+ return (x & ~0x7ff0000000000000) | ((e+1023) << 52)
def get_sign(x):
return ((x & 0x8000000000000000) >> 63)
--- /dev/null
+def regressions():
+ yield 0xff80000000000000, 0x7f80000000000000
+ yield 0x3351099a0528e138, 0xd651a9a9986af2b5
+ #yield 0x80000003ff800000, 0x4f0365445543ae3f
+ #yield 0x0004e1b1e94ef100, 0x42e1b4e00b65f134
+ #yield 0x80000003ff800000, 0xd249a98a4b9a6950
+
--- /dev/null
+""" test of FPMULMuxInOut
+"""
+
+from ieee754.fpmul.pipeline import (FPMULMuxInOut,)
+from ieee754.fpcommon.test.case_gen import run_pipe_fp
+from ieee754.fpcommon.test import unit_test_double
+from ieee754.fpmul.test.mul_data64 import regressions
+
+from sfpy import Float64
+from operator import mul
+
+
+def test_pipe_fp64():
+ dut = FPMULMuxInOut(64, 4)
+ run_pipe_fp(dut, 64, "mul", unit_test_double, Float64,
+ regressions, mul, 10)
+
+
+if __name__ == '__main__':
+ test_pipe_fp64()