rename to next_groups
[ieee754fpu.git] / README.md
1 # IEEE754 Floating-Point ALU, in nmigen
2
3 This project implements a pipelined IEEE754 floating-point ALU that
4 supports FP16, FP32 and FP64. It is a general-purpose unit that
5 may be used in any project (not limited to one specific processor).
6
7 # Requirements
8
9 * nmigen
10 * yosys (latest git repository, required by nmigen)
11 * sfpy (running unit tests). provides python bindings to berkeley softfloat-3
12
13 # Building sfpy
14
15 The standard sfpy will not work without being modified to the type of
16 IEEE754 FP emulation being tested. This FPU is emulating RISC-V, and
17 there is some weirdness in x86 IEEE754 implementations when it comes
18 to FP16 non-canonical NaNs.
19
20 The following modifications are required to the sfpy berkeley-softfloat-3
21 Makefile:
22
23 diff --git a/build/Linux-x86_64-GCC/Makefile b/build/Linux-x86_64-GCC/Makefile
24 index 2ee5dad..566d225 100644
25 --- a/build/Linux-x86_64-GCC/Makefile
26 +++ b/build/Linux-x86_64-GCC/Makefile
27 @@ -35,7 +35,7 @@
28 #=============================================================================
29
30 SOURCE_DIR ?= ../../source
31 -SPECIALIZE_TYPE ?= 8086-SSE
32 +SPECIALIZE_TYPE ?= RISCV
33
34 SOFTFLOAT_OPTS ?= \
35 -DSOFTFLOAT_ROUND_ODD -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 \
36 @@ -45,7 +45,7 @@ DELETE = rm -f
37 C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
38 COMPILE_C = \
39 gcc -c -Werror-implicit-function-declaration -DSOFTFLOAT_FAST_INT64 \
40 - $(SOFTFLOAT_OPTS) $(C_INCLUDES) -O2 -o $@
41 + $(SOFTFLOAT_OPTS) $(C_INCLUDES) -O2 -fPIC -o $@
42 MAKELIB = ar crs $@
43
44 OBJ = .o
45
46
47 The following modifications are required to the sfpy SoftPosit Makefile:
48
49 diff --git a/build/Linux-x86_64-GCC/Makefile b/build/Linux-x86_64-GCC/Makefile
50 index 7affd4b..25dd39e 100644
51 --- a/build/Linux-x86_64-GCC/Makefile
52 +++ b/build/Linux-x86_64-GCC/Makefile
53 @@ -69,7 +69,7 @@ endif
54 C_INCLUDES = -I. -I$(SOURCE_DIR)/$(SPECIALIZE_TYPE) -I$(SOURCE_DIR)/include
55 OPTIMISATION = -O2 #-march=core-avx2
56 COMPILE_C = \
57 - $(COMPILER) -c -Werror-implicit-function-declaration -DSOFTPOSIT_FAST_INT64 \
58 + $(COMPILER) -fPIC -c -Werror-implicit-function-declaration -DSOFTPOSIT_FAST_INT64 \
59 $(SOFTPOSIT_OPTS) $(C_INCLUDES) $(OPTIMISATION) \
60 -o $@
61 MAKELIB = ar crs $@
62
63 # Useful resources
64
65 * https://en.wikipedia.org/wiki/IEEE_754-1985
66 * http://weitz.de/ieee/
67 * https://steve.hollasch.net/cgindex/coding/ieeefloat.html
68