[llvm] 84167a8 - [docs] Clarify semantics of ordered fadd/fmul reductions.

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 09:11:25 PDT 2020


Author: Amara Emerson
Date: 2020-06-18T09:10:43-07:00
New Revision: 84167a8d58e8af79625abcffdf2c860d556955e6

URL: https://github.com/llvm/llvm-project/commit/84167a8d58e8af79625abcffdf2c860d556955e6
DIFF: https://github.com/llvm/llvm-project/commit/84167a8d58e8af79625abcffdf2c860d556955e6.diff

LOG: [docs] Clarify semantics of ordered fadd/fmul reductions.

Differential Revision: https://reviews.llvm.org/D82034

Added: 
    

Modified: 
    llvm/docs/LangRef.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index a323e37487d0..4eff0e4c5ec3 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -15131,7 +15131,17 @@ matches the element-type of the vector input.
 If the intrinsic call has the 'reassoc' or 'fast' flags set, then the
 reduction will not preserve the associativity of an equivalent scalarized
 counterpart. Otherwise the reduction will be *ordered*, thus implying that
-the operation respects the associativity of a scalarized reduction.
+the operation respects the associativity of a scalarized reduction. That is, the
+reduction begins with the start value and performs an fadd operation with consecutively
+increasing vector element indices. See the following pseudocode:
+
+::
+
+    float ordered_fadd(start_value, input_vector)
+      result = start_value
+      for i = 0 to length(input_vector)
+        result = result + input_vector[i]
+      return result
 
 
 Arguments:
@@ -15192,7 +15202,17 @@ matches the element-type of the vector input.
 If the intrinsic call has the 'reassoc' or 'fast' flags set, then the
 reduction will not preserve the associativity of an equivalent scalarized
 counterpart. Otherwise the reduction will be *ordered*, thus implying that
-the operation respects the associativity of a scalarized reduction.
+the operation respects the associativity of a scalarized reduction. That is, the
+reduction begins with the start value and performs an fmul operation with consecutively
+increasing vector element indices. See the following pseudocode:
+
+::
+
+    float ordered_fmul(start_value, input_vector)
+      result = start_value
+      for i = 0 to length(input_vector)
+        result = result * input_vector[i]
+      return result
 
 
 Arguments:


        


More information about the llvm-commits mailing list