Marc Tiehuis
326b7b794b
Improve siphash performance for small keys by up to 30% ( #3124 )
...
This removes the partial buffer handling from the full slice api.
`./benchmark --filter siphash --count 1024`
old
siphash(1,3)
iterative: 3388 MiB/s [67532e53a0d210bf]
small keys: 1258 MiB/s [948c91176a000000]
siphash(2,4)
iterative: 2061 MiB/s [f792d39bff42f819]
small keys: 902 MiB/s [e1ecba6614000000]
new
siphash(1,3)
iterative: 3410 MiB/s [67532e53a0d210bf]
small keys: 1639 MiB/s [948c91176a000000]
siphash(2,4)
iterative: 2053 MiB/s [f792d39bff42f819]
small keys: 1074 MiB/s [e1ecba6614000000]
2019-08-27 20:13:57 +12:00
Andrew Kelley
a2e8ef77e2
fix regression in one of the doc examples
2019-08-26 22:50:12 -04:00
Andrew Kelley
db50cf7049
fix more compile error regressions
2019-08-26 22:38:45 -04:00
Andrew Kelley
1df75da918
remove no longer needed gcc8 workaround. add gcc9 workaround
...
Occasionally LLVM headers generate warnings with newer gcc versions and
since we use -Werror this has to be worked around.
2019-08-26 21:40:44 -04:00
Andrew Kelley
bad4b040cc
miscellaneous fixes regarding compile errors
2019-08-26 18:35:36 -04:00
Andrew Kelley
ca145a6d5a
fix regression in ir_get_ref
2019-08-26 15:43:39 -04:00
Andrew Kelley
ae65c236c5
fix regression with global variable assignment...
...
...with optional unwrapping with var initialized to undefined
2019-08-26 15:24:24 -04:00
Andrew Kelley
d316f70450
fix regression on struct field with undefined type
2019-08-26 14:01:59 -04:00
Andrew Kelley
73a7747a9c
fix some compile error regressions
2019-08-26 12:43:36 -04:00
Andrew Kelley
6569bfc85e
fix some std lib dependency loops
2019-08-26 11:23:25 -04:00
Andrew Kelley
e1a4bcbdfd
fix dependency loop errors with zig build
2019-08-26 10:43:07 -04:00
Andrew Kelley
ede0c22a67
make @alignOf
lazily evaluate the target type
...
this case works now:
```zig
const Foo = struct {
field: Bar(@alignOf(*Foo)),
};
fn Bar(comptime alignment: u29) type {
return struct {
field: *align(alignment) Foo,
};
}
```
2019-08-26 10:03:30 -04:00
Andrew Kelley
b13af0750f
fix assertion tripped instead of reporting compile error
2019-08-25 21:45:11 -04:00
Andrew Kelley
720302a640
fix resolution detection of pointer types
2019-08-25 21:28:16 -04:00
Andrew Kelley
a7f3158185
behavior tests passing
2019-08-25 21:16:03 -04:00
Andrew Kelley
64e9b0ee46
make the zero-bit-ness of pointers lazy
...
this case works now:
```zig
const Foo = struct {
field: @typeOf(func).ReturnType,
};
fn func(self: *Foo) void {}
```
2019-08-25 20:27:56 -04:00
Andrew Kelley
8f41da2216
fix behavior test regressions with unions
2019-08-25 11:42:19 -04:00
Andrew Kelley
fa6c20a02d
hook up unions with lazy values
...
this case works now:
```zig
const Expr = union(enum) {
Literal: u8,
Question: *Expr,
};
```
2019-08-25 11:34:07 -04:00
Jonathan Marler
1b19c28c79
Fix issue 3058: zig build segfault
2019-08-24 10:47:27 -06:00
Sahnvour
90e921f7a7
wyhash: readd the stateful streaming version so that both are available
...
and rename the stateless one so that's it is not the default option
2019-08-24 15:37:47 +02:00
Sahnvour
4c882e731f
hash_map: adding a StringHashMap for convenience
2019-08-24 15:30:23 +02:00
Sahnvour
1498ccac2a
auto_hash: better generic hashing implementation
...
autoHash forbids slices as input
hash was added to handle all types from autoHash plus slices, with a specified strategy
2019-08-24 15:30:23 +02:00
Marc Tiehuis
50a80261dc
Merge pull request #3118 from ziglang/revert-crc-poly-api
...
std/hash: Revert crc32 api change
2019-08-24 20:47:45 +12:00
Marc Tiehuis
a610352271
std/hash: Revert crc32 api change
...
This is user specified and the user doesn't necessarily have to use one
of the provided polynomials declared hence we can't use an enum.
Thanks @daurnimator for catching this.
2019-08-24 19:05:05 +12:00
Andrew Kelley
d277a1196b
tracking these issues on github now
2019-08-23 17:54:01 -04:00
Andrew Kelley
e8bad1e12a
fix regression on @ptrCast
...
this case regressed and now fixed:
```zig
const a: ?*i32 = undefined;
const b: ?*f32 = @ptrCast(?*f32, a);
```
2019-08-23 17:39:56 -04:00
Andrew Kelley
101440c199
add lazy value support for optional types
...
this case works now:
```zig
const Node = struct {
node: ?*Node,
};
```
2019-08-23 17:14:51 -04:00
Andrew Kelley
f0034495fa
fix regression with simple pointer to self
2019-08-23 15:59:37 -04:00
Andrew Kelley
ac4dd9d665
better handling of lazy structs
...
this case works now:
```zig
const A = struct {
b_list_pointer: *const []B,
};
const B = struct {
a_pointer: *const A,
};
const b_list: []B = [_]B{};
const a = A{ .b_list_pointer = &b_list };
const obj = B{ .a_pointer = &a };
```
2019-08-23 15:54:51 -04:00
Andrew Kelley
be0a9a7277
pointer types lazily evaluate their element type
2019-08-23 15:05:15 -04:00
Andrew Kelley
1dd658d1d0
allow top level declarations to be lazy
...
this case now works:
```zig
const A = struct {
b: B,
};
const B = fn (A) void;
```
2019-08-23 14:07:34 -04:00
Andrew Kelley
20049caaba
add lazy value for fn prototypes
...
this case now works:
```zig
const Node = struct {
field: fn (*Node) *Node,
};
```
2019-08-23 13:28:26 -04:00
Andrew Kelley
3865b6ad8f
Merge remote-tracking branch 'origin/master' into fix-field-alignment-kludge
2019-08-23 11:43:37 -04:00
Andrew Kelley
ec2f9ef4e8
Merge pull request #3114 from Tetralux/align-on-struct-fields
...
parsing and rendering of align(N) on struct fields
2019-08-23 11:19:27 -04:00
Jonathan Marler
9322eee80a
Encapsulate bigint representation, assert on cast data loss
2019-08-23 11:14:08 -04:00
Tetralux
43587af01a
rendering of align(N) on struct fields
2019-08-22 22:58:38 +00:00
Tetralux
3ec10ea174
parsing of align(N) on struct fields
2019-08-22 22:58:02 +00:00
Andrew Kelley
79a4b7a236
fix regressions
2019-08-22 18:24:15 -04:00
Andrew Kelley
26b79ac90e
simple self-referential struct is working now
2019-08-22 14:46:26 -04:00
Andrew Kelley
0d6a6c76ea
add missing "referenced here" notes for lazy values
2019-08-22 12:56:35 -04:00
Andrew Kelley
8460d5617c
introduce lazy values
...
see #2174
2019-08-22 12:08:04 -04:00
Marc Tiehuis
0e75fef1de
Merge pull request #3106 from ziglang/hash-tooling-changes
...
Hash tooling changes
2019-08-21 21:54:12 -10:00
Andrew Kelley
efdbede7ab
breaking: remove field alignment kludge
...
This breaks behavior tests as well as compile error notes for generic
function calls. However it introduces better circular dependency compile
errors.
The next step is to add Lazy Values to fix the regressions.
2019-08-21 19:27:51 -04:00
Andrew Kelley
ec7d7a5b14
Merge pull request #2991 from emekoi/mingw-ci
...
mingw improvements
2019-08-21 12:29:42 -04:00
Marc Tiehuis
16fa255f48
Inline full slice hashing
...
This gives moderate speed improvements when hashing small keys.
The crc/adler/fnv inlining did not provide enough speed up to warrant
the change.
OLD:
wyhash
small keys: 2277 MiB/s [c14617a1e3800000]
siphash(1,3)
small keys: 937 MiB/s [b2919222ed400000]
siphash(2,4)
small keys: 722 MiB/s [3c3d974cc2800000]
fnv1a
small keys: 1580 MiB/s [70155e1cb7000000]
adler32
small keys: 1898 MiB/s [00013883ef800000]
crc32-slicing-by-8
small keys: 2323 MiB/s [0035bf3dcac00000]
crc32-half-byte-lookup
small keys: 218 MiB/s [0035bf3dcac00000]
NEW:
wyhash
small keys: 2775 MiB/s [c14617a1e3800000]
siphash(1,3)
small keys: 1086 MiB/s [b2919222ed400000]
siphash(2,4)
small keys: 789 MiB/s [3c3d974cc2800000]
fnv1a
small keys: 1604 MiB/s [70155e1cb7000000]
adler32
small keys: 1856 MiB/s [00013883ef800000]
crc32-slicing-by-8
small keys: 2336 MiB/s [0035bf3dcac00000]
crc32-half-byte-lookup
small keys: 218 MiB/s [0035bf3dcac00000]
2019-08-21 21:38:02 +12:00
Marc Tiehuis
7854a52a6b
Add iterative-only filter to hash benchmark
2019-08-21 21:02:24 +12:00
Marc Tiehuis
48410943cb
Add more hash functions to benchmark scripts
...
Changed CRC api so the polynomial is specified as an enum for simpler
construction.
2019-08-21 20:46:15 +12:00
Marc Tiehuis
c050ec4e57
Update hash/crypto benchmark scripts
2019-08-21 20:34:12 +12:00
Andrew Kelley
81c441f885
remove incorrect assert regarding 128-bit integers
...
LLVM incorrectly reports 8 as the alignment of i128 on x86_64 but it
correctly reports 16 as the alignment of i128 on aarch64.
closes #3101
2019-08-20 21:17:57 -04:00
Andrew Kelley
2f3ad48c9b
LLD patch: workaround for buggy MACH-O code
...
This reapplies 5ce1a965e02b45a9b3bcb0328f40e08c5585e1e3
to the embedded LLD.
2019-08-20 19:42:41 -04:00