Skip to content

Commit 56d6607

Browse files
committed
clarify the naming convention for horizontal reductions, or lack thereof
1 parent d817701 commit 56d6607

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

text/0000-ppv.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Operations on vector types can be either:
177177
For example, `a.sum()` adds the elements of a vector together while `a.hmax()`
178178
returns the largest element in a vector. These operations (typically)
179179
translate to a sequence of multiple SIMD instructions on most architectures
180-
and are therefore slower. In many cases, they are, however, necessary.
180+
and are therefore slower. In many cases, they are, however, necessary.
181181

182182
## Example: Average
183183

@@ -655,6 +655,15 @@ pub fn hmin(self) -> element_type;
655655
}
656656
```
657657

658+
Note: In this RFC, horizontal reductions are named according to the operation
659+
they perform. When this name clashes with that of a vertical operation, the
660+
horizontal reduction's name get's a `h`-prefix. In this case, the horizontal
661+
`max` and `min` reductions clash with the vertical `a.max(b)` operation, and
662+
therefore get a `h`-prefix.
663+
664+
An alternative would be to prefix all horizontal operations with, for example,
665+
the `h_`-prefix.
666+
658667
#### Mask construction and element access
659668

660669
```rust

0 commit comments

Comments
 (0)