Commit Graph

3633 Commits

Author SHA1 Message Date
kristopher tate
d1752fbdc0 std/fmt/index.zig: test for printing double width hex bytes with zeros;
Co-Authored-By: Shawn Landden <shawn@git.icu>
2018-09-02 15:04:57 +09:00
kristopher tate
48d3fbef5c std/fmt/index.zig: set width from 0 to 2;
\x00 was printed as 0 and \x0E was printed as E;
\x00 now correctly prints 00 and \x0E correctly prints 0E;
2018-09-02 15:04:20 +09:00
Shawn Landden
4bf54f3010
std/rb.zig: fix comment 2018-09-01 22:23:34 -07:00
Andrew Kelley
1a5c3e4501
Merge pull request #1451 from kristate/fmt-hexbytes-issue1358
allow bytes to be printed-out as hex (#1358)
2018-09-01 10:44:54 -04:00
Andrew Kelley
19004cd5db
Merge pull request #1444 from kristate/winsdk-vercheck-issue1438
correct version comparison for detecting msvc (fixes #1438)
2018-09-01 10:39:19 -04:00
kristopher tate
7a633f472d std/fmt/index.zig: #1358: test bytes printed-out as hex; 2018-09-01 19:53:11 +09:00
kristopher tate
454b2362ee std/fmt/index.zig: #1358 allow bytes to be printed-out as hex;
Supports {x} for lowercase and {X} for uppercase;
2018-09-01 19:40:05 +09:00
kristopher tate
9e6f53dd58 i#1438: src/windows_sdk.cpp: fix version guard in find_81_version; 2018-09-01 12:02:21 +09:00
kristopher tate
d4474e195e i#1438: src/windows_sdk.cpp: fix version guard in find_10_version; 2018-09-01 12:02:04 +09:00
Andrew Kelley
6ddbd345aa figuring out where /names stream is 2018-08-31 19:50:03 -04:00
Jimmi Holst Christensen
e036f65ac0
Translate-c: Check for error before working on while loop body (#1445) 2018-08-31 23:17:17 +02:00
Andrew Kelley
b36b93fb3e awareness of debug subsections 2018-08-31 15:02:41 -04:00
Marc Tiehuis
763845f95c std/crypto: zig fmt 2018-08-31 18:45:45 +12:00
Marc Tiehuis
38399941d4 std/crypto: Update throughput_test.zig to include all hash functions
This avoids the need to recompile to test specific hash functions. This
also adds mac/key exchange performance tests as well.
2018-08-31 18:45:07 +12:00
Marc Tiehuis
a7527389cc Make poly1305 and x25519 more idiomatic zig
This also adjusts the current hash/hmac functions to have a consistent
interface allowing easier switching/testing.
2018-08-31 18:40:09 +12:00
Andrew Kelley
99170aa13d finding source file, line, and column info 2018-08-31 01:01:37 -04:00
Andrew Kelley
72185e7dd3 finding the function that an address is in 2018-08-30 16:57:55 -04:00
Andrew Kelley
44f908d2e6 figuring out which module an address belongs in 2018-08-30 15:33:50 -04:00
Andrew Kelley
96117e20cc reading the module information substream 2018-08-30 03:44:34 -04:00
Marc Tiehuis
65b89f598c Add poly1305 and x25519 crypto primitives
These are translated from [monocypher](https://monocypher.org/) which
has fairly competitive performance while remaining quite simple.

Initial performance comparision:

Zig:
 Poly1305: 1423 MiB/s
 X25519:   8671 exchanges per second

Monocypher:
 Poly1305: 1567 MiB/s
 X25519:   10539 exchanges per second

There is room for improvement and no real effort has been made at all in
optimization beyond a direct translation.
2018-08-30 18:02:19 +12:00
Andrew Kelley
686663239a printing info from the ModuleInfo substream of DebugInfo 2018-08-29 19:00:24 -04:00
Andrew Kelley
f1b71053de use RtlCaptureStackBackTrace on windows 2018-08-29 16:35:51 -04:00
Andrew Kelley
833477abf5 fix unresolved path preventing PDB loading 2018-08-28 18:55:51 -04:00
Andrew Kelley
41723f842c Merge branch 'windows-coff-issue721' of https://github.com/Sahnvour/zig into Sahnvour-windows-coff-issue721 2018-08-28 17:32:32 -04:00
Andrew Kelley
9de0f900e1
Merge pull request #1369 from shawnl/crypto
std/crypto: add chacha20
2018-08-28 16:07:58 -04:00
Andrew Kelley
b65cca37ce
add test coverage for invalid switch expression parameter
closes #604
2018-08-28 15:48:39 -04:00
Andrew Kelley
901b5c1566
add compile error for function prototype with no body
closes #1231
2018-08-28 15:39:32 -04:00
Andrew Kelley
09cc1dc660
fix crash when var in inline loop has different types
closes #917
closes #845
closes #741
closes #740
2018-08-28 15:24:28 -04:00
Marc Tiehuis
87eb95f816 speed up chacha20
The main changes are:

    Unrolling the inner rounds of salsa20_wordtobyte which doubles the speed.
    Passing the slice explicitly instead of returning the array saves a copy (can optimize out in future with copy elision) and gives ~10% improvement.
    Inlining the outer loop gives ~15-20% improvement but it costs an extra 4Kb of code space. I think the tradeoff is worthwhile here.
    The other inline loops are small and can be done by the compiler if it is worthwhile.
    The rotate function replacement doesn't alter the performance from the former.

The modified throughput test I've used to benchmark is as follows. Interestingly we need to allocate memory instead of using a fixed buffer else Zig optimizes the whole thing out.

https://github.com/ziglang/zig/pull/1369#issuecomment-416456628
2018-08-27 22:55:53 -07:00
Shawn Landden
444edd9aed std.crypto: add chaCha20
v3
2018-08-27 19:44:11 -07:00
Andrew Kelley
048f506aa6
langref: document labeled blocks, labeled for, labeled while
closes #1327
2018-08-27 20:59:28 -04:00
Andrew Kelley
fb6d3859e8
zig fmt 2018-08-27 19:25:40 -04:00
Andrew Kelley
4f2d49fd13
std.zig.parse: fix parsing of doc comments after fields
closes #1404
2018-08-27 19:21:38 -04:00
Andrew Kelley
b92fac329e
Merge branch 'raulgrell-CastToCVoid' 2018-08-27 18:31:41 -04:00
Andrew Kelley
45d9d9f953
minor fixups 2018-08-27 18:31:28 -04:00
raulgrell
e2a9f2ef98 Allow implicit cast from *T and [*]T to ?*c_void 2018-08-27 23:13:57 +01:00
Andrew Kelley
c48be3a742
langref: document exporting a library
closes #1431
2018-08-27 17:44:58 -04:00
tgschultz
ecc5464024 Handle unions differently in std.fmt (#1432)
* Handle unions differently in std.fmt

Print the active tag's value in tagged unions. Untagged unions considered unsafe to print and treated like a pointer or an array.
2018-08-27 17:25:33 -04:00
Andrew Kelley
009e90f446
fix @typeInfo unable to distinguish compile error vs no-payload
closes #1421
closes #1426
2018-08-27 17:13:34 -04:00
Andrew Kelley
2f2215c9f4
this was intended to be included in the previous commit 2018-08-27 16:26:36 -04:00
Andrew Kelley
526d8425ab
fix false negative determining if function is generic
This solves the smaller test case of #1421 but the
other test case is still an assertion failure.
2018-08-27 16:14:48 -04:00
Andrew Kelley
68e2794e15 ir: const_ptr_pointee asserts that its return value is non-null 2018-08-26 13:13:26 -04:00
Andrew Kelley
6a3fad1d59 Revert "src/ir.cpp: check return value of const_ptr_pointee to protect against dereferencing null pointers;"
This reverts commit 0839ed1f94.

I realized too late there is a better fix. See PR #1419
2018-08-26 13:04:58 -04:00
kristopher tate
0839ed1f94 src/ir.cpp: check return value of const_ptr_pointee to protect against dereferencing null pointers; 2018-08-26 13:02:09 -04:00
Andrew Kelley
8047f0eae2 fix llvm assertion failure when building std lib tests for macos
closes #1417
2018-08-26 02:36:18 -04:00
Andrew Kelley
526338b00f document fixed-width integer types
closes #1280
2018-08-25 17:39:43 -04:00
Andrew Kelley
56a53021a1 Merge branch 'tgschultz-patch-3' 2018-08-25 17:28:40 -04:00
Andrew Kelley
2cce171448 add test for previous commit 2018-08-25 17:28:30 -04:00
tgschultz
61c0c6d502
Fixed compile error when passing enum to fmt
Caused by struct printing behavior. Enums are different enough from structs and unions that the field iteration behavior doesn't do what we want even if @memberName didn't error on enums.
2018-08-25 10:51:49 -05:00
Andrew Kelley
4003cd4747
Merge pull request #1406 from ziglang/macos-stack-traces
MacOS stack traces
closes #1365
2018-08-25 04:50:51 -04:00