Wink Saville
634d11ab28
Add add compiler_rt routines for float to signed integer conversion
...
And add std.math.f128_* constants.
The routines are:
__fixdfdi, __fixdfsi, __fixdfti,
__fixsfdi, __fixsfsi, __fixsfti,
__fixtfdi, __fixtfsi, __fixtfti.
These all call fixint which is a generic zig function that does the
conversion:
pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t
There are also a set tests:
__fixdfdi_test, __fixdfsi_test, __fixdfti_test,
__fixsfdi_test, __fixsfsi_test, __fixsfti_test,
__fixtfdi_test, __fixtfsi_test, __fixtfti_test.
2018-12-12 00:21:42 -05:00
Andrew Kelley
4dafdc00d5
zig fmt
2018-11-19 17:28:18 -05:00
Andrew Kelley
9493738e54
Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2
2018-11-19 17:24:41 -05:00
Andrew Kelley
89e82281be
fix incorrect --help text
2018-11-19 13:26:35 -05:00
Andrew Kelley
085d049a08
aarch64 improvements
...
* support C ABI for all return types
* don't include __aeabi_uldivmod & co on aarch64 since
it's 64 bit
2018-11-17 11:21:00 -05:00
Jimmi Holst Christensen
8139c5a516
New Zig formal grammar ( #1685 )
...
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-11-13 05:08:37 -08:00
Andrew Kelley
2b395d4ede
remove @minValue,@maxValue; add std.math.minInt,maxInt
...
closes #1466
closes #1476
2018-10-26 15:01:51 -04:00
Greg V
f3bc1c38bf
Specify 16-byte stack alignment in _start on FreeBSD
2018-10-20 15:21:35 +03:00
Marc Tiehuis
19659c3bd3
freebsd: Fix argc resolution in _start
...
FreeBSD appears to use rdi instead of rsp as in other posix systems.
According to some loose documentation, x86 passes values on the stack,
so amd64 freebsd may be the only exception.
2018-10-20 15:15:01 +03:00
Jimmi Holst Christensen
378d3e4403
Solve the return type ambiguity ( #1628 )
...
Changed container and initializer syntax
* <container> { ... } -> <container> . { ... }
* <exrp> { ... } -> <expr> . { ...}
2018-10-15 09:51:15 -04:00
Andrew Kelley
3e72411db0
C ABI and compiler rt improvements for ARM
...
* add __multi3 compiler rt function. See #1290
* compiler rt includes ARM functions for thumb and aarch64 and
other sub-arches left out. See #1526
* support C ABI for returning structs on ARM. see #1481
2018-10-13 15:18:00 -04:00
Andrew Kelley
84690ee05e
std/special/bootstrap: inline some functions to improve stack traces
2018-10-09 13:16:50 -04:00
Andrew Kelley
5a3c02137e
support building static libraries
...
closes #1493
closes #54
2018-10-09 13:15:14 -04:00
Andrew Kelley
d40c4e7c89
Merge pull request #1429 from shawnl/arm64
...
initial arm64 support
2018-10-06 00:11:39 -04:00
Andrew Kelley
9d4eaf1e07
update std lib API for I/O
...
std.io.FileInStream -> std.os.File.InStream
std.io.FileInStream.init(file) -> file.inStream()
std.io.FileOutStream -> std.os.File.OutStream
std.io.FileOutStream.init(file) -> file.outStream()
remove a lot of error code possibilities from os functions
std.event.net.socketRead -> std.event.net.read
std.event.net.socketWrite -> std.event.net.write
add std.event.net.readv
add std.event.net.writev
add std.event.net.readvPosix
add std.event.net.writevPosix
add std.event.net.OutStream
add std.event.net.InStream
add std.event.io.InStream
add std.event.io.OutStream
2018-09-30 17:28:35 -04:00
Andrew Kelley
4c6f1e614a
remove zig build --init
. add zig init-lib
and zig init-exe
...
init-lib creates a working static library with tests, and
init-exe creates a working hello world with a `run` target.
both now have test coverage with the new "cli tests" file.
closes #1035
2018-09-17 17:11:18 -04:00
Shawn Landden
17cb69cebc
fix elf auxv handling
...
Auxillery vectors are not guaranteed to be in any order, this
just happens to work on x86_64.
2018-09-08 14:47:21 +00:00
Shawn Landden
cba0d76fbc
clone() on arm64
2018-09-08 03:52:28 +00:00
Shawn Landden
342cff28f5
initial arm64 support
2018-09-08 03:52:28 +00:00
Andrew Kelley
832caefc2a
fix regressions
2018-09-02 18:35:32 -04:00
Andrew Kelley
c4b9466da7
Merge pull request #1294 from ziglang/async-fs
...
introduce std.event.fs for async file system functions
2018-08-10 15:51:17 -04:00
Andrea Orru
d2f5e57b68
Merge branch 'master' into zen_stdlib
2018-08-06 01:43:19 -04:00
Andrew Kelley
5dfcd09e49
self-hosted: watch files and trigger a rebuild
2018-08-03 17:22:17 -04:00
Andrew Kelley
4d9964a457
rename error.skip to error.SkipZigTest
...
also print stats at the end of test runner
2018-07-21 23:43:43 -04:00
kristopher tate
df574ccf86
std.special.test_runner.zig: make tests skippable;
...
tracking issue #1274 ;
tests can be skipped by returnning `error.skip` :
2018-07-22 02:20:03 +09:00
Andrew Kelley
3f4d0ecd7e
Merge remote-tracking branch 'origin/master' into m-n-threading
2018-07-09 17:14:42 -04:00
Andrew Kelley
a0c564d762
zig fmt
2018-07-09 01:23:47 -04:00
Andrew Kelley
ced3aae3b2
cleaner output from zig build when there are compile errors
2018-07-07 20:31:50 -04:00
Marc Tiehuis
1eda86e1ad
Clean up outstanding compiler_rt todos
2018-07-03 13:22:12 +12:00
Andrew Kelley
bd282d6cca
Merge pull request #1176 from bnoordhuis/f16-std
...
improve std.math f16 support
2018-07-02 16:03:25 -04:00
Marc Tiehuis
887c97742f
Alignment fix and allow rudimentary f128 float printing
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
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
Ben Noordhuis
27b02413dc
add std.math f16 nan support
...
refs #1122
2018-06-30 01:58:17 +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
Andrew Kelley
5f38d6e2e9
add casting docs, __extenddftf2, and __extendsftf2
2018-06-21 14:44:35 -04:00
Andrew Kelley
c7804277bf
@floatToInt
now has safety-checked undefined behavior
...
when the integer part does not fit in the destination integer type
* Also fix incorrect safety triggered for integer casting an
`i32` to a `u7`. closes #1138
* adds compiler-rt function: `__floatuntidf`
2018-06-19 16:06:10 -04:00
Andrew Kelley
4210f1f6a0
remove bool to int syntax. add @boolToInt
...
add missing docs
See #1061
2018-06-18 03:07:16 -04:00
Andrew Kelley
7912061226
remove integer and float casting syntax
...
* add `@intCast`
* add `@floatCast`
* add `@floatToInt`
* add `@intToFloat`
See #1061
2018-06-17 02:57:07 -04:00
Marc Tiehuis
a369d69c51
Add windows x86_64 i128 abi workaround
2018-06-14 21:18:36 +12:00
Marc Tiehuis
9110140514
Add i128 compiler-rt div/mul support
2018-06-13 22:25:04 +12:00
Andrew Kelley
77678b2cbc
breaking syntax change: orelse keyword instead of ?? ( #1096 )
...
use the `zig-fmt-optional-default` branch to have zig fmt
automatically do the changes.
closes #1023
2018-06-10 01:13:51 -04:00
Andrew Kelley
ec1b6f6673
breaking syntax change: ??x to x.? ( #1095 )
...
See #1023
This also renames Nullable/Maybe to Optional
2018-06-09 23:42:14 -04:00
Andrew Kelley
bd13e757e7
disable deref syntax for unknown length pointers
...
See #770
2018-06-05 23:26:43 -04:00
Andrew Kelley
d21a1922eb
support zig fmt: off
and zig fmt: on
between top level decls
...
closes #1030
closes #1033
2018-06-04 12:15:02 -04:00