-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
executable file
·3776 lines (3305 loc) · 160 KB
/
README
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
==================================================================
======= Intel(R) Decimal Floating-Point Math Library v2.2 ========
==================================================================
June 8, 2018
******************************************************************
*** To report issues, please send email to decimalfp@intel.com ***
******************************************************************
Release History:
================
Jul 2009 - Version 1.0 - implemented all the mandatory functions
from the IEEE Standard 754-2008
Jun 2011 - Version 2.0 - implemented also the functions
recommended in the ISO/IEC Technical Report 24732,
'Extension for the programming language C to support
decimal floating-point arithmetic'
Aug 2011 - Version 2.0 Update 1 - fixed a small issue in fma128
Jun 2018 - Version 2.0 Update 2 - fixed issues in powd64,
acos64, and acos128. Added the llround, llquantexp,
and quantum functions, as well as corresponding new tests.
This version has been tested in Linux, Windows, OSX, and Solaris.
1. INTRODUCTION
===============
This package contains the release 2.0 Update 2(or V2.2) of the Intel(R) Decimal
Floating-Point Math Library, conforming to the IEEE Standard 754-2008 for
Floating-Point Arithmetic. This is an extension of Release 2.0 Update 1 (or V2.1) of 2011.
The library implements the functions defined for decimal floating-point
arithmetic operations in the IEEE Standard 754-2008 for Floating-Point
Arithmetic, which is a revision of the IEEE Standard 754-1985 for Binary
Floating-Point Arithmetic.
The IEEE Standard 754-2008 for Floating-Point Arithmetic supports two
encoding formats: the decimal encoding format, and the binary encoding format.
The Intel(R) Decimal Floating-Point Math Library supports primarily the binary
encoding format for decimal floating-point values, but the decimal encoding
format is supported too in the library, by means of conversion functions
between the two encoding formats.
Release 2.2 of the library contained in this package implements all
the operations mandated by the IEEE Standard 754-2008. Alternate exception
handling (not a mandatory feature) is not supported currently in the library,
but the design facilitates adding it in the future. It is worth noting that
several useful functions (not part of the IEEE 754-2008 definition) are
provided in LIBRARY/src/bid_round.c. They can be used to round a q-digit decimal
integer number represented in binary to q - x digits (1 <= x <= q - 1).
For operations involving integer operands or results, the library supports
signed and unsigned 8-, 16-, 32-, and 64-bit integers.
Note: Release 2.0 added transcendental functions (supported in 128-bit, 64-bit,
and 32-bit decimal formats), including the ones specified in the technical
report on decimal arithmetic ISO/IEC TR 24732 (available from www.iso.org).
These functions are not correctly rounded, a fact that should be considered
when using them (similary, binary floating-point mathematical functions
implemented for example in C or other compiler math libraries are in general
not correctly rounded either).
2. PACKAGE CONTENTS
===================
This package contains:
- eula.txt, a copy of the end user license agreement that applies to
everything in this package
- this README FILE
- the LIBRARY subdirectory with all the source files necessary to build the
library, and a README file which specifies how to build the library
in Linux**, HP-UX**, Windows***, and other operating systems; a small set
of command files (RUNLINUX, RUNWINDOWS, etc.) can be used to build the
library with different options
- the TESTS subdirectory with source and input files necessary to build and
run a reduced set of tests for the library, and a README
file which specifies how to build and run these tests;
the test program will print the number of errors detected;
note that tests involving 80-bit binary floating-point values (these are
only conversions to and from decimal floating-point formats) are skipped
if the 80-bit floating-point data type is not supported; a small set
of command files (RUNLINUX, RUNWINDOWS, etc.) can be used to build and
run the tests with different options
- the EXAMPLES subdirectory containing eight examples of calls to library
functions with various combinations of build options (see Section 8
below); a README file is included; a small set of command files (RUNLINUX,
RUNWINDOWS, etc.) can be used to build and run the examples with different
options
3. FUNCTION NAMES
=================
The function names used in the library are not identical to the names from
the IEEE Standard 754-2008 for Floating-Point Arithmetic. The mapping between
the two sets is given in Section 10 below. The function names can be changed
by editing the #define statements at the beginning of bid_conf.h.
4. LIBRARY BUILD OPTIONS
========================
The API for the library functions is intended to support constant modes,
global dynamic modes, and scoped dynamic modes. It should be convenient for
compilers with various requirements, even where default modes and no flag
tests can be assumed, as in C99 FENV_ACCESS OFF.
Three build options are provided, that can be set by editing
LIBRARY/src/bid_conf.h, or (more conveniently) can be set on the compile
command line.
(a) Function arguments and return values can be passed by reference if
DECIMAL_CALL_BY_REFERENCE is set to 1, or by value otherwise. However, the
floating-point status flags argument is passed by reference even when
DECIMAL_CALL_BY_REFERENCE is 0, unless it is stored in a global variable
(see (c) below).
(b) The value of the rounding mode can be passed by reference or by value,
or it can be stored in a global variable if DECIMAL_GLOBAL_ROUNDING is
set to 1.
If DECIMAL_GLOBAL_ROUNDING is set to 1 then the rounding mode is stored
in a global variable that must be declared as
_IDEC_round __bid_IDEC_glbround;
In this case __bid_IDEC_glbround is a fixed name that *must* be used (but
it can be changed by editing the corresponding #define in bid_conf.h). Its
initial value should be ROUNDING_TO_NEAREST (or an equivalent value with a name
chosen by the user, as shown in code samples from EXAMPLES where
_IDEC_nearesteven is used). The _IDEC_round type name can be different
(but equivalent), chosen by the user.
(c) The value of the exception status flags is passed by reference if
they are not represented by a global variable, or it can be stored in a
global variable if DECIMAL_GLOBAL_EXCEPTION_FLAGS is set to 1.
If DECIMAL_GLOBAL_EXCEPTION_FLAGS is set to 1 then the exception status
flags are stored in a global variable that must be declared as
_IDEC_flags __bid_IDEC_glbflags;
In this case __bid_IDEC_glbflags is a fixed name that *must* be used but
it can be changed by editing the corresponding #define in bid_conf.h). Its
initial value should be EXACT_STATUS (or an equivalent value with a name chosen
by the user, as shown in code samples from EXAMPLES where _IDEC_allflagsclear
is used). The _IDEC_flags type name can be different (but equivalent),
chosen by the user.
The three build options supported in this release are selected on the
'make' command line when building the library in LIBRARY and the tests in
TESTS using the makefile-s provided here (so editing bid_conf.h is not
necessary). For example when using the Intel(R) C++ Compiler in Linux**:
make CC=icc CALL_BY_REF=0 GLOBAL_RND=0 GLOBAL_FLAGS=0 UNCHANGED_BINARY_FLAGS=0
selects parameter passing by value; the rounding mode is a parameter
passed to each function that requires it; the status flags are passed
as a parameter to functions that may modify them (note however that the
status flags represent an exception in that the CALL_BY_REF setting
is ignored - if not global, they are always passed by reference); the
decimal operations may change the inexact binary status flag.
Another example, when using the Intel(R) C++ Compiler in Windows*** is:
nmake -fmakefile.mak CC=icl CALL_BY_REF=1 GLOBAL_RND=1 GLOBAL_FLAGS=1 UNCHANGED_BINARY_FLAGS=1
where parameters are passed by reference; the rounding mode is a global
variable; the status flags are stored in a global variable; the
decimal operations will not change the inexact binary status flag.
5. FUNCTION PROTOTYPES
======================
Function prototypes are provided in LIBRARY/src/bid_functions.h (starting at
line 396 if parameters are passed by reference, and at line 2994 if they
are passed by value).
6. TESTING
==========
The library was tested on several different platforms (IA-32 Architecture,
Intel(R) 64, and IA-64 Architecture running Linux**, Windows***, HP-UX**,
Solaris**, and OSX**). For example in Linux** icc (Intel(R) C++ Compiler 9.1
or newer) and gcc** were used. In Windows*** icl (Intel(R) C++ Compiler 9.1
or newer) and cl (Microsoft*** Visual C++ Compiler) were used. For each of
these combinations eight combinations of parameter passing method and global
or local rounding mode and status flags were tested.
In limited situations, it is possible for incorrect compiler behavior to
lead to incorrect results in the Intel(r) Decimal Floating-Point Math Library.
For example, results of round-to-integer functions are incorrect when the
library is built using gcc 4.2/4.3. Also, some gcc versions in an IA-32
Linux environment cause slightly incorrect results in a few corner cases for
the 64-bit decimal square root. (This is not an exhaustive list.) Such errors
should be caught by the tests provided with the library.
7. USAGE EXAMPLES
=================
Eight usage examples are given in the EXAMPLES subdirectory, which illustrate
calls to library functions with various combinations of build options (see
Section 4 above). A README file is included. Note that these examples do not
use any include files from the library: the necessary data types are defined
instead directly in the user-defined decimal.h. However, if the rounding mode
or exception status flags are stored in global variables, then these must have
the fixed names of _IDEC_glbround and _IDEC_glbflags.
Alternatively - and this is the preferred method, one could use the data
types defined in the library by including two header files (and in this case
DECIMAL_CALL_BY_REFERENCE, DECIMAL_GLOBAL_ROUNDING, and
DECIMAL_GLOBAL_EXCEPTION_FLAGS would have to be properly defined not only when
building the library, but also for the application calling the library
functions):
#include "../LIBRARY/src/bid_conf.h"
#include "../LIBRARY/src/bid_functions.h"
Such an example is represented by the readtest program in TESTS/readtest.c.
8. DECIMAL AND BINARY STATUS FLAGS
==================================
The IEEE Standard 754-2008 specifies distinct rounding modes for binary
and for decimal floating-point operations. However, the floating-point status
flags may be identical for decimal and binary computations. In this
implementation of the decimal arithmetic, the decimal floating-point status
flags are kept separate from the binary flags. Still, it is possible to merge
the two sets (outside the library).
One issue that needs to be pointed out is that the current implementation of
the decimal floating-point library may set the binary inexact status flag for
certain operations: division, square root, and several other operations where
integers are converted to floating-point values, and the conversion
is inexact. In order to avoid setting the binary inexact flag by decimal
functions, uncomment the following line in bid_conf.h
prior to building the library:
// #define UNCHANGED_BINARY_STATUS_FLAGS
9. MAPPING OF IEEE 754-2008 NAMES TO INTEL (R) DECIMAL FLOATING-POINT MATH
LIBRARY FUNCTION NAMES
=========================================================================
Operand and result types are included, where:
BID64 = the 64-bit decimal floating-point format using the binary
encoding; this becomes BID_UINT64 in the library
BID128 = the 128-bit decimal floating-point format using the binary
encoding ; this becomes BID_UINT128 in the library
binary32 = 32-bit binary floating-point data format
binary64 = 64-bit binary floating-point data format
binary80 = 80-bit binary floating-point data format
binary128 = 128-bit binary floating-point data format
string = char *
boolean = int
enum = int
_IDEC_flags = int
_IDEC_round = int
The library function names shown here can be changed by editing #define
statements in bid_conf.h.
================================================================================
IEEE 754-2008 Name Opd1 Opd2 Opd3 Result
Intel(R) DFP Math Library Name
================================================================================
roundToIntegralTiesToEven BID64 BID64
__bid64_round_integral_nearest_even
BID128 BID128
__bid128_round_integral_nearest_even
roundToIntegralTiesToAway BID64 BID64
__bid64_round_integral_nearest_away
BID128 BID128
__bid128_round_integral_nearest_away
roundToIntegralTiesTowardZero BID64 BID64
__bid64_round_integral_zero
BID128 BID128
__bid128_round_integral_zero
roundToIntegralTiesTowardPositive BID64 BID64
__bid64_round_integral_positive
BID128 BID128
__bid128_round_integral_positive
roundToIntegralTiesTowardNegative BID64 BID64
__bid64_round_integral_negative
BID128 BID128
__bid128_round_integral_negative
roundToIntegralExact BID64 BID64
__bid64_round_integral_exact
BID128 BID128
__bid128_round_integral_exact
nextUp BID64 BID64
__bid64_nextup
BID128 BID128
__bid128_nextup
nextDown BID64 BID64
__bid64_nextdown
BID128 BID128
__bid128_nextdown
N/A BID64 BID64 BID64
__bid64_nextafter
BID128 BID128 BID128
__bid128_nextafter
remainder BID64 BID64 BID64
__bid64_rem
BID128 BID128 BID128
__bid128_rem
minNum BID64 BID64 BID64
__bid64_minnum
BID128 BID128 BID128
__bid128_minnum
maxNum BID64 BID64 BID64
__bid64_maxnum
BID128 BID128 BID128
__bid128_maxnum
minNumMag BID64 BID64 BID64
__bid64_minnum_mag
BID128 BID128 BID128
__bid128_minnum_mag
maxNumMag BID64 BID64 BID64
__bid64_maxnum_mag
BID128 BID128 BID128
__bid128_maxnum_mag
quantize BID64 BID64 BID64
__bid64_quantize
BID128 BID128 BID128
__bid128_quantize
logB BID64 BID64
__bid64_ilogb
BID128 BID128
__bid128_ilogb
scaleB BID64 BID64 BID64
__bid64_scalbn
BID128 BID128 BID128
__bid128_scalbn
addition BID64 BID64 BID64
__bid64_add
BID128 BID128 BID128
__bid128_add
subtraction BID64 BID64 BID64
__bid64_sub
BID128 BID128 BID128
__bid128_sub
multiplication BID64 BID64 BID64
__bid64_mul
BID128 BID128 BID128
__bid128_mul
division BID64 BID64 BID64
__bid64_div
BID128 BID128 BID128
__bid128_div
squareRoot BID64 BID64
__bid64_sqrt
BID128 BID128
__bid128_sqrt
fusedMultiplyAdd BID64 BID64 BID64 BID64
__bid64_fma
BID128 BID128 BID128 BID128
__bid128_fma
convertFromInt int32 BID64
__bid64_from_int32
uint32 BID64
__bid64_from_uint32
int64 BID64
__bid64_from_int64
uint64 BID64
__bid64_from_uint64
int32 BID128
__bid128_from_int32
uint32 BID128
__bid128_from_uint32
int64 BID128
__bid128_from_int64
uint64 BID128
__bid128_from_uint64
convertToIntegerTiesToEven BID64 int32
__bid64_to_int32_rnint
BID64 uint32
__bid64_to_uint32_rnint
BID64 int64
__bid64_to_int64_rnint
BID64 uint64
__bid64_to_uint64_rnint
BID128 int32
__bid128_to_int32_rnint
BID128 uint32
__bid128_to_uint32_rnint
BID128 int64
__bid128_to_int64_rnint
BID128 uint64
__bid128_to_uint64_rnint
convertToIntegerTowardZero BID64 int32
__bid64_to_int32_int
BID64 uint32
__bid64_to_uint32_int
BID64 int64
__bid64_to_int64_int
BID64 uint64
__bid64_to_uint64_int
BID128 int32
__bid128_to_int32_int
BID128 uint32
__bid128_to_uint32_int
BID128 int64
__bid128_to_int64_int
BID128 uint64
__bid128_to_uint64_int
convertToIntegerTowardPositive BID64 int32
__bid64_to_int32_ceil
BID64 uint32
__bid64_to_uint32_ceil
BID64 int64
__bid64_to_int64_ceil
BID64 uint64
__bid64_to_uint64_ceil
BID128 int32
__bid128_to_int32_ceil
BID128 uint32
__bid128_to_uint32_ceil
BID128 int64
__bid128_to_int64_ceil
BID128 uint64
__bid128_to_uint64_ceil
convertToIntegerTowardNegative BID64 int32
__bid64_to_int32_floor
BID64 int32
__bid64_to_uint32_floor
BID64 int64
__bid64_to_int64_floor
BID64 uint64
__bid64_to_uint64_floor
BID128 int32
__bid128_to_int32_floor
BID128 uint32
__bid128_to_uint32_floor
BID128 int64
__bid128_to_int64_floor
BID128 uint64
__bid128_to_uint64_floor
convertToIntegerTiesToAway BID64 int32
__bid64_to_int32_rninta
BID64 uint32
__bid64_to_uint32_rninta
BID64 int64
__bid64_to_int64_rninta
BID64 uint64
__bid64_to_uint64_rninta
BID128 int32
__bid128_to_int32_rninta
BID128 uint32
__bid128_to_uint32_rninta
BID128 int64
__bid128_to_int64_rninta
BID128 uint64
__bid128_to_uint64_rninta
convertToIntegerExactTiesToEven BID64 int32
__bid64_to_int32_xrnint
BID64 uint32
__bid64_to_uint32_xrnint
BID64 int64
__bid64_to_int64_xrnint
BID64 uint64
__bid64_to_uint64_xrnint
BID128 int32
__bid128_to_int32_xrnint
BID128 uint32
__bid128_to_uint32_xrnint
BID128 int64
__bid128_to_int64_xrnint
BID128 uint64
__bid128_to_uint64_xrnint
convertToIntegerExactTowardZero BID64 int32
__bid64_to_int32_xint
BID64 uint32
__bid64_to_uint32_xint
BID64 int64
__bid64_to_int64_xint
BID64 uint64
__bid64_to_uint64_xint
BID128 int32
__bid128_to_int32_xint
BID128 uint32
__bid128_to_uint32_xint
BID128 int64
__bid128_to_int64_xint
BID128 uint64
__bid128_to_uint64_xint
convertToIntegerExactTowardPositive BID64 int32
__bid64_to_int32_xceil
BID64 uint32
__bid64_to_uint32_xceil
BID64 int64
__bid64_to_int64_xceil
BID64 uint64
__bid64_to_uint64_xceil
BID128 int32
__bid128_to_int32_xceil
BID128 uint32
__bid128_to_uint32_xceil
BID128 int64
__bid128_to_int64_xceil
BID128 uint64
__bid128_to_uint64_xceil
convertToIntegerExactTowardNegative BID64 int32
__bid64_to_int32_xfloor
BID64 uint32
__bid64_to_uint32_xfloor
BID64 int64
__bid64_to_int64_xfloor
BID64 uint64
__bid64_to_uint64_xfloor
BID128 int32
__bid128_to_int32_xfloor
BID128 uint32
__bid128_to_uint32_xfloor
BID128 int64
__bid128_to_int64_xfloor
BID128 uint64
__bid128_to_uint64_xfloor
convertToIntegerExactTiesToAway BID64 int32
__bid64_to_int32_xrninta
BID64 uint32
__bid64_to_uint32_xrninta
BID64 int64
__bid64_to_int64_rninta
BID64 uint64
__bid64_to_uint64_xrninta
BID128 int32
__bid128_to_int32_xrninta
BID128 uint32
__bid128_to_uint32_xrninta
BID128 int64
__bid128_to_int64_xrninta
BID128 uint64
__bid128_to_uint64_xrninta
convert BID32 BID64
__bid32_to_bid64
BID32 BID128
__bid32_to_bid128
BID32 bin32
__bid32_to_binary32
BID32 bin64
__bid32_to_binary64
BID32 bin80
__bid32_to_binary80
BID32 bin128
__bid32_to_binary128
BID64 BID32
__bid64_to_bid32
BID64 BID128
__bid64_to_bid128
BID64 bin32
__bid64_to_binary32
BID64 bin64
__bid64_to_binary64
BID64 bin80
__bid64_to_binary80
BID64 bin128
__bid64_to_binary128
BID128 BID32
__bid128_to_bid32
BID128 BID64
__bid128_to_bid64
BID128 bin32
__bid128_to_binary32
BID128 bin64
__bid128_to_binary64
BID128 bin80
__bid128_to_binary80
BID128 bin128
__bid128_to_binary128
bin32 BID32
__binary32_to_bid32
bin32 BID64
__binary32_to_bid64
bin32 BID128
__binary32_to_bid128
bin64 BID32
__binary64_to_bid32
bin64 BID64
__binary64_to_bid64
bin64 BID128
__binary64_to_bid128
bin80 BID32
__binary80_to_bid32
bin80 BID64
__binary80_to_bid64
bin80 BID128
__binary80_to_bid128
bin128 BID32
__binary128_to_bid32
bin128 BID64
__binary128_to_bid64
bin128 BID128
__binary128_to_bid128
convertFromDecimalCharacter string BID64
__bid64_from_string
string BID128
__bid128_from_string
convertToDecimalCharacter BID64 string
__bid64_to_string
BID128 string
__bid128_to_string
copy BID64 BID64
__bid64_copy
BID128 BID128
__bid128_copy
negate BID64 BID64
__bid64_negate
BID128 BID128
__bid128_negate
abs BID64 BID64
__bid64_abs
BID128 BID128
__bid128_abs
copySign BID64 BID64 BID64
__bid64_copySign
BID128 BID128 BID128
__bid128_copySign
encodeDecimal BID32 DPD32
__bid_to_dpd32
BID64 DPD64
__bid_to_dpd64
BID128 DPD128
__bid_to_dpd128
decodeDecimal DPD32 BID32
__bid_dpd_to_bid32
DPD64 BID64
__bid_dpd_to_bid64
DPD128 BID128
__bid_dpd_to_bid128
compareQuietEqual BID64 BID64 boolean
__bid64_quiet_equal
BID128 BID128 boolean
__bid128_quiet_equal
compareQuietGreater BID64 BID64 boolean
__bid64_quiet_greater
BID128 BID128 boolean
__bid128_quiet_greater
compareQuietGreaterEqual BID64 BID64 boolean
__bid64_quiet_greater_equal
BID128 BID128 boolean
__bid128_quiet_greater_equal
compareQuietGreaterUnordered BID64 BID64 boolean
__bid64_quiet_greater_unordered
BID128 BID128 boolean
__bid128_quiet_greater_unordered
compareQuietLess BID64 BID64 boolean
__bid64_quiet_less
BID128 BID128 boolean
__bid128_quiet_less
compareQuietLessEqual BID64 BID64 boolean
__bid64_quiet_less_equal
BID128 BID128 boolean
__bid128_quiet_less_equal
compareQuietLessUnordered BID64 BID64 boolean
__bid64_quiet_less_unordered
BID128 BID128 boolean
__bid128_quiet_less_unordered
compareQuietNotEqual BID64 BID64 boolean
__bid64_quiet_not_equal
BID128 BID128 boolean
__bid128_quiet_not_equal
compareQuietNotGreater BID64 BID64 boolean
__bid64_quiet_not_greater
BID128 BID128 boolean
__bid128_quiet_not_greater
compareQuietNotLess BID64 BID64 boolean
__bid64_quiet_not_less
BID128 BID128 boolean
__bid128_quiet_not_less
compareQuietOrdered BID64 BID64 boolean
__bid64_quiet_ordered
BID128 BID128 boolean
__bid128_quiet_ordered
compareQuietUnordered BID64 BID64 boolean
__bid64_quiet_unordered
BID128 BID128 boolean
__bid128_quiet_unordered
compareSignalingEqual BID64 BID64 boolean
__bid64_signaling_equal (not currently implemented)
BID128 BID128 boolean
__bid128_signaling_equal (not currently implemented)
compareSignalingGreater BID64 BID64 boolean
__bid64_signaling_greater
BID128 BID128 boolean
__bid128_signaling_greater
compareSignalingGreaterEqual BID64 BID64 boolean
__bid64_signaling_greater_equal
BID128 BID128 boolean
__bid128_signaling_greater_equal
compareSignalingGreaterUnordered BID64 BID64 boolean
__bid64_signaling_greater_unordered
BID128 BID128 boolean
__bid128_signaling_greater_unordered
compareSignalingLess BID64 BID64 boolean
__bid64_signaling_less
BID128 BID128 boolean
__bid128_signaling_less
compareSignalingLessEqual BID64 BID64 boolean
__bid64_signaling_less_equal
BID128 BID128 boolean
__bid128_signaling_less_equal
compareSignalingLessUnordered BID64 BID64 boolean
__bid64_signaling_less_unordered
BID128 BID128 boolean
__bid128_signaling_less_unordered
compareSignalingNotEqual BID64 BID64 boolean
__bid64_signaling_not_equal (not currently implemented)
BID128 BID128 boolean
__bid128_signaling_not_equal (not currently implemented)
compareSignalingNotGreater BID64 BID64 boolean
__bid64_signaling_not_greater
BID128 BID128 boolean
__bid128_signaling_not_greater
compareSignalingNotLess BID64 BID64 boolean
__bid64_signaling_not_less
BID128 BID128 boolean
__bid128_signaling_not_less
N/A IDEC_flags *IDEC_flags
__bid_signalException
is754version1985 int
__bid_is754
is754version2008 int
__bid_is754R
isSignMinus BID64 boolean
__bid64_isSigned
BID128 boolean
__bid128_isSigned
isNormal BID64 boolean
__bid64_isNormal
BID128 boolean
__bid128_isNormal
isFinite BID64 boolean
__bid64_isFinite
BID128 boolean
__bid128_isFinite
isZero BID64 boolean
__bid64_isZero
BID128 boolean
__bid128_isZero
isSubnormal BID64 boolean
__bid64_isSubnormal
BID128 boolean
__bid128_isSubnormal
isInfinite BID64 boolean
__bid64_isInf
BID128 boolean
__bid128_isInf
isNaN BID64 boolean
__bid64_isNaN
BID128 boolean
__bid128_isNaN
isSignaling BID64 boolean
__bid64_isSignaling
BID128 boolean
__bid128_isSignaling
isCanonical BID64 boolean
__bid64_isCanonical
BID128 boolean
__bid128_isCanonical
radix BID64 boolean
__bid64_radix
BID128 boolean
__bid128_radix
class BID64 enum
__bid64_class
BID128 enum
__bid128_class
totalOrder BID64 BID64 boolean
__bid64_totalOrder
BID128 BID128 boolean
__bid128_totalOrder
totalOrderMag BID64 BID64 boolean
__bid64_totalOrderMag
BID128 BID128 boolean
__bid128_totalOrderMag
sameQuantum BID64 BID64 boolean
__bid64_sameQuantum
BID128 BID128 boolean
__bid128_sameQuantum
lowerFlags _IDEC_flags
__bid_lowerFlags
testFlags _IDEC_flags boolean
__bid_testFlags
testSavedFlags _IDEC_flags _IDEC_flags boolean
__bid_testSavedFlags
restoreFlags _IDEC_flags _IDEC_flags
__bid_restoreFlags
saveAllFlags _IDEC_flags IDEC_flags
__bid_saveFlags
getDecimalRoundingDirection _IDEC_round
__bid_getDecimalRoundingDirection
setDecimalRoundingDirection _IDEC_round
__bid_setDecimalRoundingDirection
10. DESCRIPTION OF THE INTEL(R) DECIMAL FP MATH LIBRARY FUNCTIONS
This section gives brief descriptions of the functions available in the
Intel(R) Decimal Floating-Point Math Library v2.2. The prototypes are
shown assuming all arguments are passed by value; the rounding mode variable is
passed as an argument to each function that requires it; a pointer to a
variable containing the status flags is passed to each function that requires
it; alternate exception handling is not supported. The function prototypes
for other variants allowed for building the library can be determined from
header files bid_functions.h and bid_conf.h, which contain also all the type
definitions used in the following description, as well as the possible values of
the rounding mode variable rnd_mode and the positions of the individual status
flags in the status word *pfpsf.
Notes:
1. Three decimal floating-point formats are supported, as defined in
IEEE Standard 754-2008: 32-bit, 64-bit, and 128-bit.
The data types used in the library for entities in the three formats are
UINT32, UINT64, and UINT128 which can be mapped externally to types of
appropriate sizes and alignments but having different names, for example
_Decimal32, _Decimal64, and _Decimal128.
The maximum number of decimal digits in the significand of numerical
values represented in these three formats are:
P = 7 decimal digits for the 32-bit decimal floating-point format
P = 16 decimal digits for the 64-bit decimal floating-point format
P = 34 decimal digits for the 128-bit decimal floating-point format
The ranges for normal decimal floating-point numbers are (in magnitude):
1.000000 * 10^(-95) <= x <= 9.999999 * 10^96 for 32-bit format
1.0...0 * 10^(-383) <= x <= 9.9...9 * 10^384 for 64-bit format
(15 decimal digits in the fractional part of the significand)
1.0...0 * 10^(-6143) <= x <= 9.9...9 * 10^6144 for 128-bit format
(33 decimal digits in the fractional part of the significand)
The ranges for subnormal decimal floating-point numbers are (in magnitude):
0.000001 * 10^(-95) <= x <= 0.999999 * 10^(-95) for 32-bit format
0.0...01 * 10^(-383) <= x <= 0.9...9 * 10^(-383) for 64-bit format
(15 decimal digits in the fractional part of the significand)
0.0...01 * 10^(-6144) <= x <= 0.9...9 * 10^(-6144) for 128-bit format
(33 decimal digits in the fractional part of the significand)
Operations with decimal floating-point results usually choose one
representation of the result from among several possible that have the
same numerical value (constituting a 'cohort'). The chosen representation
must have the 'preferred exponent' specified in the IEEE Standard 754-2008.
(For example 1.0 * 10^(-2) + 10.0 * 10^(-3) = 20.0 * 10^(-3), and not
2.0 * 10^(-2).)
The encoding methods for decimal floating-point values are not explained
here. Decimal floating-point values can be encoded using the
string-to-decimal conversion functions (__bid64_from_string and
__bid128_from_string), or decoded using the decimal-to-string conversion
functions (__bid64_to_string and __bid128_to_string).
2. The acronym 'dpd' or 'DPD' is used to identify the decimal encoding method
for decimal floating-point values, defined in the IEEE Standard 754-2008.
The acronym 'bid' or 'BID' is used to identify the binary encoding method
for decimal floating-point values, defined in the IEEE Standard 754-2008.
3. The library functions that operate on decimal floating-point values do so on
values encoded in BID format.
4. The floating-point status flags for inexact result, underflow, overflow,
division by zero and invalid operation are denoted by P, U, O, Z, I
respectively
Note that the function names can be changed by editing #define statements in
bid_conf.h.
===============================================================================
FUNCTION: Convert a 32-bit decimal floating-point value encoded in BID format to
the same value encoded in DPD format
PROTOTYPE:
UINT32 __bid_to_dpd32 (
UINT32 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Convert a 64-bit decimal floating-point value encoded in BID format to
the same value encoded in DPD format
PROTOTYPE:
UINT64 __bid_to_dpd64 (
UINT64 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Convert a 128-bit decimal floating-point value encoded in BID format
to the same value encoded in DPD format
PROTOTYPE:
UINT128 __bid_to_dpd128 (
UINT128 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Convert a 32-bit decimal floating-point value encoded in DPD format
to the same value encoded in BID format
PROTOTYPE:
UINT32 __bid_dpd_to_bid32 (
UINT32 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Convert a 64-bit decimal floating-point value encoded in DPD format
to the same value encoded in BID format
PROTOTYPE:
UINT64 __bid_dpd_to_bid64 (
UINT64 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Convert a 128-bit decimal floating-point value encoded in DPD format
to the same value encoded in BID format
PROTOTYPE:
UINT128 __bid_dpd_to_bid128 (
UINT128 px);
FLOATING-POINT EXCEPTIONS: none
FUNCTION: Decimal floating-point addition, UINT64 + UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128dd_add (
UINT64 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point addition, UINT64 + UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128dq_add (
UINT64 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point addition, UINT128 + UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128qd_add (
UINT128 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point addition, UINT128 + UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128_add (
UINT128 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point subtraction, UINT64 - UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128dd_sub (
UINT64 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point subtraction, UINT64 - UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128dq_sub (
UINT64 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point subtraction, UINT128 - UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128qd_sub (
UINT128 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point subtraction, UINT128 - UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128_sub (
UINT128 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point multiplication, UINT64 * UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128dd_mul (
UINT64 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point multiplication, UINT64 * UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128dq_mul (
UINT64 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point multiplication, UINT128 * UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128qd_mul (
UINT128 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point multiplication, UINT128 * UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128_mul (
UINT128 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point division, UINT128 / UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128_div (
UINT128 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, I
FUNCTION: Decimal floating-point division, UINT64 / UINT64 -> UINT128
PROTOTYPE:
UINT128 __bid128dd_div (
UINT64 x, UINT64 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, Z, I
FUNCTION: Decimal floating-point division, UINT64 / UINT128 -> UINT128
PROTOTYPE:
UINT128 __bid128dq_div (
UINT64 x, UINT128 y, _IDEC_round rnd_mode, _IDEC_flags *pfpsf);
FLOATING-POINT EXCEPTIONS: P, U, O, Z, I
FUNCTION: Decimal floating-point division, UINT128 / UINT64 -> UINT128