-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.decnumber
49 lines (34 loc) · 1.83 KB
/
README.decnumber
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Backend
=======
There are two well-known decimal libraries, the decNumber we used here, and one from Intel.
I picked decnumber because GCC picked it, more portable (not limited to Intel).
Question: How about Intel ADX? Does it help? Does decNumber generate ADX code?
See http://speleotrove.com/decimal/dpintro.html for performance comparison. Overall, decnumber
and Intel number are very close, and decimal64/128 are many times faster than an arbitrary
precision implementation. I did not compare decNumber against numeric of postgres, but I trust
both are high quality implementations and assume performance wise they are similar.
INTEL library has conversion functions for decimal64/128 from/to int32/64, float/double. This
native implementations could be much faster than the conversion we implemented -- print to
string and parse.
DecNumber Build Instructions
===============================
The backend we used to implement decimal floating point is taken from
http://speleotrove.com/decimal/. This site contains a huge collection of information on
IEEE 754 decimal floating point format and arithmatics.
After downloading, one need to build decnumber library. The following simple Makefile will do,
------------- BEGIN Makefile for decNumber ---------------
OBJS = decSingle.o decDouble.o decQuad.o decNumber.o decContext.o
CFLAGS = -Wall -g -O2 -fPIC
libdecnumber.a: $(OBJS)
ar -rcs libdecnumber.a $(OBJS)
clean:
rm -f libdecnumber.a $(OBJS)
install:
install -D *.h ../installed/include/decnumber
install -D libdecnumber.a ../installed/lib
------------- END Makefile for decNumber -----------------
Then, you need to update the Makefile of decimal, pointing include dir and libdir to the right
install path of decNumber, dance the usual make, make install, create extension dance.
INTEL BID Library
=================
NYI. Next.