2284 Commits

Author SHA1 Message Date
Andrew Kelley
d1a98ccff4
implement spills when expressions used across suspend points
closes #3077
2019-09-07 00:13:12 -04:00
Andrew Kelley
0a3c6dbda9
implement noasync function calls
See #3157
2019-09-05 21:55:32 -04:00
LemonBoy
fabf45f5fc Add the noinline keyword for function declarations 2019-09-05 13:04:58 -04:00
Andrew Kelley
a7fd14096c
fix typo with tls initialization
I tested that hello world cross compiles to armv7 now.

closes #3167
2019-09-04 14:44:16 -04:00
Robin Voetter
df06976e73 Only check for TLS support on arm if TLS segment exists 2019-09-04 17:48:01 +02:00
Robin Voetter
77d04c03e3 Implement remaining requested changes
- Replace @intCast with a checked version (std/debug.zig)
- Replace @intCast with i64() when casting from a smaller type (std/fs/file.zig)
- Replace `nakedcc` with appropriate calling convention for linking with c (std/os/linux/arm-eabi.zig)
- Only check if hwcap contains TLS when the hwcap field actually exists (std/os/linux/tls.zig)
2019-09-04 16:23:25 +02:00
Robin Voetter
6a76298740 Add missing clobbers on arm-eabi and arm64 syscall conventions 2019-09-04 15:59:51 +02:00
Robin Voetter
5308eb7045 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-09-04 15:55:54 +02:00
Andrew Kelley
8a7e2e3479
Merge branch 'comment-in-array' of https://github.com/Vexu/zig into Vexu-comment-in-array 2019-09-03 21:49:35 -04:00
Andrew Kelley
a4ce10df80
Merge pull request #3169 from Sahnvour/string_hash_map
Using StringHashMap everywhere it's needed
2019-09-03 20:30:26 -04:00
Sahnvour
9d6f236728 add fastpath for std.mem.eql and simplify std.hash_map.eqlString
this should also be friendlier to the optimizer
2019-09-03 23:56:04 +02:00
Sahnvour
f08c6e4fe6 changing occurrences of HashMap with []const u8 as keys for StringHashMap 2019-09-03 23:53:05 +02:00
Andrew Kelley
fc0f8d0359
zig build: make install prefix available to build.zig and
prevent accident of '/' showing up in application/library names
2019-09-03 16:19:10 -04:00
Vesa Kaihlavirta
e9530ce97b Fix addition direction, remove superfluous loop counter, add tests 2019-09-03 13:45:02 -04:00
Andrew Kelley
0fe28855c5
add ability to specify darwin framework search dirs 2019-09-02 11:48:06 -04:00
Robin Voetter
d62f7c6b60 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-09-01 23:45:51 +02:00
Robin Voetter
e7912dee9b Fix up preadv, preadv2, pwritev and pwritev2 2019-09-01 16:10:36 +02:00
Robin Voetter
e9d795b025 Fix up seteuid and setegid 2019-09-01 12:08:02 +02:00
Robin Voetter
e39c93a2f3 Replace legacy 16-bit syscalls with 32-bit versions when appropriate 2019-09-01 11:54:57 +02:00
Andrew Kelley
8b1900e5df
Revert "Merge pull request #2991 from emekoi/mingw-ci"
This reverts commit ec7d7a5b14540ea3b2bab9f11318630338467965, reversing
changes made to 81c441f8855d4c58f0b2ff86d3d007cf0bf395d3.

It looks like this broke colors in Windows Command Prompt (#3147)
and this method of detecting native C ABI isn't working well (#3121).
2019-09-01 00:33:02 -04:00
Andrew Kelley
6ab8b2aab4
support recursive async and non-async functions
which heap allocate their own frames

related: #1006
2019-08-30 20:06:02 -04:00
Andrew Kelley
2148943fff
Merge pull request #3139 from hspak/zig-fmt-nested-if
zig fmt: fix nested if
2019-08-30 15:48:07 -04:00
Robin Voetter
7a2b4cb9a1 Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 21:37:46 +02:00
Andrew Kelley
d9fed5cdfd
align(@alignOf(T)) T does not force resolution of T 2019-08-30 14:53:44 -04:00
Robin Voetter
ca2aa4880f Merge remote-tracking branch 'upstream/master' into arm-support-improvement 2019-08-30 13:02:28 +02:00
Robin Voetter
4b8325f381 Remove unneeded os check 2019-08-30 13:02:15 +02:00
Robin Voetter
c1f8b201a1 Improve comments near un-implemented functionality 2019-08-30 12:58:44 +02:00
Hong Shick Pak
19964f5dc8 run new zig fmt and remove stale comment 2019-08-29 21:23:49 -07:00
Hong Shick Pak
9f4d44bc49 zig fmt: fix nested if 2019-08-29 21:10:26 -07:00
Andrew Kelley
8e93991634
avoid unnecessarily requiring alignment for array elem pointers 2019-08-29 16:25:58 -04:00
Robin Voetter
2323da3a68 add __aeabi_read_tp 2019-08-29 18:12:58 +02:00
Robin Voetter
e4c262b804 Don't print line info if source is not available 2019-08-29 10:52:50 +02:00
Robin Voetter
108a51b110 fix issues with debug.zig
- Use sys_*stat*64 instead of sys_*stat* where appropriate
- Fix overflow when calculating atime, ctime and mtime on File.stat()
- Fix compilation error casting getEndPos to usize.
2019-08-29 10:34:05 +02:00
Robin Voetter
b3ac323a44 TLS initialization, clone definition and _start functionality 2019-08-29 01:14:43 +02:00
Robin Voetter
57de61084e Make mmap use SYS_mmap2 if it exists 2019-08-29 00:55:22 +02:00
Robin Voetter
223b773e03 Add more syscall constants 2019-08-29 00:54:57 +02:00
Andrew Kelley
e8a9caa3dd
add suggestion to AutoHash compile error message 2019-08-28 14:38:55 -04:00
Andrew Kelley
d5b3d97c23
Merge pull request #2760 from Vexu/fmt-comment-fix
Fix non-empty comments getting removed with empty comments
2019-08-28 12:01:08 -04:00
yvt
c98f792ff8 Improve the handling of zig fmt: off/on
This commit reworks the handling of `zig fmt: off/on`. A motivating
example is shown below:

    const c = d;
    // zig fmt: off
    // comment
    const a = b;
    // zig fmt: on

Before processing the decl `const a = b;`, `renderRoot` looks for
`zig fmt: off` that appears between this decl and the previous one. If
it finds one, it searches for the next `zig fmt: on` that re-enables
reformatting (or EOF if none was found), and copies the input code
between `zig fmt: off` and `zig fmt: on` to the output stream. After
that, it proceeds to the next decl.

The important thing to notice here is that `renderTopLevelDecl` emits
line comment tokens that follow the decl. Therefore, when copying code,
we must be careful not to copy the line comment tokens that already have
been written to the output stream. The original code failed to take this
fact into consideration. It did skip `// zig fmt: off`, but not the
remaining ones. As a result, when the above example is fed as input, it
duplicated the line `// comment`.
2019-08-28 11:57:01 -04:00
Robin Voetter
50c37c75d1 add arm32 syscall conventions 2019-08-28 17:41:49 +02:00
Robin Voetter
32f4606cec add arm32 linux bits definitions 2019-08-28 16:35:23 +02:00
Marc Tiehuis
ac477f3c9a
Merge pull request #3060 from Sahnvour/hashing
auto_hash with deep/shallow hashing
2019-08-28 21:25:50 +12:00
Marc Tiehuis
fbcdf78cbd Simplify wyhash and improve speed
This removes the exposed stateless variant since the standard variant
has similar speed now.

Using `./benchmark --filter wyhash --count 1024`, the speed change has
changed from:

    wyhash
       iterative: 4093 MiB/s [6f76b0d5db7db34c]
      small keys: 3132 MiB/s [28c2f43c70000000]

to

    wyhash
       iterative: 6515 MiB/s [673e9bb86da93ea4]
      small keys: 10487 MiB/s [28c2f43c70000000]
2019-08-27 19:42:37 +02:00
Andrew Kelley
35a374efe0
Merge pull request #3115 from ziglang/fix-field-alignment-kludge
fix field alignment kludge by implementing lazy values
2019-08-27 13:02:31 -04:00
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
6569bfc85e
fix some std lib dependency loops 2019-08-26 11:23:25 -04: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
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