Commit Graph

174 Commits (6288ad865cd0805cedcac242990c1b7b57950cc4)

Author SHA1 Message Date
Andrew Kelley 5a7a0e8518 update to SoftFloat-3e
closes #823
2018-03-09 15:06:06 -05:00
Andrew Kelley 4955c4b8f9 update C headers to clang 6.0.0rc3 2018-02-23 13:15:16 -05:00
Andrew Kelley 9cfd7dea19 Merge remote-tracking branch 'origin/master' into llvm6 2018-02-23 12:56:41 -05:00
Ben Noordhuis ab48934e9c add support for stack traces on macosx
Add basic address->symbol resolution support.  Uses symtab data from the
MachO image, not external dSYM data; that's left as a future exercise.

The net effect is that we can now map addresses to function names but
not much more.  File names and line number data will have to wait until
a future pull request.

Partially fixes #434.
2018-02-19 23:11:11 +01:00
Andrew Kelley ef6260b3a7 Merge remote-tracking branch 'origin/master' into llvm6 2018-02-11 23:49:20 -05:00
Andrew Kelley 46aa416c48 std.os and std.io API update
* move std.io.File to std.os.File
 * add `zig fmt` to self hosted compiler
 * introduce std.io.BufferedAtomicFile API
 * introduce std.os.AtomicFile API
 * add `std.os.default_file_mode`
 * change FileMode on posix from being a usize to a u32
 * add std.os.File.mode to return mode of an open file
 * std.os.copyFile copies the mode from the source file instead of
   using the default file mode for the dest file
 * move `std.os.line_sep` to `std.cstr.line_sep`
2018-02-10 21:02:24 -05:00
Andrew Kelley 1fb308ceee self hosted compiler: move tokenization and parsing to std lib 2018-02-09 13:08:02 -05:00
Andrew Kelley aa043a6339 Merge remote-tracking branch 'origin/master' into llvm6 2018-02-07 17:27:30 -05:00
Andrew Kelley 44d8d654a0 fix test failure, organize code, add new compile error 2018-02-05 09:26:39 -05:00
Ben Noordhuis 73ee434c8c Use /dev/urandom and sysctl(RANDOM_UUID) on Linux.
Add fallback paths for when the getrandom(2) system call is not
available.  Try /dev/urandom first and sysctl(RANDOM_UUID) second.

The sysctl issues a warning in the system logs with some kernels but
that seems like an acceptable tradeoff for the fallback of a fallback.
2018-02-04 18:58:36 +01:00
David McFarland 4ec856b0f0 make lld include paths private
This fixes a build failure on cygwin caused by <string.h> -> <strings.h> taking
the latter from one of the lld paths.
2018-02-02 10:49:31 -04:00
Andrew Kelley 4aed7ea6f8 update embedded LLD to 6.0.0rc1 2018-01-17 17:29:21 -05:00
Marc Tiehuis 7a3fd89d25 Add Sha3 hashing functions
These are on the slower side and could be improved. No performance optimizations
yet have been done.

```
Cpu: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
```

-- Sha3-256

```
Zig --release-fast
    93 Mb/s
Zig --release-safe
    99 Mb/s
Zig
    4 Mb/s
```

-- Sha3-512

```
Zig --release-fast
    49 Mb/s
Zig --release-safe
    54 Mb/s
Zig
    2 Mb/s
```

Interestingly, release-safe is producing slightly better code than
release-fast.
2018-01-17 21:19:45 +13:00
Marc Tiehuis fa7b33549e Change crypto functions to fill a buffer
- Rename blake2x -> blake2
 - Fix blake2s truncated tests
2018-01-17 00:17:48 +13:00
Marc Tiehuis 4cf86b4a94 Add Blake2X hash functions
The truncated output variants currently are dependent on a more complete
bigint implementation in the compiler.
2018-01-15 23:14:13 +13:00
Marc Tiehuis 2659ac01be Add Sha2 functions
We take the fastest time measurement taken across multiple runs. Tested
across multiple compiler flags and the best chosen.

```
Cpu: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
Gcc: 7.2.1 20171224
Clang: 5.0.1
Zig: 0.1.1.304f6f1d
```

See https://www.nayuki.io/page/fast-sha2-hashes-in-x86-assembly.

```
Gcc -O2
    219 Mb/s
Clang -O2
    213 Mb/s
Zig --release-fast
    284 Mb/s
Zig --release-safe
    211 Mb/s
Zig
    6 Mb/s
```

```
Gcc -O2
    350 Mb/s
Clang -O2
    354 Mb/s
Zig --release-fast
    426 Mb/s
Zig --release-safe
    300 Mb/s
Zig
    11 Mb/s
```
2018-01-13 22:37:47 +13:00
Marc Tiehuis 51fdbf7f8c Add Md5 and Sha1 hash functions
Some performance comparisons to C.

We take the fastest time measurement taken across multiple runs.

The block hashing functions use the same md5/sha1 methods.

```
Cpu: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
Gcc: 7.2.1 20171224
Clang: 5.0.1
Zig: 0.1.1.304f6f1d
```

See https://www.nayuki.io/page/fast-md5-hash-implementation-in-x86-assembly:

```
gcc -O2
    661 Mb/s
clang -O2
    490 Mb/s
zig --release-fast and zig --release-safe
    570 Mb/s
zig
    50 Mb/s
```

See https://www.nayuki.io/page/fast-sha1-hash-implementation-in-x86-assembly:

```
gcc -O2
    588 Mb/s
clang -O2
    563 Mb/s
zig --release-fast and zig --release-safe
    610 Mb/s
zig
    21 Mb/s
```

In short, zig provides pretty useful tools for writing this sort of
code. We are in the lead against clang (which uses the same LLVM
backend) with us being slower only against md5 with GCC.
2018-01-13 14:40:21 +13:00
Marc Tiehuis 24cd99160c Add hw sqrt for x86_64 2018-01-10 19:53:36 +13:00
Andrea Orru 3182857224 Adding zen support 2018-01-07 04:43:08 -05:00
Andrew Kelley 1b120d1e49 update windows build to llvm 5.0.1
llvm-config.exe does not handle diaguids.lib for us so we have to
duplicate the work.
2018-01-04 22:46:26 -05:00
Andrew Kelley 5a800db48c build: std files and c header files are only specified once
In the CMakeLists.txt file. And then we communicate the list
to the zig build.
2018-01-03 19:39:04 -05:00
Josh Wolfe 192a039173 move utf8 parsing to std
source files no longer need to end with a newline
2017-12-26 23:17:33 -07:00
Josh Wolfe 08dd1b553b set compile flags for zip_cpp 2017-12-26 18:05:43 -07:00
Andrew Kelley 6fece14cfb self-hosted: build against zig_llvm and embedded LLD
Now the self-hosted compiler re-uses the same C++ code for interfacing
with LLVM as the C++ code.
It also links against the same LLD library files.
2017-12-26 19:44:08 -05:00
Andrew Kelley 4183c6f1a5 move std/debug.zig to a subdirectory
self hosted compiler parser tests do some fuzz testing
2017-12-23 22:15:48 -05:00
Andrew Kelley cf96b6f87b update to LLVM 5.0.1rc2 2017-12-01 13:44:28 -05:00
Andrew Kelley 5a25505668 rename "parsec" to "translate-c" 2017-11-24 14:56:05 -05:00
Andrew Kelley 9e234d4208 breaking change to std.io API
* Merge io.InStream and io.OutStream into io.File
 * Introduce io.OutStream and io.InStream interfaces
   - io.File implements both of these
 * Move mem.IncrementingAllocator to heap.IncrementingAllocator

Instead of:

```
%return std.io.stderr.printf("hello\n");
```

now do:

```
std.debug.warn("hello\n");
```

To print to stdout, see `io.getStdOut()`.

 * Rename std.ArrayList.resizeDown to std.ArrayList.shrink.
2017-10-31 04:47:55 -04:00
Andrew Kelley 78cb4ce030 Release 0.1.1 2017-10-17 08:50:00 -04:00
Andrew Kelley 79193ffed2 build: fix logic for version when there is a git tag 2017-10-17 08:47:27 -04:00
Andrew Kelley ad07c68504 Release 0.1.0 2017-10-17 08:42:52 -04:00
Andrew Kelley 1d88f9b9a6 appveyor: build with msvc and publish artifacts
See #540
2017-10-16 12:22:13 -04:00
Andrew Kelley d08c57741a ability to make a DLL
See #302
2017-10-16 01:14:28 -04:00
Andrew Kelley f87f98015c 16MB stack size when building with msvc
fixes crash when evaluating user code that hits the branch limit

See #302
2017-10-15 19:04:19 -04:00
Andrew Kelley 0307dc0b77 organize windows utility functions 2017-10-14 16:59:43 -04:00
Andrew Kelley 1563574740 add git rev name to version string when available 2017-10-01 18:34:22 -04:00
Andrew Kelley 1962c8588f implement standard library path search
closes #463
See #302
2017-10-01 18:30:31 -04:00
Andrew Kelley 9636603a3b fix build when no cmake path args specified
broken by 0227becb56
2017-10-01 16:10:35 -04:00
Andrew Kelley 0227becb56 build: escape backslashes in path arguments given to cmake 2017-10-01 14:01:18 -04:00
Andrew Kelley c6295fe9ab remove zigrt
adds test case for #394

partially reverts a32b5929cc
2017-09-30 20:21:57 -04:00
Andrew Kelley cd58b40011 update C headers to clang 5.0.0 2017-09-30 18:20:55 -04:00
Andrew Kelley 845f22101b zig test on 64-bit windows runs 32-bit tests 2017-09-30 14:40:16 -04:00
Andrew Kelley 5c4504e005 disable /W4 on MSVC 2017-09-30 14:00:27 -04:00
Andrew Kelley 9c6e12ac29 compiler-rt: add _aulldiv and _aullrem for i386 windows 2017-09-30 13:58:05 -04:00
Andrew Kelley cba4a9ad4a update std.os.ChildProcess API
* add std.os.ChildProcess.setUserName
 * add std.os.getUserId
2017-09-26 01:01:49 -04:00
Andrew Kelley 41b588547c improvements to windows support
See #302
2017-09-23 18:46:03 -04:00
Andrew Kelley 14cda27b64 depend on embedded SoftFloat-3d instead of __float128
See #302
See #467
2017-09-14 01:46:47 -04:00
Andrew Kelley 57ea6e8c9f fix up msvc stuff to make it work on linux and macos too 2017-09-13 02:40:02 -04:00
Jonathan Marler 67021e2bff Modified cmake to use LLVM imported packages. 2017-09-11 18:27:41 -06:00
Jonathan Marler 7c81cd30de Add support for MSVC 2017-09-11 09:26:26 -06:00