gracefu
e1959ccd4e
stage2 x86_64: add instruction encoder helper fn
2021-04-16 15:21:16 +08:00
Evan Haas
d4d21dd46d
translate-c: better handling of int -> enum casts
...
In std.meta.cast when casting to an enum type from an integer type, first
do a C-style cast from the source value to the tag type of the enum.
This ensures that we don't get an error due to the source value not being
representable by the enum.
In transCCast() use std.meta.cast instead of directly emitting the cast
operation since the enum's underlying type may not be known at translation
time due to an MSVC bug, see https://github.com/ziglang/zig/issues/8003
Fixes #6011
2021-04-15 22:46:22 -04:00
Andrew Kelley
ccdf55310b
stage2: properly model miscellaneous failed tasks
...
with error messages that go away after updates
2021-04-15 19:01:55 -07:00
Andrew Kelley
2b2920f599
ci: drone: disable stage2 tests
...
See #8545
2021-04-15 16:20:43 -07:00
LemonBoy
bd4421befe
compiler-rt: Don't pass f16 around as arguments
...
Fixes some failures on AArch64.
f16 was a mistake.
2021-04-15 21:52:08 +02:00
Andrew Kelley
c795e82cbc
ci: windows: update to llvm 12 msvc tarball
2021-04-15 12:40:22 -07:00
Andrew Kelley
c49fe52cb1
ci: update macos tarball to llvm 12
2021-04-15 11:27:02 -07:00
Andrew Kelley
68e69aae2b
build.zig: omit LLVMTableGen from llvm libs
2021-04-15 10:58:53 -07:00
Andrew Kelley
2a6ec2e155
build.zig: update llvm libs
2021-04-15 10:43:39 -07:00
LemonBoy
5bc1dc59e6
compiler-rt: Implement __trunctfhf2
2021-04-15 18:23:09 +02:00
LemonBoy
b29677dd12
compiler-rt: Implement __extendhftf2
2021-04-15 18:21:58 +02:00
LemonBoy
7a4dad7e87
stage1: More precise serialization of f16 values
...
Taking a detour trough a f64 is dangerous as the softfloat library
doesn't like converting sNaN values.
The error went unnoticed as an exception is raised by the library but
the stage1 compiler doesn't give a damn.
2021-04-15 18:17:31 +02:00
LemonBoy
2d00f17d15
test: Add test to ensure signed zeros are properly computed
...
Ensure everything's ok at comptime and runtime.
2021-04-15 18:17:21 +02:00
LemonBoy
8e0b2f0e52
compiler-rt: Fix typo in implementation of fp truncation ops
...
The problem went unnoticed for years, yay.
2021-04-15 18:14:25 +02:00
LemonBoy
f9481402f0
stage1: Fix negation for zero floating point values
...
Toggling the sign by computing 0-x doesn't really work for zero values.
2021-04-15 18:12:11 +02:00
Andrew Kelley
a38042e3ac
ci: windows: proper flags to zig build
2021-04-15 02:02:36 -07:00
Andrew Kelley
fa633a658f
ci: windows: try the dev kit strategy
2021-04-15 01:44:17 -07:00
Andrew Kelley
4a1d3465cc
ci: windows: ranlib take 2
2021-04-15 01:22:42 -07:00
Andrew Kelley
3266f326de
ci: windows: better -DCMAKE_RANLIB option
2021-04-15 01:14:33 -07:00
Andrew Kelley
04b8354702
freebsd: disable failing test
...
See #8538
2021-04-15 00:59:40 -07:00
Andrew Kelley
996193c228
ci: freebsd: don't try to compile with zig cc
2021-04-15 00:51:26 -07:00
Andrew Kelley
a680c7ba98
ci: windows: use llvm-ar.exe from the tarball
2021-04-15 00:41:30 -07:00
Andrew Kelley
c59241bda0
ci: better handle of -mcpu
2021-04-15 00:18:21 -07:00
Andrew Kelley
553fbeba82
ci: better target triple and mcpu cmake args
2021-04-14 23:49:16 -07:00
Andrew Kelley
85755c51d5
ci: freebsd: set the target triple
2021-04-14 23:35:51 -07:00
Andrew Kelley
df319db058
ci: windows: install git
2021-04-14 23:18:03 -07:00
Andrew Kelley
3967823f3a
ci: freebsd: pass -DZIG_USE_LLVM_CONFIG=OFF
2021-04-14 23:17:08 -07:00
Andrew Kelley
ee42178b43
ci: aarch64-linux: disable run-translated-c tests
...
See #8537
2021-04-14 23:10:51 -07:00
Andrew Kelley
45eb9554c4
ci: windows: try using zig-bootstrap to build zig
2021-04-14 23:03:16 -07:00
Andrew Kelley
406353103a
ci: freebsd: update to llvm 12
2021-04-14 22:59:34 -07:00
Andrew Kelley
1438c324a4
ci: update drone CI to llvm 12
2021-04-14 21:18:23 -07:00
Andrew Kelley
391a40d601
ci: update linux to llvm12 tarball
2021-04-14 20:35:33 -07:00
Michael Dusan
6a7f21d1b8
ci: macos-aarch64 update dep tarballs for llvm12
2021-04-14 19:43:17 -07:00
lithdew
81adcd533e
os/posix: handle ECONNRESET for write/writev
2021-04-14 16:40:06 -07:00
Andrew Kelley
5a3ea9bece
Merge remote-tracking branch 'origin/llvm12'
...
Happy LLVM 12 Release Day.
Please note that the llvm 12 tag does not include the latest commit in
the release/12.x branch, which is in fact a bug fix for a regression
that is causing a failure in Zig's test suite.
Zig master branch is tracking release/12.x, and will be enabling the
test that is fixed by that commit.
2021-04-14 14:41:57 -07:00
LemonBoy
2ebd6bd706
std: Fix sqrt for u0/u1 input types
2021-04-14 17:53:27 +02:00
LemonBoy
ebf97627fd
build: Test the c.zig file too
...
* Add some more tests for the sqrt/sqrtf implementations.
The idea is to cross-check the software impl with the HW one whenever
possible.
* Fix a broken test, oops.
2021-04-14 17:53:26 +02:00
Frank Denis
1fada37466
Merge pull request #8518 from akvadrako/doc-field-align
...
Update doc for struct field alignment.
2021-04-14 10:56:37 +02:00
Evan Haas
e761e0ac18
translate-c: wrap switch statements in a while (true) loop
...
This allows `break` statements to be directly translated from the original C.
Add a break statement as the last statement of the while loop to ensure we
don't have an infinite loop if no breaks / returns are hit in the switch.
Fixes #8387
2021-04-13 11:45:03 -07:00
Jakub Konka
36a33c99e3
Merge pull request #8517 from ziglang/zld-archive-fix
...
zld: fix symbol resolution from interdependent static archives
2021-04-13 17:12:26 +02:00
Devin Bayer
ca3aa02206
Update doc for struct field alignment.
2021-04-13 14:53:44 +02:00
Jakub Konka
461543a5fd
zld: fix symbol resolution from interdep archives
...
Fixes symbol resolution if an archive occurring later in the linker
line depends on a object embedded within the archive that occurred
before.
2021-04-13 13:36:08 +02:00
Jakub Konka
65e4725aba
Add standalone test for interdep C archives
...
Tests a scenario where the linker line has the following:
```
main.o libA.a libB.a
```
where `main.o` pulls a symbol from `libB.a`, which in turn is
dependent on a symbol from `libA.a`.
2021-04-13 13:32:59 +02:00
Jakub Konka
a5bbc66f10
zld: cleanup redundant changes
2021-04-13 10:56:03 +02:00
Jakub Konka
db30033de2
zld: rebase to new naming conv for aarch64
2021-04-13 10:56:03 +02:00
Jakub Konka
1119970d22
zld: add x86_64 relocs
2021-04-13 10:56:03 +02:00
Jakub Konka
b1f9db75f3
zld: save locals per TU
2021-04-13 10:56:03 +02:00
Jakub Konka
3b7c9dd6bd
zld: differentiate between static and global in stabs
2021-04-13 10:56:03 +02:00
Jakub Konka
717d382871
zld: streamline tags for Symbol
2021-04-13 10:56:03 +02:00
Jakub Konka
b377e0b370
zld: fix indirect symtab
2021-04-13 10:56:03 +02:00