19 Commits

Author SHA1 Message Date
LemonBoy
0d6a7088dc stage1: Implement Add/Mul reduction operators 2020-11-01 14:30:31 -07:00
Andrew Kelley
e6ac082437
Merge pull request #6744 from LemonBoy/intcast-vec
stage1: Implement `@intCast` between vectors
2020-10-22 17:36:18 -04:00
LemonBoy
2f465761bb stage1: Implement @intCast between vectors
Explicit and implicit integer casts on vector types are now supported
and follow the same rules as their scalar counterparts.

Implicit float casts are accidentally supported, `@floatCast` is still
not vector-aware.
2020-10-19 20:05:09 +02:00
LemonBoy
2a256d5ea0 stage1: Fix type-checking of unary neg for vector types
Validate the vector element type as done for the scalar case.

Fixes #6708
2020-10-17 21:08:39 -04:00
LemonBoy
f78380b936 stage1: Don't ask LLVM to emit misaligned memcpy
Pay close attention to the RHS type alignment when rendering an
assignment op as it may differ from the LHS pointer one.

This problem was noticed when debugging a CI failure in #6648: due to
sheer luck the misalignment caused a segfault on macos that was also
reproduced locally.

I tried to write a small test case but it turned out to be a daunting
task as I couldn't manage to trigger the problem consistently (and stop
the optimizer from simplifying everything). Patches welcome.
2020-10-16 18:39:48 -04:00
LemonBoy
0570df69b1 stage1: Fix missing runtime safety check for intToPtr
Elide the alignment check if the pointer alignment is one, the null
check must be preserved as it depends on the pointer type.

Fixes #6667
2020-10-14 00:05:50 -04:00
Andrew Kelley
8b7539bd95 Merge remote-tracking branch 'origin/master' into llvm11
Conflicts:
  src/clang.zig

Master branch renamed an enum; this branch gave it an explicit tag type
and explicitly initialized values. This commit combines the changes
together.
2020-10-08 15:47:45 -07:00
Tadeo Kondrak
0a6863a267 Remove .Cold calling convention.
This isn't a stable, defined calling convention, so it shouldn't be
grouped in with the others.

Closes https://github.com/ziglang/zig/issues/6556
2020-10-07 04:31:20 -04:00
Andrew Kelley
b5a36f676b Merge remote-tracking branch 'origin/master' into llvm11
Conflicts:
  cmake/Findllvm.cmake

The llvm11 branch changed 10's to 11's and master branch added the
"using LLVM_CONFIG_EXE" help message, so the resolution was to merge
these changes together.

I also added a check to make sure LLVM is built with AVR enabled, which
is no longer an experimental target.
2020-10-07 00:46:05 -07:00
Andrew Kelley
939b4860ef
Merge pull request #6472 from alexnask/add_some_frees
Add a few missing deallocations of temporaries to stage1
2020-10-05 04:56:58 -04:00
LemonBoy
22b5e47839 stage1: Implement @reduce builtin for vector types
The builtin folds a Vector(N,T) into a scalar T using a specified
operator.

Closes #2698
2020-10-05 04:51:45 -04:00
Alexandros Naskos
23cd3b3331 Merge branch 'master' of https://github.com/ziglang/zig into add_some_frees 2020-10-04 10:39:26 +03:00
Andrew Kelley
2de53592a1 stage1: better value for builtin.link_mode
Now it is Dynamic unless -DZIG_STATIC=on is passed to cmake.

This partially addresses #6469.
2020-10-03 23:15:45 -07:00
Alexandros Naskos
82f0ede3ad Added some c_allocator.deallocate calls 2020-09-30 19:59:49 +03:00
Alexandros Naskos
cb5d290f33 Added a few ZigList deinit calls 2020-09-30 17:09:18 +03:00
Andrew Kelley
7067764ed3 Merge remote-tracking branch 'origin/master' into llvm11
The changes to install_files.h needed to put into src/libcxx.zig
2020-09-30 02:55:41 -07:00
Andrew Kelley
91a73a177b stage2: building mingw-w64 and COFF LDD linking
still TODO is the task of creating import .lib files for DLLs on the fly
both for -lfoo and for e.g. `extern "kernel32"`
2020-09-28 00:06:06 -07:00
Andrew Kelley
6af2990549 implement -femit-asm, -femit-docs, -femit-llvm-ir, etc
These CLI options are now forwarded to the stage1 backend.

We're not going to support the -mllvm CLI option any longer. As a
compromise, we unconditionally tell LLVM to output intel x86 syntax when
using -femit-asm.

Simplify stage1 logic; it no longer has the concept of an output
directory. --output-dir is no longer a valid CLI option. cmake uses
the `-femit-bin=[path]` option.

Note the changes to test/cli.zig. This breaks the CLI API that Godbolt
is using so we're going to want to open a PR to help them upgrade to the
new CLI for the upcoming Zig 0.7.0 release.
2020-09-26 01:47:27 -07:00
Andrew Kelley
528832bd3a rename src-self-hosted/ to src/ 2020-09-21 18:38:55 -07:00