diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-02-09 14:44:33 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-09 14:44:33 -0500 |
| commit | 0a7bdc00771dbad1dfe5eb93a7cade89059d227a (patch) | |
| tree | 8cb52e6e9ce0e52a63bccd5974c1a7c6150dfdce /src/all_types.hpp | |
| parent | a8a63feba7e40a998b1e1d8d36169e5f1be0d4e1 (diff) | |
| download | zig-0a7bdc00771dbad1dfe5eb93a7cade89059d227a.tar.gz zig-0a7bdc00771dbad1dfe5eb93a7cade89059d227a.zip | |
implement vector addition with safety checking
this would work if @llvm.sadd.with.overflow supported
vectors, which it does in trunk. but it does not support
them in llvm 7 or even in llvm 8 release branch.
so the next commit after this will have to do a different
strategy, but when llvm 9 comes out it may be worth coming
back to this one.
Diffstat (limited to 'src/all_types.hpp')
| -rw-r--r-- | src/all_types.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/all_types.hpp b/src/all_types.hpp index 842c9ae904..908c0e327c 100644 --- a/src/all_types.hpp +++ b/src/all_types.hpp @@ -1538,6 +1538,8 @@ enum ZigLLVMFnId { ZigLLVMFnIdBitReverse, }; +// There are a bunch of places in code that rely on these values being in +// exactly this order. enum AddSubMul { AddSubMulAdd = 0, AddSubMulSub = 1, @@ -1563,6 +1565,7 @@ struct ZigLLVMFnKey { struct { AddSubMul add_sub_mul; uint32_t bit_count; + uint32_t vector_len; // 0 means not a vector bool is_signed; } overflow_arithmetic; struct { |
