@@ -3685,9 +3685,9 @@ Fast-Math Flags
3685
3685
3686
3686
LLVM IR floating-point operations (:ref:`fneg <i_fneg>`, :ref:`fadd <i_fadd>`,
3687
3687
:ref:`fsub <i_fsub>`, :ref:`fmul <i_fmul>`, :ref:`fdiv <i_fdiv>`,
3688
- :ref:`frem <i_frem>`, :ref:`fcmp <i_fcmp>`), :ref:`phi <i_phi>`,
3689
- :ref:`select <i_select>` and :ref:`call <i_call>`
3690
- may use the following flags to enable otherwise unsafe
3688
+ :ref:`frem <i_frem>`, :ref:`fcmp <i_fcmp>`), and :ref:`phi <i_phi>`,
3689
+ :ref:`select <i_select>`, or :ref:`call <i_call>` instructions that return
3690
+ floating-point types may use the following flags to enable otherwise unsafe
3691
3691
floating-point transformations.
3692
3692
3693
3693
``fast``
@@ -3709,6 +3709,16 @@ floating-point transformations.
3709
3709
argument or zero result as insignificant. This does not imply that -0.0
3710
3710
is poison and/or guaranteed to not exist in the operation.
3711
3711
3712
+ .. _fastmath_return_types:
3713
+
3714
+ Note: For :ref:`phi <i_phi>`, :ref:`select <i_select>`, and :ref:`call <i_call>`
3715
+ instructions, the following return types are considered to be floating-point
3716
+ types:
3717
+
3718
+ - Floating-point scalar or vector types
3719
+ - Array types (nested to any depth) of floating-point scalar or vector types
3720
+ - Homogeneous literal struct types of floating-point scalar or vector types
3721
+
3712
3722
Rewrite-based flags
3713
3723
^^^^^^^^^^^^^^^^^^^
3714
3724
@@ -4343,7 +4353,7 @@ recursive, can be opaqued, and are never uniqued.
4343
4353
:Examples:
4344
4354
4345
4355
+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4346
- | ``{ i32, i32, i32 }`` | A triple of three ``i32`` values |
4356
+ | ``{ i32, i32, i32 }`` | A triple of three ``i32`` values (this is a "homogeneous" struct as all element types are the same) |
4347
4357
+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4348
4358
| ``{ float, ptr }`` | A pair, where the first element is a ``float`` and the second element is a :ref:`pointer <t_pointer>`. |
4349
4359
+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -12472,8 +12482,8 @@ instruction's return value on the same edge).
12472
12482
The optional ``fast-math-flags`` marker indicates that the phi has one
12473
12483
or more :ref:`fast-math-flags <fastmath>`. These are optimization hints
12474
12484
to enable otherwise unsafe floating-point optimizations. Fast-math-flags
12475
- are only valid for phis that return a floating-point scalar or vector type,
12476
- possibly within an array (nested to any depth), or a homogeneous struct literal .
12485
+ are only valid for phis that return :ref:`supported floating-point types
12486
+ <fastmath_return_types>` .
12477
12487
12478
12488
Semantics:
12479
12489
""""""""""
@@ -12522,8 +12532,8 @@ class <t_firstclass>` type.
12522
12532
#. The optional ``fast-math flags`` marker indicates that the select has one or more
12523
12533
:ref:`fast-math flags <fastmath>`. These are optimization hints to enable
12524
12534
otherwise unsafe floating-point optimizations. Fast-math flags are only valid
12525
- for selects that return a floating-point scalar or vector type, possibly
12526
- within an array (nested to any depth), or a homogeneous struct literal .
12535
+ for selects that return :ref:`supported floating-point types
12536
+ <fastmath_return_types>`. .
12527
12537
12528
12538
Semantics:
12529
12539
""""""""""
@@ -12761,8 +12771,7 @@ This instruction requires several arguments:
12761
12771
#. The optional ``fast-math flags`` marker indicates that the call has one or more
12762
12772
:ref:`fast-math flags <fastmath>`, which are optimization hints to enable
12763
12773
otherwise unsafe floating-point optimizations. Fast-math flags are only valid
12764
- for calls that return a floating-point scalar or vector type, possibly within
12765
- an array (nested to any depth), or a homogeneous struct literal.
12774
+ for calls that return :ref:`supported floating-point types <fastmath_return_types>`.
12766
12775
12767
12776
#. The optional "cconv" marker indicates which :ref:`calling
12768
12777
convention <callingconv>` the call should use. If none is
@@ -20526,9 +20535,8 @@ the explicit vector length.
20526
20535
#. The optional ``fast-math flags`` marker indicates that the select has one or
20527
20536
more :ref:`fast-math flags <fastmath>`. These are optimization hints to
20528
20537
enable otherwise unsafe floating-point optimizations. Fast-math flags are
20529
- only valid for selects that return a floating-point scalar or vector type,
20530
- possibly within an array (nested to any depth), or a homogeneous struct
20531
- literal.
20538
+ only valid for selects that return :ref:`supported floating-point types
20539
+ <fastmath_return_types>`.
20532
20540
20533
20541
Semantics:
20534
20542
""""""""""
@@ -20585,9 +20593,8 @@ is the pivot.
20585
20593
#. The optional ``fast-math flags`` marker indicates that the merge has one or
20586
20594
more :ref:`fast-math flags <fastmath>`. These are optimization hints to
20587
20595
enable otherwise unsafe floating-point optimizations. Fast-math flags are
20588
- only valid for merges that return a floating-point scalar or vector type,
20589
- possibly within an array (nested to any depth), or a homogeneous struct
20590
- literal.
20596
+ only valid for merges that return :ref:`supported floating-point types
20597
+ <fastmath_return_types>`.
20591
20598
20592
20599
Semantics:
20593
20600
""""""""""
0 commit comments