18758 Commits

Author SHA1 Message Date
TwoClocks
22cb693889 reserve correct space for bitfields 2022-05-28 17:31:26 +03:00
Ali Chraghi
0e6285c8fc math: make cast return optional instead of an error 2022-05-27 16:43:33 -04:00
joachimschmidt557
ddd5b57045 stage2 AArch64: complete genTypedValue 2022-05-27 16:43:11 -04:00
Andrew Kelley
4994ac18e4
Merge pull request #11733 from Vexu/stage2
more misc stage2 fixes
2022-05-27 16:20:49 -04:00
Veikka Tuominen
989c0f55e8 stage2: add test for fixed issue 2022-05-27 10:29:24 +03:00
Veikka Tuominen
8bf3e1f8d0 AstGen: preserve inferred ptr result loc for breaks 2022-05-27 10:29:24 +03:00
Veikka Tuominen
e08cdad53b Sema: add error for runtime indexing comptime array 2022-05-27 10:29:15 +03:00
r00ster
b3672e0738 Fix grammatical error
Fixes #11675
2022-05-27 01:00:15 -04:00
Andrew Kelley
83a2c41cd5 fix alignment behavior test case
As demonstrated by this new test case, stage1's functionality is
incorrect since it does not handle slicing from len..len correctly.

stage2 already has the correct behavior here.
2022-05-26 21:58:19 -07:00
Andrew Kelley
4751356d7f clean up some behavior tests
* improve names
 * properly categorize a couple of bug cases
 * mark one as already passing
2022-05-26 21:58:19 -07:00
Andrew Kelley
f2e8c79763 std.Progress.log: adjust API
Now it will fall back to std.debug.print if there is no tty.
2022-05-26 21:58:19 -07:00
Andreas Reischuck
5a8b6149fb
add more corner case tests to float_parse (#11727)
also drop some unused constants

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
2022-05-26 22:05:53 -04:00
Andrew Kelley
41162ed646 stage0: fix -fsingle-threaded CLI arg parsing
closes #11730
2022-05-26 18:59:55 -07:00
Yuto Oguchi
43373e61fa
std.c: Fix incorrect dirent structure (#11602)
d_name is a null-terminated string, but it is not guaranteed that the
last byte of the array is null.
2022-05-26 20:15:51 -04:00
Andrew Kelley
e0a0df5a8a
Merge pull request #11598 from aiotter/master
Add functions from `dirent.h` to std.c
2022-05-26 20:11:54 -04:00
Jonathan Marler
ee1a95b555 fix semantic error with std.os.linux.all_mask
all_mask is a value of type sigset_t, which is defined as an array type
[N]u32.  However, all_mask references sigset_t.len, but, the array type
does not have a len field.  Fix is to use @typeInfo(sigset_t).Array.len
instead.
2022-05-26 19:50:10 -04:00
Hanna
4e918873e7
Rename std.build.Pkg.path to std.build.Pkg.source (#11557) 2022-05-26 19:32:28 -04:00
Andrew Kelley
67d5bfefba std.testing: remove tight coupling with executing zig as child process
This tight coupling causes problems for various targets, requires
hacky "get args" functionality, and bungles relative file system paths,
making invalid assumptions about the zig-cache directory.

In short, these are not unit tests; these should be standalone tests
instead.

Reverts e5d4a694ea7dd251e10d6434c9321b5e0a548d4b
Reverts d976456ef665bf0aba3a83a8e7fccb4a92b2d3b2
Reverts dbbda0f41a7c5e214801925f8447a15193c3c731
Closes #11542
2022-05-26 16:22:47 -07:00
Andrew Kelley
ba426f0a54
Merge pull request #10197 from vrischmann/io_uring-provide_buffers
io_uring: implement automatic buffer selection
2022-05-26 18:39:17 -04:00
Jakub Konka
326b2aa27b
Merge pull request #11729 from ziglang/fix-test-harness
test: correctly track identical error msgs in handled errors list
2022-05-26 21:00:40 +02:00
joachimschmidt557
7deae07101 std.PriorityQueue: fix missing siftUp in remove
When the replacement node is smaller than its parent, we need to sift
up instead of sifting down.
2022-05-26 14:50:24 -04:00
Jakub Konka
5ce9c878cf apply Vexu's suggestion to use failing_allocator for now 2022-05-26 16:55:31 +02:00
Jakub Konka
d1e4600675 test: correctly track identical error msgs in handled errors list
Prior to this change, for an example compiler error test case with
multiple identical errors messages such as

```
:1:2: error: foo
:1:2: error: foo
```

the test harness would never increment the error index thus only
marking the very first error message as handled yielding a false
positive.

Additionally, while here, regress `dereference_anyopaque` test case
as not passing on `wasm32-wasi` target.
2022-05-26 16:23:56 +02:00
Frank Denis
b08d32ceb5 crypto/25519: add scalar.random(), use CompressedScalar type
Add the ability to generate a random, canonical curve25519 scalar,
like we do for p256.

Also leverage the existing CompressedScalar type to represent these
scalars.
2022-05-26 13:30:03 +02:00
Jakub Konka
01607b54fc
Merge pull request #11722 from ziglang/stage2-behavior
stage2: enhance array concatenation and multiplication
2022-05-26 13:28:30 +02:00
Veikka Tuominen
92c4e4f2c2 Sema: zirArrayType does need source location 2022-05-26 13:26:55 +03:00
Jakub Konka
90f12a9186
Merge pull request #11723 from koachan/sparc64-codegen
stage2: sparc64: Small refactorings and stack pointer accounting fixes
2022-05-26 12:06:11 +02:00
Jakub Konka
0e0b00fd48 regalloc: use StaticBitSet internally 2022-05-26 12:05:51 +02:00
Koakuma
c5b99267c0 stage2: sparc64: Remove saved_regs_stack_space calculation
SPARC does not have an explicit notion of saving/restoring registers.
The usual windowing mechanism (save/restore/return) already takes care of that
for us.
2022-05-26 13:48:39 +07:00
Koakuma
3923722cc6 stage2: sparc64: Account for stack bias & reserved area in genSetReg
genSetReg with ptr_stack_offset should add the bias and reserved area
before emitting the instruction.
2022-05-26 13:48:29 +07:00
Koakuma
5fa971610e stage2: sparc64: Change binOpImmediate immediates to u12
Sync with the check in binOp.
2022-05-26 13:09:56 +07:00
Koakuma
0310d88d7e stage2: sparc64: Add cmp and mov synthetic instructions 2022-05-26 13:08:39 +07:00
Andrew Kelley
83f69af971 stage2: implement runtime array multiplication
Additionally:

 * Sema: fix array cat/mul not setting the sentinel value
   - This required an LLVM backend enhancement to the handling of the
     AIR instruction aggregate_init that likely needs to be
     propagated to the other backends.
 * Sema: report integer overflow of array concatenation in a proper
   compile error instead of crashing.
 * Sema: fix not using proper pointer address space for array cat/mul
2022-05-25 22:33:48 -07:00
Andrew Kelley
b82081e709 Sema: implement array concatenation with runtime operands 2022-05-25 22:33:48 -07:00
Andrew Kelley
ab88165326 Sema: generic function instantiations inherit branch quota 2022-05-25 23:32:52 -04:00
Andrew Kelley
1dd7109476
Merge pull request #11716 from Vexu/stage2
Stage2 misc fixes
2022-05-25 22:30:08 -04:00
Jakub Konka
97816e3cb8 aarch64: check lo/cc flag for unsigned sub_with_overflow
With this change, we are now correctly lowering `sub_with_overflow`
for signed and unsigned integers of register-sized integers (32-
or 64-bit precisely). We also match LLVM's behavior and so, the
condition flags we now set are:

* unsigned:
  - `add_with_overflow`: `hs`/`cs` (carry set)
  - `sub_with_overflow`: `lo`/`cc` (carry clear)
* signed:
  - `add_with_overflow`/`sub_with_overflow`: `vs` (overflow)
2022-05-25 23:43:45 +02:00
Veikka Tuominen
f409d925ad Sema: check for generic poison in resolveInst 2022-05-25 23:11:13 +03:00
Jakub Konka
39ebfedd2b
Merge pull request #11715 from ziglang/stage2-x64-cond-codes 2022-05-25 20:33:43 +02:00
Helio Machado
e0be22b6c0
std.crypto: cosmetic improvement to AES multiplication algorithm (#11616)
std.crypto: cosmetic improvement to AES multiplication algorithm (#11616)
2022-05-25 19:23:49 +02:00
Veikka Tuominen
eba66f4a58 Sema: handle block.is_typeof in more places 2022-05-25 19:57:44 +03:00
Veikka Tuominen
d214b6bdf0 stage2: packed struct fields do not have a byte offset 2022-05-25 19:57:38 +03:00
Jakub Konka
7000395a7d x64: use new condition codes enum for register with overflow mcv 2022-05-25 17:18:43 +02:00
Jakub Konka
5fb7070642 x64: move from compare_flags_* mcv to eflags with condition codes enum 2022-05-25 17:06:47 +02:00
Veikka Tuominen
b0e8bf15f5 Sema: add error for dereferencing comptime value at runtime 2022-05-25 17:39:55 +03:00
Vincent Rischmann
3c58d3e281 io_uring: replace the readv method with a read on a new ReadBuffer type
readv() is essentially identical to read() except for the buffer type,
this simplifies the API for the caller at the cost of not clearly mapping to the liburing C API.
2022-05-25 13:53:09 +02:00
Vincent Rischmann
acb8af468f io_uring: add tests for automatic buffer selection 2022-05-25 13:53:09 +02:00
Vincent Rischmann
d8798ef0cd io_uring: use the socket test harness 2022-05-25 13:53:09 +02:00
Vincent Rischmann
456716b30d io_uring: add a test harness for server/client TCP socket tests 2022-05-25 13:53:09 +02:00
Vincent Rischmann
270a5039d4 io_uring: change recv() to use a RecvBuffer instead
RecvBuffer is equivalent to ReadBuffer but tailored for recv only.
2022-05-25 13:53:09 +02:00