@@ -6,9 +6,20 @@ macro_rules! impl_arithmetic_reductions {
6
6
impl $id {
7
7
/// Lane-wise addition of the vector elements.
8
8
///
9
- /// FIXME: document guarantees with respect to:
10
- /// * integers: overflow behavior
11
- /// * floats: order and NaNs
9
+ /// The intrinsic performs a tree-reduction of the vector elements.
10
+ /// That is, for an 8 element vector:
11
+ ///
12
+ /// > ((x0 + x1) + (x2 + x3)) + ((x4 + x5) + (x6 + x7))
13
+ ///
14
+ /// # Integer vectors
15
+ ///
16
+ /// If an operation overflows it returns the mathematical result
17
+ /// modulo `2^n` where `n` is the number of times it overflows.
18
+ ///
19
+ /// # Floating-point vectors
20
+ ///
21
+ /// If one of the vector element is `NaN` the reduction returns
22
+ /// `NaN`.
12
23
#[ cfg( not( target_arch = "aarch64" ) ) ]
13
24
#[ inline]
14
25
pub fn sum( self ) -> $elem_ty {
@@ -19,9 +30,20 @@ macro_rules! impl_arithmetic_reductions {
19
30
}
20
31
/// Lane-wise addition of the vector elements.
21
32
///
22
- /// FIXME: document guarantees with respect to:
23
- /// * integers: overflow behavior
24
- /// * floats: order and NaNs
33
+ /// The intrinsic performs a tree-reduction of the vector elements.
34
+ /// That is, for an 8 element vector:
35
+ ///
36
+ /// > ((x0 + x1) + (x2 + x3)) + ((x4 + x5) + (x6 + x7))
37
+ ///
38
+ /// # Integer vectors
39
+ ///
40
+ /// If an operation overflows it returns the mathematical result
41
+ /// modulo `2^n` where `n` is the number of times it overflows.
42
+ ///
43
+ /// # Floating-point vectors
44
+ ///
45
+ /// If one of the vector element is `NaN` the reduction returns
46
+ /// `NaN`.
25
47
#[ cfg( target_arch = "aarch64" ) ]
26
48
#[ inline]
27
49
pub fn sum( self ) -> $elem_ty {
@@ -36,9 +58,20 @@ macro_rules! impl_arithmetic_reductions {
36
58
37
59
/// Lane-wise multiplication of the vector elements.
38
60
///
39
- /// FIXME: document guarantees with respect to:
40
- /// * integers: overflow behavior
41
- /// * floats: order and NaNs
61
+ /// The intrinsic performs a tree-reduction of the vector elements.
62
+ /// That is, for an 8 element vector:
63
+ ///
64
+ /// > ((x0 * x1) * (x2 * x3)) * ((x4 * x5) * (x6 * x7))
65
+ ///
66
+ /// # Integer vectors
67
+ ///
68
+ /// If an operation overflows it returns the mathematical result
69
+ /// modulo `2^n` where `n` is the number of times it overflows.
70
+ ///
71
+ /// # Floating-point vectors
72
+ ///
73
+ /// If one of the vector element is `NaN` the reduction returns
74
+ /// `NaN`.
42
75
#[ cfg( not( target_arch = "aarch64" ) ) ]
43
76
#[ inline]
44
77
pub fn product( self ) -> $elem_ty {
@@ -49,9 +82,20 @@ macro_rules! impl_arithmetic_reductions {
49
82
}
50
83
/// Lane-wise multiplication of the vector elements.
51
84
///
52
- /// FIXME: document guarantees with respect to:
53
- /// * integers: overflow behavior
54
- /// * floats: order and NaNs
85
+ /// The intrinsic performs a tree-reduction of the vector elements.
86
+ /// That is, for an 8 element vector:
87
+ ///
88
+ /// > ((x0 * x1) * (x2 * x3)) * ((x4 * x5) * (x6 * x7))
89
+ ///
90
+ /// # Integer vectors
91
+ ///
92
+ /// If an operation overflows it returns the mathematical result
93
+ /// modulo `2^n` where `n` is the number of times it overflows.
94
+ ///
95
+ /// # Floating-point vectors
96
+ ///
97
+ /// If one of the vector element is `NaN` the reduction returns
98
+ /// `NaN`.
55
99
#[ cfg( target_arch = "aarch64" ) ]
56
100
#[ inline]
57
101
pub fn product( self ) -> $elem_ty {
0 commit comments