Commit Graph

3115 Commits (2759c7951da050d825cf765c4b660f5562fb01a4)

Author SHA1 Message Date
Andrew Kelley 2759c7951d always link against compiler_rt.o even when linking libc
sometimes libgcc is missing things we need, so we always link
compiler_rt and rely on weak linkage to allow libgcc to override.
2018-07-02 14:10:27 -04:00
Josh Wolfe 0206b76351 syntax in build.zig example doc 2018-07-01 22:03:51 -04:00
Josh Wolfe e833a5a24c gitignore docgen test artifacts 2018-07-01 13:47:29 -04:00
Andrew Kelley 4c0e280d6d
Merge pull request #1185 from ziglang/undefined-at-comptime-improvements
Operators now throw a compiler error when operating on undefined values
2018-07-01 01:33:23 -04:00
Jimmi Holst Christensen b182151de5 Fixed line numbers for tests 2018-06-30 21:59:14 +02:00
Jimmi Holst Christensen 055e0fef4e Avoid resolve_const in cmp when instr are not comptime 2018-06-30 21:22:26 +02:00
Jimmi Holst Christensen ecd5e60be9 Expanded the list of operators that catch undefined values at comptime 2018-06-30 20:50:09 +02:00
Jimmi Holst Christensen 42033ea3ca
Merge pull request #1167 from ziglang/comptime-array-by-value
Implement const_values_equal for arrays
2018-06-30 18:58:31 +02:00
Andrew Kelley 3f4b77f561
Merge pull request #1177 from jayschwa/fix-out-of-src-builds
Fix version detection for out-of-source builds
2018-06-30 12:01:47 -04:00
Jimmi Holst Christensen 01bd5c46e1 Revert "ir_resolve_const now checks recursivly for undef values"
This reverts commit 4c3f27ce1e.
2018-06-30 17:35:06 +02:00
Jimmi Holst Christensen 616fe798c8 Revert "contains_comptime_undefined_value should not follow pointers"
This reverts commit 58b1692182.
2018-06-30 17:35:05 +02:00
Marc Tiehuis 887c97742f Alignment fix and allow rudimentary f128 float printing 2018-06-30 21:58:59 +12:00
Marc Tiehuis 951512f5ae compiler_rt: Add CMake entries 2018-06-30 21:58:59 +12:00
Marc Tiehuis 9f48b2ab48 compiler_rt: Remove wrapping add/sub operators where unneeded
Closes #495.
2018-06-30 21:58:59 +12:00
Marc Tiehuis 814a34f263 compiler_rt: Add floattitf/floattidf/floattisf 2018-06-30 21:58:59 +12:00
Marc Tiehuis 53fef94b9f compiler_rt: Add missing install targets 2018-06-30 21:58:59 +12:00
Marc Tiehuis e19fc4a0a3 compiler_rt: Add missing exports 2018-06-30 21:58:59 +12:00
Marc Tiehuis cb7bdc2da1 compiler_rt: Add floatuntitf 2018-06-30 21:58:59 +12:00
Marc Tiehuis 61ebfe6603 compiler_rt: Add floatunditf and floatunsitf 2018-06-30 21:58:59 +12:00
Marc Tiehuis c32b2e45ef compiler_rt: Add floatuntisf 2018-06-30 21:58:59 +12:00
Marc Tiehuis 379950f81d compiler_rt: Add trunc f128 narrowing functions 2018-06-30 21:58:59 +12:00
Jay Weisskopf 25bbb1a8ff Fix version detection for out-of-source builds
Git was called in the build directory and not the source directory.
This works fine when the build directory resides within the source
repository, but doesn't work for out-of-source builds. Example:

```
~/zigbuild$ cmake ../zig
fatal: not a git repository (or any of the parent directories): .git
Configuring zig version 0.2.0+
```

Use Git's `-C <path>` flag to always point to the source directory so
that it doesn't matter where the build directory lives.
2018-06-29 22:22:04 -04:00
Andrew Kelley a3ab4325fd
Merge pull request #1175 from bnoordhuis/zig-test-emit-switch
support --emit in 'test' command
2018-06-29 18:39:19 -04:00
Ben Noordhuis 03f66825d6 support --emit in 'test' command
Support the `--emit` switch in `zig --emit asm test file.zig`.

The command fails because no tests run (no executable is created) but
it emits the requested file.  That seems like a good tradeoff.
2018-06-29 23:32:10 +02:00
isaachier f1c56f7f22 Clarify reason implicit cast does not work for large RHS (#1168)
* Clarify reason implicit cast does not work for large RHS
2018-06-29 14:52:25 -04:00
Andrew Kelley 0874a5ba77 std.atomic.queue - document limitation and add MPSC queue 2018-06-29 14:45:42 -04:00
Jimmi HC 58b1692182 contains_comptime_undefined_value should not follow pointers 2018-06-29 11:34:38 +02:00
Jimmi HC 4c3f27ce1e ir_resolve_const now checks recursivly for undef values 2018-06-29 10:21:43 +02:00
Jimmi HC b1128b18d5 Assert that array is not ConstArraySpecialUndef in const_values_equal 2018-06-29 08:41:16 +02:00
Jimmi HC 3ec38b2494 Implement const_values_equal for array type
* This allows arrays to be passed by value at comptime
2018-06-28 10:34:37 +02:00
Marc Tiehuis 4a35d7eeeb Correct hex-float parsing
Unblocks #495.
2018-06-28 20:12:03 +12:00
Andrew Kelley 2fa588e81d fix coroutine accessing freed memory
closes #1164
2018-06-27 18:45:21 -04:00
Andrew Kelley 19961c50e4 fix comptime @tagName crashing sometimes
closes #1118
2018-06-27 13:15:55 -04:00
Andrew Kelley 6f88ecc9b6 add f16 to langref 2018-06-27 12:59:12 -04:00
tgschultz 3e94347e61 Fix up some std.rand syntax #1161 (#1162)
* Fix old syntax in rand

Ziggurat somehow did not get updated to latest syntax

* Fix broken float casts

f32 float casts somehow not updated to latest syntax
2018-06-27 12:30:15 -04:00
Andrew Kelley 1b4bae6d69
Merge pull request #1159 from bnoordhuis/f16
add f16 type
2018-06-27 12:29:05 -04:00
Ben Noordhuis 440c1d52b4 simplify comptime floating-point @divTrunc
Replace a conditional ceil/floor call with an unconditional trunc call.
2018-06-27 16:20:04 +02:00
Ben Noordhuis fd75e73ee9 add f16 type
Add support for half-precision floating point operations.

Introduce `__extendhfsf2` and `__truncsfhf2` in std/special/compiler_rt.

Add `__gnu_h2f_ieee` and `__gnu_f2h_ieee` as aliases that are used in
Windows builds.

The logic in std/special/compiler_rt/extendXfYf2.zig has been reworked
and can now operate on 16 bits floating point types.

`extendXfYf2()` and `truncXfYf2()` are marked `inline` to work around
a not entirely understood stack alignment issue on Windows when calling
the f16 versions of the builtins.

closes #1122
2018-06-27 16:20:04 +02:00
Ben Noordhuis 1f45075a0e dry floating-point type definitions 2018-06-27 16:20:04 +02:00
Ben Noordhuis 0ebc7b66e6 scope variables in floating point cast tests
Fixes a bug where the result of a @floatCast wasn't actually checked; it
was checking the result from the previous @floatCast.
2018-06-27 16:20:04 +02:00
Andrew Kelley 4de60dde6e langref: explicit cast section 2018-06-26 15:48:42 -04:00
Andrew Kelley 11ca38a4e9 fix crash for optional pointer to empty struct
closes #1153
2018-06-26 15:27:41 -04:00
Andrew Kelley af95e15572 rename get_maybe_type to get_optional_type 2018-06-26 15:11:05 -04:00
Isaac Hier 8e714289ca Fix os_path_join for case where dirname is empty 2018-06-26 13:31:32 -04:00
Andrew Kelley 3290e72833 std.zig.ast: fix incorrect impl of FnProto.firstToken
closes #1151
2018-06-25 11:54:10 -04:00
Andrew Kelley 8866bef92c clean up self hosted main. delete unsupported commands 2018-06-22 01:54:38 -04:00
Andrew Kelley be2a4c42bd
Merge pull request #1149 from ziglang/issue346
fix compiler crash for invalid enum
2018-06-21 21:21:05 -04:00
Andrew Kelley 459d72f873 fix compiler crash for invalid enum
closes #1079
closes #1147
2018-06-21 17:41:49 -04:00
Andrew Kelley 5f38d6e2e9 add casting docs, __extenddftf2, and __extendsftf2 2018-06-21 14:44:35 -04:00
Andrew Kelley 47dd1049c8
Merge pull request #1145 from isaachier/bigint-neg-one-incr-fix
Fix bigint -1 increment operation
2018-06-21 13:40:37 -04:00