Commit Graph

1478 Commits

Author SHA1 Message Date
Andrew Kelley
105a09e1d6 fix invalid llvm IR for const enum
closes #394
2017-08-26 00:34:40 -04:00
Andrew Kelley
234030c37a update build to look for llvm 5.0 2017-08-26 00:34:40 -04:00
Andrew Kelley
8f57544410 update travis for llvm 5 2017-08-26 00:34:40 -04:00
Andrew Kelley
2bd6c60752 update for llvm 5.0.0rc1 2017-08-26 00:34:40 -04:00
Andrew Kelley
6aa04c422b float division by zero check only when FloatMode.Optimzed
closes #395
2017-08-25 20:44:32 -04:00
Andrew Kelley
a0223e513f add zig-compiler-completions to Related Projects 2017-08-25 20:14:33 -04:00
Andrew Kelley
db613d38f0 implement comptime bitcasting from array 2017-08-25 20:05:10 -04:00
Andrew Kelley
4d8269f69f fix some casts on const data causing segfault 2017-08-25 19:54:20 -04:00
Andrew Kelley
754f7809e3 refactor - codegen llvm functions lazily 2017-08-25 13:13:07 -04:00
Andrew Kelley
629aa10c56 unreachable still codegens to unreachable in ReleaseFast test mode
closes #430
2017-08-25 10:20:06 -04:00
Andrew Kelley
5dddb45ec7 fix compiler test errors
closes #428

Thanks Marc Tiehuis for diagnosing this bug
2017-08-22 11:54:58 -04:00
Andrew Kelley
0a922d3bca move docs to website 2017-08-20 17:30:02 -04:00
Andrew Kelley
d5271d1e49 more zen 2017-08-20 12:10:21 -04:00
Andrew Kelley
be16034275 std.math: remove constants that can be derived
from others at compile time
2017-08-20 05:43:40 -04:00
Andrew Kelley
f248ef5f3f move zen of zig to a sub command 2017-08-20 04:25:42 -04:00
Andrew Kelley
d9dd50d74c fix not propagating parseh aliases through pub use decls 2017-08-20 04:03:36 -04:00
Andrew Kelley
8e19bdfc79 zen update 2017-08-20 03:24:28 -04:00
Andrew Kelley
09bd4a9a86 compile-time f32, f64 operations are now correctly lossy
previously we used the bigfloat abstraction to do all
compile-time float math. but runtime code and comptime code
are supposed to get the same result. so now if you add a
f32 to a f32 at compile time it does it with f32 math
instead of the bigfloat. float literals still get the
bigfloat math.

closes #424
2017-08-20 01:04:51 -04:00
Andrew Kelley
c73a0c92d0 fix floating point printing 2017-08-19 19:11:43 -04:00
Andrew Kelley
caaeab9882 add setEvalBranchQuota builtin function 2017-08-19 17:10:29 -04:00
Andrew Kelley
eb26aeb1e5 std: better int log2 implementation for number literals 2017-08-19 02:29:18 -04:00
Andrew Kelley
cd2f65ff6a add compile error for globally shadowing a primitive type
closes #423
2017-08-19 02:02:25 -04:00
Andrew Kelley
987768778a bit shifting safety
* add u3, u4, u5, u6, u7 and i3, i4, i5, i6, i7
 * shift operations shift amount parameter type is
   integer with log2 bit width of other param
   - This enforces not violating undefined behavior on
     shift amount >= bit width with the type system
 * clean up math.log, math.ln, math.log2, math.log10

closes #403
2017-08-19 01:43:43 -04:00
Andrew Kelley
558ece8f6f slightly nicer floating point printing 2017-08-18 18:05:28 -04:00
Andrew Kelley
33c592e981 make udivmod generic and add tests 2017-08-18 17:20:03 -04:00
Andrew Kelley
51bde26842 add compiler-rt fns: udivmodti4, udivti3, umodti3 2017-08-18 16:26:09 -04:00
Andrew Kelley
ea9e1639ca include compiler-rt tests in main testing suite 2017-08-18 13:51:16 -04:00
Andrew Kelley
0aa36e882e remove dependency on quadmath.h 2017-08-18 13:28:59 -04:00
Andrew Kelley
b73d4f74c2 depend on libquadmath
it seems to be shipped with gcc and clang
2017-08-18 13:13:03 -04:00
Andrew Kelley
e1c225694d cast between __float128 and double to fix build in some places 2017-08-18 12:43:48 -04:00
Andrew Kelley
3a762e5a8d make casting between __float128 and long double explicit 2017-08-18 12:37:01 -04:00
Andrew Kelley
1b5d61bee9 fix bitCast for big integers
and make bigfloat use __float128
2017-08-17 22:52:12 -04:00
Andrew Kelley
2173e1f457 fix big integer shifting by large number 2017-08-17 22:01:19 -04:00
Andrew Kelley
e63d864c1e add compiler_rt functions for f128
* __letf2
 * __cmptf2
 * __getf2
 * __unordtf2
 * __eqtf2
 * __lttf2
 * __netf2
 * __gttf2
2017-08-17 19:10:15 -04:00
Andrew Kelley
0d117bb0a9 fix wrong value for clz, ctz at compile time
closes #418

also make clz, ctz return smaller integer bit widths
and use smaller integer bit widths for enum tag types
2017-08-17 17:14:35 -04:00
Andrew Kelley
6a98bf3dba compiler_rt implementations for __fixuns* functions
* add u128 and i128 integer types
 * add f128 floating point type
 * implement big integer multiplication (See #405)
2017-08-16 19:07:35 -04:00
Andrew Kelley
cf46cd5f2b organize file path of compiler_rt 2017-08-15 07:16:22 -04:00
Andrew Kelley
38f898e9c7 update gitignore 2017-08-14 13:29:18 -04:00
Andrew Kelley
dea90e20e6 fix tokenization error pointing to wrong character
closes #401
2017-08-14 13:28:42 -04:00
Andrew Kelley
ba7b5daa22 Merge pull request #417 from zig-lang/coverage-fix
Fix coverage build command
2017-08-10 16:26:54 -04:00
Marc Tiehuis
3a0bfeb9d2 Fix coverage build command
Seems like this was deleted at some stage.

coverage command works as expected once removed. Do correct me if I've missed something, though.
2017-08-10 19:24:50 +12:00
Andrew Kelley
35d3444e27 more intuitive left shift and right shift operators
Before:
 * << is left shift, not allowed to shift 1 bits out
 * <<% is left shift, allowed to shift 1 bits out
 * >> is right shift, allowed to shift 1 bits out

After:
 * << is left shift, allowed to shift 1 bits out
 * >> is right shift, allowed to shift 1 bits out
 * @shlExact is left shift, not allowed to shift 1 bits out
 * @shrExact is right shift, not allowed to shift 1 bits out

Closes #413
2017-08-09 10:09:38 -04:00
Andrew Kelley
54675b060a add ptrToInt builtin, remove usize(ptr) cast
closes #415
2017-08-08 17:38:25 -04:00
Andrew Kelley
9ca798bc75 zen update 2017-08-08 15:49:12 -04:00
Andrew Kelley
221e5b188c README: add the zen of zig 2017-08-07 19:11:55 -04:00
Andrew Kelley
f78ee53484 fix printing floating point compile errors
now we just need compiler_rt implementations for:

 undefined symbol '__fixunsdfti'
 undefined symbol '__umodti3'
 undefined symbol '__udivti3'
2017-08-07 18:11:24 -04:00
Andrew Kelley
2234788fa8 add ability to explicitly cast float to integer
closes #414
2017-08-07 15:57:41 -04:00
Andrew Kelley
38b47d8aca Merge pull request #412 from zig-lang/issue-399
Correct floating-point literal allowed ranges
2017-08-07 09:15:13 -04:00
Marc Tiehuis
0705b711f8 Correct floating-point literal allowed ranges
The exponent range for floating-point values is [-1022, 1023].

Fixes #399.
2017-08-07 18:08:09 +12:00
Andrew Kelley
d8227c79a2 limit generated C preprocessor tokens to alphabet
closes #407

The mangling strategy replaces bytes outside the alphabet
with "_xx_" where xx is the hex code of the byte.
2017-08-06 19:31:05 -04:00