Commit Graph

1428 Commits

Author SHA1 Message Date
Andrew Kelley 9845264a0b aarch64: less feature-full baseline CPU 2020-01-22 18:40:34 -05:00
Andrew Kelley 3227aec848 fix not respecting sub-arch feature 2020-01-22 17:35:57 -05:00
Andrew Kelley 48c7e6c48b std.Target.CpuFeatures is now a struct with both CPU and feature set
Previously it was a tagged union which was one of:
 * baseline
 * a specific CPU
 * a set of features

Now, it's possible to have a CPU but also modify the CPU's feature set
on top of that. This is closer to what LLVM does.

This is more correct because Zig's notion of CPUs (and LLVM's) is not
exact CPU models. For example "skylake" is not one very specific model;
there are several different pieces of hardware that match "skylake" that
have different feature sets enabled.
2020-01-22 17:13:31 -05:00
Andrew Kelley 830e0ba2d2 enable native CPU feature for windows; disable failing tests
See #508. These can be re-enabled when we upgrade to LLVM 10.
2020-01-21 21:46:06 -05:00
Andrew Kelley 6e6ec3d71d put hack back in to disable windows native cpu features
See #508. This can be removed when we upgrade to LLVM 10.
2020-01-21 21:01:36 -05:00
Andrew Kelley 92559cd02c hit a comptime limitation with computing dense sets 2020-01-21 19:40:44 -05:00
Andrew Kelley 1f7babbc80 properly forward baseline target cpu features to llvm 2020-01-21 03:01:20 -05:00
Andrew Kelley a867b43366 progress towards merging
see BRANCH_TODO file
2020-01-19 20:54:04 -05:00
Layne Gustafson c15623428e Pass target_details to child CodeGens 2020-01-19 20:53:20 -05:00
Layne Gustafson 62e4cc06fe Pass target details to c compiler 2020-01-19 20:53:20 -05:00
Layne Gustafson fd17a9962b Add defaut feature support 2020-01-19 20:53:20 -05:00
Layne Gustafson 03dd376b55 Add builtin.zig support 2020-01-19 20:53:19 -05:00
Layne Gustafson c61856ebcf Add TargetDetails abstraction 2020-01-19 20:53:19 -05:00
Layne Gustafson b3324f1901 Add cpu/feature to cache hash 2020-01-19 20:53:19 -05:00
Layne Gustafson bd6ef21f85 Add cpu/feature specification to cmndline 2020-01-19 20:53:19 -05:00
Andrew Kelley b5ac079f88 Merge pull request #4191 from Vexu/non-exhaustive-enums
Implement non-exhaustive enums
2020-01-17 14:26:12 -05:00
Vexu df03fcf5f0 implement @bitSizeOf 2020-01-16 13:13:45 -05:00
Vexu d84569895c turn panics into compile errors, require at least 1 field in non-exhaustive enum 2020-01-16 09:04:11 +02:00
Vexu 5c2238fc4a small fixes
* error for '_' prong on exhaustive enum
* todo panic for `@tagName`  on non-exhaustive enum
* don't require '_' field on tagged unions
2020-01-15 22:09:19 +02:00
Michael Dusan 0a41051955 stage1: move local native_libc.txt to global
Automatic creation of `native_libc.txt` now occurs only in global
cache. Manual creation/placement into local cache is supported.

closes #3975
2020-01-15 13:42:12 -05:00
Vexu 6fd0dddf18 implement non-exhaustive enums 2020-01-15 20:24:59 +02:00
LemonBoy 505b9db909 Fix codegen error for some union initializers
Closes #3377
2020-01-14 14:57:03 -05:00
LemonBoy cae93c860b Allow switching on pointer types
Closes #4074
2020-01-13 22:18:49 +01:00
LemonBoy 95619ecb8c Stop dropping errors from clang
* Refactor the error-writing code to be more compact and flexible
2020-01-11 15:48:32 -05:00
LemonBoy 84e98405de Inform the debugger about the effective type sizes
Makes every debugger happy and closes #2685
2020-01-10 16:42:49 -05:00
LemonBoy 5ab5de89c0 New @export() handling
Use a struct as second parameter to be future proof (and also allows to
specify default values for the parameters)

Closes #2679 as it was just a matter of a few lines of code.
2020-01-09 13:43:06 -05:00
Andrew Kelley af390b75db cleanups related to --eh-frame-hdr 2020-01-07 16:02:38 -05:00
David Cao 8e57dd57ca add --eh-frame-hdr conditionally 2020-01-07 15:58:40 -05:00
Andrew Kelley 5951b79af4 remove stdcallcc, extern, nakedcc from stage1; zig fmt rewrites 2020-01-06 15:23:05 -05:00
Andrew Kelley 0a9daeb37e Merge branch 'cc-work' of https://github.com/LemonBoy/zig into LemonBoy-cc-work 2020-01-06 14:07:56 -05:00
Andrew Kelley 14fcfe2981 translate-c supports --cache on
this will be used to provide a zig build step
2020-01-03 22:11:19 -05:00
Andrew Kelley 213ff939f1 fix comptime vector float ops and add test coverage
also rename `@ln` to `@log` to match libc convention.
2020-01-02 14:01:48 -05:00
LemonBoy 435528a7c5 Use the LLVM C++ API 2020-01-02 18:57:09 +01:00
LemonBoy 0ccac79c8e Implement Thiscall CC 2020-01-02 18:57:08 +01:00
LemonBoy 271fc6a247 Catch more errors during the type resolution phase
Returning the uninitialized/stale error condition made the compiler turn
a blind eye to some problems.
2020-01-02 18:53:20 +01:00
LemonBoy 563d9ebfe5 Implement the callconv() annotation 2020-01-02 18:53:16 +01:00
Andrew Kelley cb56b26900 fix float ops with respect to vectors
also remove the redundant type parameter
2020-01-01 23:27:43 -05:00
Andrew Kelley 39ee3bc0ec Merge branch 'stage-2-cimport' of https://github.com/Vexu/zig into Vexu-stage-2-cimport 2019-12-31 16:55:41 -05:00
Andrew Kelley 73e535e112 Merge pull request #3683 from Vexu/atomic-float
Support floats with some atomic operations
2019-12-30 19:19:05 -05:00
LemonBoy 28a8ded95a Resolve more types as needed
Closes #3994
2019-12-30 17:45:09 -05:00
Vexu fceda07f94 use self hosted translate-c for cimports 2019-12-29 11:04:45 +02:00
Vexu ab7fc33c83 add zig llvm wrapper for atomicrmw 2019-12-23 11:55:00 +02:00
Vexu 8bb1e04449 support some atomic operations with floats 2019-12-23 11:54:47 +02:00
Andrew Kelley 8d73703d52 fix safety for sentinel-slicing floats 2019-12-20 18:28:59 -05:00
Andrew Kelley 8918cb06fc sentinel slicing improvements
* add runtime safety for slicing pointers, arrays, and slices.
 * slicing without a sentinel value results in non-sentineled slice
 * improved `std.debug.panic` handling of panic-during-panic
2019-12-20 18:28:59 -05:00
Andrew Kelley 839b3a61ad expose the ability to disable C sanitization
and disable C sanitization when building libcs.
Empirically, they seem to trigger undef-sanitization.
2019-12-16 13:51:21 -05:00
Andrew Kelley f8cd981c04 use -fsanitize=undefined for C code in safe build modes
closes #3569
2019-12-16 13:06:02 -05:00
Vexu 0f38410ea6 improve extern enum 2019-12-15 19:28:53 -05:00
LemonBoy f1407b4b7e Generate the fn pointers into the correct address space
Fixes #3645
2019-12-15 14:42:53 -05:00
LemonBoy 19ddbd9e9e Make sure the address is aligned for intToPtr ops
Closes #773
2019-12-15 14:41:05 -05:00