aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-10-04 18:23:52 +0200
committerAndrew Kelley <andrew@ziglang.org>2020-10-05 04:51:45 -0400
commit22b5e47839cf34c1e4a7c5e6dc256e041b4bf8fc (patch)
treea940511e3d881231d60276f824a6a9055877dc83 /lib/std/builtin.zig
parent7c5a24e08cd0bffd2a5cce6d1fd592a7d2bee678 (diff)
downloadzig-22b5e47839cf34c1e4a7c5e6dc256e041b4bf8fc.tar.gz
zig-22b5e47839cf34c1e4a7c5e6dc256e041b4bf8fc.zip
stage1: Implement @reduce builtin for vector types
The builtin folds a Vector(N,T) into a scalar T using a specified operator. Closes #2698
Diffstat (limited to 'lib/std/builtin.zig')
-rw-r--r--lib/std/builtin.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 92fa78bc39..68bbbe3b2d 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -100,6 +100,16 @@ pub const AtomicOrder = enum {
/// This data structure is used by the Zig language code generation and
/// therefore must be kept in sync with the compiler implementation.
+pub const ReduceOp = enum {
+ And,
+ Or,
+ Xor,
+ Min,
+ Max,
+};
+
+/// This data structure is used by the Zig language code generation and
+/// therefore must be kept in sync with the compiler implementation.
pub const AtomicRmwOp = enum {
Xchg,
Add,