Andrew Kelley
d2f5d0b199
std.crypto.Tls: parse the ServerHello handshake
2023-01-02 16:57:15 -07:00
Andrew Kelley
ba44513c2f
std.http reorg; introduce std.crypto.Tls
...
TLS is capable of sending a Client Hello
2023-01-02 16:57:15 -07:00
Andrew Kelley
cd0d514643
remove the experimental std.x namespace
...
Playtime is over. I'm working on networking now.
2023-01-02 16:57:15 -07:00
Andrew Kelley
ebcfc86bb9
Compilation: better error message for file not found
2023-01-02 16:57:15 -07:00
Andrew Kelley
c1f404ad53
Compilation: fix merge conflict with previous commit
2023-01-02 16:41:13 -07:00
Andrew Kelley
9bcd48e40e
Revert "make a .rsp file for zig clang"
...
This reverts commit 9db293492bbbc5b8d70638bd9c59dea19d13596c.
It's not OK to call `realpath` in the compiler.
Reopens #12419
2023-01-02 16:31:45 -07:00
Andrew Kelley
df5fcf5432
Merge pull request #14159 from Vexu/err-fix
...
Sema: prevent spurious "depends on itself" errors
2023-01-02 17:37:27 -05:00
Andrew Kelley
0b99c83c21
fix behavior test compile error
...
I bungled the commit 995c36dcb1a82c3ec9cbd0cd7bfbadd5c0abd10e during the
merge. Sorry about that.
2023-01-02 15:02:33 -07:00
Andrew Kelley
4c1007fc04
Merge pull request #14002 from kcbanner/cbe_msvc_compatibility
...
CBE: MSVC-compatible code generation, and fixes to get behaviour tests passing and zig2.c building
2023-01-02 16:11:17 -05:00
Andrew Kelley
23b1544f6c
update zig1.wasm for MSVC compatibility
2023-01-02 14:09:26 -07:00
Andrew Kelley
995c36dcb1
avoid testing inline for in unrelated behavior tests
2023-01-02 14:09:01 -07:00
Andrew Kelley
72560b8db5
add some comments to explain workarounds
2023-01-02 14:08:50 -07:00
kcbanner
4776128099
skip "atomicrmw with 128-bit ints" on everything except cbe
2023-01-02 13:56:32 -07:00
kcbanner
8ebf18635c
skip "atomicrmw with 128-bit ints" on linux x64_64 due to linker error
2023-01-02 13:56:32 -07:00
kcbanner
50c31e5caa
skip "truncate int128" on wasm
2023-01-02 13:56:32 -07:00
kcbanner
fc84b233ee
skip "truncate to non-power-of-two integers from 128-bit" on non-llvm
2023-01-02 13:56:32 -07:00
kcbanner
c2f5c3bc4e
skip "binary not 128-bit" on non-llvm
2023-01-02 13:56:32 -07:00
kcbanner
45a55df12c
cbe: fixups for -Wstrict-prototypes
2023-01-02 13:56:32 -07:00
kcbanner
9c951cc874
fmt fixups
2023-01-02 13:56:32 -07:00
kcbanner
cac652f81b
cbe: fixup cpuid on non-msvc
2023-01-02 13:56:17 -07:00
kcbanner
ccf0ab0ef6
cbe: use callconv(.C) for zig.g stub functions, use zig.h function for windows teb instead of syscall
2023-01-02 13:56:11 -07:00
kcbanner
9c70315854
tests: add more coverage for 128 bit operations
...
- fixup 128-bit atomics test to only run on x86_64
- add truncation test for 128-bit types, including non power of two targets (there was a bug with broken non-power-of-two truncation in the cbe)
- add 128-bit binary not test (covers another bug fixed in the cbe)
2023-01-02 13:55:45 -07:00
kcbanner
0251ce1e1b
compiler_rt: skip "__udivei4/__umodei4" on cbe due to missing > 128 bit integer support
2023-01-02 13:55:45 -07:00
kcbanner
6cab3c304e
cbe: be more explicit about x86 special cases
2023-01-02 13:55:45 -07:00
Veikka Tuominen
b048fa4f13
Sema: prevent spurious "depends on itself" errors
...
Closes #14059
2023-01-02 19:23:09 +02:00
Veikka Tuominen
332a43858a
Sema: @intToEnum on non-exhaustive enum at comptime should check int is in range
...
Closes #14155
2023-01-02 17:06:06 +02:00
kcbanner
676e4f3824
cbe: changes to get zig2.c compiling under msvc
...
- Add cpuid / getXCR0 functions for the cbe to use instead of asm blocks
- Don't cast between 128 bit types during truncation
- Fixup truncation to use functions for shifts / adds
- Fixup float casts for undefined values
- Add test for 128 bit integer truncation
2023-01-01 16:44:29 -05:00
kcbanner
f07d33f54b
cbe: fixes for compiling zig2.c under msvc
...
- add zig_mul_i128
- render slice structs in static initializers without casts / c99 style init
- add negative numbers and u128 to 128-bit multiply test
2023-01-01 16:44:29 -05:00
kcbanner
55c3551bef
cbe: fixup 64 bit float atomics
2023-01-01 16:44:29 -05:00
kcbanner
7a20e7589e
stage1: update zig1.wasm
2023-01-01 16:44:29 -05:00
kcbanner
5d59799641
cbe: add msvc flt atomics, re-enable test
2023-01-01 16:44:29 -05:00
kcbanner
6ed049fe36
cbe: all behaviour tests now pass on msvc
...
- Fix zig_clz_u128 not respecting the bits argument. This was crashing the compile-rt addxf3 tests with the cbe
- Instead of redering a negation for negative 128 bit int literals, render the literal as twos complement. This allows
rendering int representations of floats correctly (specifically f80).
2023-01-01 16:44:29 -05:00
kcbanner
6445196fab
tests: disable function alignment test for cbe, add 128-bit atomicrmw tests
2023-01-01 16:44:29 -05:00
kcbanner
7b999dae73
cbe: special float macros passthrough to builtins if available, but fallback to conversion from repr if not
2023-01-01 16:44:29 -05:00
kcbanner
5470708a89
cbe: implement 128 bit atomic operations with cmpxchg loops
...
- Enable 128 bit atomic int tests for the cbe only
2023-01-01 16:44:29 -05:00
kcbanner
d63b8d21b3
cbe: implement missing atomic builtings using cmpxchg loops
2023-01-01 16:44:29 -05:00
kcbanner
5b8245d35a
tests: update "atomicrmw with ints" to test u8 through u64
2023-01-01 16:44:29 -05:00
kcbanner
047fe58a53
cbe: fix msvc cmpxchg implementations
2023-01-01 16:44:28 -05:00
kcbanner
4f8f7b749c
cbe: fixup incorrect bits value in 128 bit add/sub
2023-01-01 16:44:28 -05:00
kcbanner
b6f0af57a2
cbe: fix shl/shr
...
- zig_shr_u128 was actually shifting left
- handle shifting by zero explicitly (shifting u64 by 64 is undefined behaviour)
2023-01-01 16:44:28 -05:00
kcbanner
2d34477dbb
cbe: msvc atomics
...
- Implement most atomic operations for msvc
- Disable "atomicrmw with floats" test for cbe
2023-01-01 16:44:28 -05:00
kcbanner
f155ef2f4b
cbe: implementing 128 bit math functions for !zig_has_int128
...
- Add addo_(i|u)128, subo_(i|u)128, mulo_(i|u)128,
- Move zig_shlo_(i|u)128 into common code
- Fixup zig_shls_i128 passing rhs as 128
2023-01-01 16:44:28 -05:00
kcbanner
fbd3459a52
compiler_rt: fixup divti3 and fixunshfti
2023-01-01 16:44:28 -05:00
kcbanner
9a77743cc7
cbe: add doNotOptimizeAwayC to handle not having __asm support in msvc
2023-01-01 16:44:28 -05:00
kcbanner
b86a8b4a5b
cbe: airNot emits zig_not_ calls for integers
2023-01-01 16:44:28 -05:00
kcbanner
3d4ff4fdda
cbe: 32 bit fixup for update-zig1
2023-01-01 16:44:28 -05:00
kcbanner
7fb3683c32
cbe: more msvc compatibility work
...
- Add .StaticInitializer to ValueRenderLocation to indicate that the emitted values
must be constant expressions (no function calls, struct casting).
- Add new path for special float types (nan, inf) that works in constant expressions
- Implement windows.teb() using a syscall for .stage2_c because x64 MSVC
doesn't support any kind of inline asm
2023-01-01 16:44:28 -05:00
kcbanner
7f3bc45772
cbe: nan builtins on msvc, fixup C2099 errors in static initializers
...
- Map the __builtin_nan(f|l)? functions to nan(f|l)? on msvc
- MSVC throws C2099 when initializing a struct with cast syntax
in a global initializer. Added zig_as_init_ to handle this case,
and generate it only in static initializers for > 64 bit ints.
- Change float initialization to emit the integer representation
in global initializers to avoid C2099 caused by calling nan.
2023-01-01 16:44:28 -05:00
kcbanner
4fe71977e0
temporarily disable asm tests
2023-01-01 16:44:28 -05:00
kcbanner
351025dc05
cbe: msvc compatible int casting inside renderValue .Packed branch
...
- Handle non-abiInt source types (like packed union) as sources in renderIntCast
2023-01-01 16:44:28 -05:00