@@ -2272,11 +2272,11 @@ seq\_cst total orderings of other operations that are not marked
2272
2272
Fast-Math Flags
2273
2273
---------------
2274
2274
2275
- LLVM IR floating-point binary ops (:ref:`fadd <i_fadd>`,
2275
+ LLVM IR floating-point operations (:ref:`fadd <i_fadd>`,
2276
2276
:ref:`fsub <i_fsub>`, :ref:`fmul <i_fmul>`, :ref:`fdiv <i_fdiv>`,
2277
2277
:ref:`frem <i_frem>`, :ref:`fcmp <i_fcmp>`) and :ref:`call <i_call>`
2278
- instructions have the following flags that can be set to enable
2279
- otherwise unsafe floating point transformations.
2278
+ may use the following flags to enable otherwise unsafe
2279
+ floating- point transformations.
2280
2280
2281
2281
``nnan``
2282
2282
No NaNs - Allow optimizations to assume the arguments and result are not
@@ -2300,10 +2300,17 @@ otherwise unsafe floating point transformations.
2300
2300
Allow floating-point contraction (e.g. fusing a multiply followed by an
2301
2301
addition into a fused multiply-and-add).
2302
2302
2303
+ ``afn``
2304
+ Approximate functions - Allow substitution of approximate calculations for
2305
+ functions (sin, log, sqrt, etc). See floating-point intrinsic definitions
2306
+ for places where this can apply to LLVM's intrinsic math functions.
2307
+
2308
+ ``reassoc``
2309
+ Allow reassociation transformations for floating-point instructions.
2310
+ This may dramatically change results in floating point.
2311
+
2303
2312
``fast``
2304
- Fast - Allow algebraically equivalent transformations that may
2305
- dramatically change results in floating point (e.g. reassociate). This
2306
- flag implies all the others.
2313
+ This flag implies all of the others.
2307
2314
2308
2315
.. _uselistorder:
2309
2316
@@ -10483,7 +10490,7 @@ Syntax:
10483
10490
"""""""
10484
10491
10485
10492
This is an overloaded intrinsic. You can use ``llvm.sqrt`` on any
10486
- floating point or vector of floating point type. Not all targets support
10493
+ floating- point or vector of floating- point type. Not all targets support
10487
10494
all types however.
10488
10495
10489
10496
::
@@ -10497,20 +10504,22 @@ all types however.
10497
10504
Overview:
10498
10505
"""""""""
10499
10506
10500
- The '``llvm.sqrt``' intrinsics return the square root of the specified value,
10501
- returning the same value as the libm '``sqrt``' functions would, but without
10502
- trapping or setting ``errno``.
10507
+ The '``llvm.sqrt``' intrinsics return the square root of the specified value.
10503
10508
10504
10509
Arguments:
10505
10510
""""""""""
10506
10511
10507
- The argument and return value are floating point numbers of the same type.
10512
+ The argument and return value are floating- point numbers of the same type.
10508
10513
10509
10514
Semantics:
10510
10515
""""""""""
10511
10516
10512
- This function returns the square root of the operand if it is a nonnegative
10513
- floating point number.
10517
+ Return the same value as a corresponding libm '``sqrt``' function but without
10518
+ trapping or setting ``errno``. For types specified by IEEE-754, the result
10519
+ matches a conforming libm implementation.
10520
+
10521
+ When specified with the fast-math-flag 'afn', the result may be approximated
10522
+ using a less accurate calculation.
10514
10523
10515
10524
'``llvm.powi.*``' Intrinsic
10516
10525
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10557,7 +10566,7 @@ Syntax:
10557
10566
"""""""
10558
10567
10559
10568
This is an overloaded intrinsic. You can use ``llvm.sin`` on any
10560
- floating point or vector of floating point type. Not all targets support
10569
+ floating- point or vector of floating- point type. Not all targets support
10561
10570
all types however.
10562
10571
10563
10572
::
@@ -10576,14 +10585,16 @@ The '``llvm.sin.*``' intrinsics return the sine of the operand.
10576
10585
Arguments:
10577
10586
""""""""""
10578
10587
10579
- The argument and return value are floating point numbers of the same type.
10588
+ The argument and return value are floating- point numbers of the same type.
10580
10589
10581
10590
Semantics:
10582
10591
""""""""""
10583
10592
10584
- This function returns the sine of the specified operand, returning the
10585
- same values as the libm ``sin`` functions would, and handles error
10586
- conditions in the same way.
10593
+ Return the same value as a corresponding libm '``sin``' function but without
10594
+ trapping or setting ``errno``.
10595
+
10596
+ When specified with the fast-math-flag 'afn', the result may be approximated
10597
+ using a less accurate calculation.
10587
10598
10588
10599
'``llvm.cos.*``' Intrinsic
10589
10600
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10592,7 +10603,7 @@ Syntax:
10592
10603
"""""""
10593
10604
10594
10605
This is an overloaded intrinsic. You can use ``llvm.cos`` on any
10595
- floating point or vector of floating point type. Not all targets support
10606
+ floating- point or vector of floating- point type. Not all targets support
10596
10607
all types however.
10597
10608
10598
10609
::
@@ -10611,14 +10622,16 @@ The '``llvm.cos.*``' intrinsics return the cosine of the operand.
10611
10622
Arguments:
10612
10623
""""""""""
10613
10624
10614
- The argument and return value are floating point numbers of the same type.
10625
+ The argument and return value are floating- point numbers of the same type.
10615
10626
10616
10627
Semantics:
10617
10628
""""""""""
10618
10629
10619
- This function returns the cosine of the specified operand, returning the
10620
- same values as the libm ``cos`` functions would, and handles error
10621
- conditions in the same way.
10630
+ Return the same value as a corresponding libm '``cos``' function but without
10631
+ trapping or setting ``errno``.
10632
+
10633
+ When specified with the fast-math-flag 'afn', the result may be approximated
10634
+ using a less accurate calculation.
10622
10635
10623
10636
'``llvm.pow.*``' Intrinsic
10624
10637
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10627,7 +10640,7 @@ Syntax:
10627
10640
"""""""
10628
10641
10629
10642
This is an overloaded intrinsic. You can use ``llvm.pow`` on any
10630
- floating point or vector of floating point type. Not all targets support
10643
+ floating- point or vector of floating- point type. Not all targets support
10631
10644
all types however.
10632
10645
10633
10646
::
@@ -10647,15 +10660,16 @@ specified (positive or negative) power.
10647
10660
Arguments:
10648
10661
""""""""""
10649
10662
10650
- The second argument is a floating point power, and the first is a value
10651
- to raise to that power.
10663
+ The arguments and return value are floating-point numbers of the same type.
10652
10664
10653
10665
Semantics:
10654
10666
""""""""""
10655
10667
10656
- This function returns the first value raised to the second power,
10657
- returning the same values as the libm ``pow`` functions would, and
10658
- handles error conditions in the same way.
10668
+ Return the same value as a corresponding libm '``pow``' function but without
10669
+ trapping or setting ``errno``.
10670
+
10671
+ When specified with the fast-math-flag 'afn', the result may be approximated
10672
+ using a less accurate calculation.
10659
10673
10660
10674
'``llvm.exp.*``' Intrinsic
10661
10675
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10664,7 +10678,7 @@ Syntax:
10664
10678
"""""""
10665
10679
10666
10680
This is an overloaded intrinsic. You can use ``llvm.exp`` on any
10667
- floating point or vector of floating point type. Not all targets support
10681
+ floating- point or vector of floating- point type. Not all targets support
10668
10682
all types however.
10669
10683
10670
10684
::
@@ -10684,13 +10698,16 @@ value.
10684
10698
Arguments:
10685
10699
""""""""""
10686
10700
10687
- The argument and return value are floating point numbers of the same type.
10701
+ The argument and return value are floating- point numbers of the same type.
10688
10702
10689
10703
Semantics:
10690
10704
""""""""""
10691
10705
10692
- This function returns the same values as the libm ``exp`` functions
10693
- would, and handles error conditions in the same way.
10706
+ Return the same value as a corresponding libm '``exp``' function but without
10707
+ trapping or setting ``errno``.
10708
+
10709
+ When specified with the fast-math-flag 'afn', the result may be approximated
10710
+ using a less accurate calculation.
10694
10711
10695
10712
'``llvm.exp2.*``' Intrinsic
10696
10713
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10699,7 +10716,7 @@ Syntax:
10699
10716
"""""""
10700
10717
10701
10718
This is an overloaded intrinsic. You can use ``llvm.exp2`` on any
10702
- floating point or vector of floating point type. Not all targets support
10719
+ floating- point or vector of floating- point type. Not all targets support
10703
10720
all types however.
10704
10721
10705
10722
::
@@ -10719,13 +10736,16 @@ specified value.
10719
10736
Arguments:
10720
10737
""""""""""
10721
10738
10722
- The argument and return value are floating point numbers of the same type.
10739
+ The argument and return value are floating- point numbers of the same type.
10723
10740
10724
10741
Semantics:
10725
10742
""""""""""
10726
10743
10727
- This function returns the same values as the libm ``exp2`` functions
10728
- would, and handles error conditions in the same way.
10744
+ Return the same value as a corresponding libm '``exp2``' function but without
10745
+ trapping or setting ``errno``.
10746
+
10747
+ When specified with the fast-math-flag 'afn', the result may be approximated
10748
+ using a less accurate calculation.
10729
10749
10730
10750
'``llvm.log.*``' Intrinsic
10731
10751
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10734,7 +10754,7 @@ Syntax:
10734
10754
"""""""
10735
10755
10736
10756
This is an overloaded intrinsic. You can use ``llvm.log`` on any
10737
- floating point or vector of floating point type. Not all targets support
10757
+ floating- point or vector of floating- point type. Not all targets support
10738
10758
all types however.
10739
10759
10740
10760
::
@@ -10754,13 +10774,16 @@ value.
10754
10774
Arguments:
10755
10775
""""""""""
10756
10776
10757
- The argument and return value are floating point numbers of the same type.
10777
+ The argument and return value are floating- point numbers of the same type.
10758
10778
10759
10779
Semantics:
10760
10780
""""""""""
10761
10781
10762
- This function returns the same values as the libm ``log`` functions
10763
- would, and handles error conditions in the same way.
10782
+ Return the same value as a corresponding libm '``log``' function but without
10783
+ trapping or setting ``errno``.
10784
+
10785
+ When specified with the fast-math-flag 'afn', the result may be approximated
10786
+ using a less accurate calculation.
10764
10787
10765
10788
'``llvm.log10.*``' Intrinsic
10766
10789
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10769,7 +10792,7 @@ Syntax:
10769
10792
"""""""
10770
10793
10771
10794
This is an overloaded intrinsic. You can use ``llvm.log10`` on any
10772
- floating point or vector of floating point type. Not all targets support
10795
+ floating- point or vector of floating- point type. Not all targets support
10773
10796
all types however.
10774
10797
10775
10798
::
@@ -10789,13 +10812,16 @@ specified value.
10789
10812
Arguments:
10790
10813
""""""""""
10791
10814
10792
- The argument and return value are floating point numbers of the same type.
10815
+ The argument and return value are floating- point numbers of the same type.
10793
10816
10794
10817
Semantics:
10795
10818
""""""""""
10796
10819
10797
- This function returns the same values as the libm ``log10`` functions
10798
- would, and handles error conditions in the same way.
10820
+ Return the same value as a corresponding libm '``log10``' function but without
10821
+ trapping or setting ``errno``.
10822
+
10823
+ When specified with the fast-math-flag 'afn', the result may be approximated
10824
+ using a less accurate calculation.
10799
10825
10800
10826
'``llvm.log2.*``' Intrinsic
10801
10827
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10804,7 +10830,7 @@ Syntax:
10804
10830
"""""""
10805
10831
10806
10832
This is an overloaded intrinsic. You can use ``llvm.log2`` on any
10807
- floating point or vector of floating point type. Not all targets support
10833
+ floating- point or vector of floating- point type. Not all targets support
10808
10834
all types however.
10809
10835
10810
10836
::
@@ -10824,13 +10850,16 @@ value.
10824
10850
Arguments:
10825
10851
""""""""""
10826
10852
10827
- The argument and return value are floating point numbers of the same type.
10853
+ The argument and return value are floating- point numbers of the same type.
10828
10854
10829
10855
Semantics:
10830
10856
""""""""""
10831
10857
10832
- This function returns the same values as the libm ``log2`` functions
10833
- would, and handles error conditions in the same way.
10858
+ Return the same value as a corresponding libm '``log2``' function but without
10859
+ trapping or setting ``errno``.
10860
+
10861
+ When specified with the fast-math-flag 'afn', the result may be approximated
10862
+ using a less accurate calculation.
10834
10863
10835
10864
'``llvm.fma.*``' Intrinsic
10836
10865
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10839,7 +10868,7 @@ Syntax:
10839
10868
"""""""
10840
10869
10841
10870
This is an overloaded intrinsic. You can use ``llvm.fma`` on any
10842
- floating point or vector of floating point type. Not all targets support
10871
+ floating- point or vector of floating- point type. Not all targets support
10843
10872
all types however.
10844
10873
10845
10874
::
@@ -10853,20 +10882,21 @@ all types however.
10853
10882
Overview:
10854
10883
"""""""""
10855
10884
10856
- The '``llvm.fma.*``' intrinsics perform the fused multiply-add
10857
- operation.
10885
+ The '``llvm.fma.*``' intrinsics perform the fused multiply-add operation.
10858
10886
10859
10887
Arguments:
10860
10888
""""""""""
10861
10889
10862
- The argument and return value are floating point numbers of the same
10863
- type.
10890
+ The arguments and return value are floating-point numbers of the same type.
10864
10891
10865
10892
Semantics:
10866
10893
""""""""""
10867
10894
10868
- This function returns the same values as the libm ``fma`` functions
10869
- would, and does not set errno.
10895
+ Return the same value as a corresponding libm '``fma``' function but without
10896
+ trapping or setting ``errno``.
10897
+
10898
+ When specified with the fast-math-flag 'afn', the result may be approximated
10899
+ using a less accurate calculation.
10870
10900
10871
10901
'``llvm.fabs.*``' Intrinsic
10872
10902
^^^^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments