Commit Graph

71 Commits

Author SHA1 Message Date
Koakuma 1d67ab8823 Fix _Qp_cmp definition 2021-01-15 19:07:39 +07:00
Koakuma bbb58b10f6 Add compiler-rt stub for SPARC CPUs 2021-01-15 19:07:38 +07:00
Sébastien Marie d7aa7dbab2 implement emutls in compiler_rt 2021-01-12 05:39:46 +00:00
Frank Denis 6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
LemonBoy afd491c07e compiler-rt: Fix compilation of clzsi for armv6 targets 2020-12-09 16:48:02 +01:00
LemonBoy 518168edb2 compiler-rt: Avoid exposing atomic builtins when not supported
Let's a void any kind of compilation/LLVM errors for niche targets such
as AVR/MSP430 or ARM v6m. By not exporting any atomic builtin anymore
the user is free to provide their own implementation (that disable the
IRQs) or to provide the --single-threaded switch and forget about this.
2020-12-09 16:33:53 +01:00
Jan Prudil aadccc4206 Make std.meta.Int accept a signedness parameter 2020-10-17 14:09:59 +02:00
Vignesh Rajagopalan 2ab0c7391a Rename .macosx to .macos 2020-10-12 18:56:25 -04:00
Vexu 1df0f3ac24 update uses of deprecated type field access 2020-09-03 18:10:40 +03:00
LemonBoy e355bcce36 compiler-rt: Add missing floatdisf routine
Add __floatdisf and __aeabi_l2f

Closes #6188
2020-08-30 00:28:18 -04:00
Andrew Kelley 4a69b11e74 add license header to all std lib files
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Andrew Kelley d159ba9295 zig fmt 2020-08-04 23:04:20 -07:00
Vexu 1f8f434b9c compiler_rt: add floatditf 2020-07-29 18:03:44 +03:00
xackus b8553b4813 compiler-rt: fix bugs uncovered by previous commit 2020-07-05 20:44:08 +02:00
Tadeo Kondrak 350b2adacd std.meta.IntType -> std.meta.Int 2020-04-28 19:11:31 -06:00
Tadeo Kondrak f977155fdb @Vector -> std.meta.Vector 2020-04-28 00:47:13 -06:00
LemonBoy a0b73c9f02 compiler-rt: Separate max size allowed for load/store and CAS
The v6m ISA has no way to express a CAS loop natively without turning
off the interrupts or using the kernel cmpxchg harness.

On such a platform the user has to provide a few __sync_* builtins to
satisfy the linker.
2020-04-06 12:52:53 -04:00
daurnimator e9e43ed0d3 compiler_rt/atomics: be consistent with const value 2020-04-05 14:08:25 +10:00
daurnimator f947444362 Tidy up compiler_rt/atomics 2020-04-05 14:06:12 +10:00
Andrew Kelley e03cbb117e compiler-rt: don't forget to export these functions 2020-04-03 16:07:32 -04:00
LemonBoy ed69821f5b compiler-rt: Add the __atomic family of builtins
The implementation was checked against a few files using std::atomic and
compiled using zig c++.

Closes #4887
2020-04-03 16:04:44 -04:00
Andrew Kelley d9d8c42426 remove unnecessary inline
works around a bug triggered by previous commit
2020-03-31 11:18:11 -04:00
Andrew Kelley 0e372ccff5 clean up the duplicate export logic for __clear_cache 2020-03-31 10:48:48 -04:00
LemonBoy e9c49f423d compiler-rt: More clear_cache implementations 2020-03-31 10:36:12 -04:00
daurnimator 63409cf422 std: linux syscall numbers are now an extensible enum 2020-03-31 10:16:20 -04:00
Andrew Kelley 83ff94b1cc compiler-rt: don't export __clear_cache when no impl available 2020-03-30 23:15:07 -04:00
Timon Kruiper f6f03cd90f compiler-rt: implement clear_cache for arm32-linux 2020-03-31 00:29:41 +02:00
LemonBoy 1ef6f068f5 compiler-rt: Implement all the shift builtins
* Unify all the code paths with a generic function
* Add some EABI aliases

Closes #4853
2020-03-30 10:58:47 -04:00
LemonBoy 0512be227c compiler-rt: Fix __floatunditf
This builtin converts a u64 into a f128, not a u128 into a f128.

Fixes some weird-ass crashes that happened only on AArch64 systems.
2020-03-27 20:10:59 +01:00
LemonBoy cc774c603b compiler-rt: Add __divtf3 2020-03-24 18:08:53 +01:00
Andrew Kelley 39589cffe0 compiler-rt: fix __clear_cache on aarch64 darwin 2020-03-24 11:51:13 -04:00
Andrew Kelley 03013e5176 compiler-rt: aarch64 implementation of __clear_cache 2020-03-24 10:33:23 -04:00
Andrew Kelley 93c7fa105f Merge remote-tracking branch 'origin/llvm10'
LLVM 10 was released today
2020-03-24 09:57:09 -04:00
momumi 7aac21c6f5 allow _ separators in number literals (stage 1)
* Underscores `_` may be placed between two digits in a int/float literal
* Consecutive underscores are not allowed
* Fixed parsing bug in exponents of hexadecimal float literals.
  Exponents should always be base 10, but hex characters would be parsed
  inside the exponent and everything after them would be ignored. eg:
  `0x1.0p1ab1` would be parsed as `0x1.0p1`.
2020-03-15 12:38:35 +10:00
Andrew Kelley d1cb16aace Merge remote-tracking branch 'origin/master' into llvm10 2020-03-03 09:44:13 -05:00
xackus 00be934569 short std.builtin enum literals in std lib 2020-03-01 13:57:41 -05:00
Andrew Kelley bafa895561 compiler-rt: inline at call site to workaround a bug
The bug is #2154
2020-02-28 14:51:55 -05:00
Andrew Kelley 87b9e744dd update std lib to new Target API 2020-02-28 14:51:54 -05:00
Andrew Kelley 4616af0ca4 introduce operating system version ranges as part of the target
* re-introduce `std.build.Target` which is distinct from `std.Target`.
   `std.build.Target` wraps `std.Target` so that it can be annotated as
   "the native target" or an explicitly specified target.
 * `std.Target.Os` is moved to `std.Target.Os.Tag`. The former is now a
   struct which has the tag as well as version range information.
 * `std.elf` gains some more ELF header constants.
 * `std.Target.parse` gains the ability to parse operating system
   version ranges as well as glibc version.
 * Added `std.Target.isGnuLibC()`.
 * self-hosted dynamic linker detection and glibc version detection.
   This also adds the improved logic using `/usr/bin/env` rather than
   invoking the system C compiler to find the dynamic linker when zig
   is statically linked. Related: #2084
   Note: this `/usr/bin/env` code is work-in-progress.
 * `-target-glibc` CLI option is removed in favor of the new `-target`
   syntax. Example: `-target x86_64-linux-gnu.2.27`

closes #1907
2020-02-28 14:51:53 -05:00
Andrew Kelley f33bf48af7 Merge remote-tracking branch 'origin/master' into llvm10 2020-02-25 16:30:40 -05:00
Vexu 538d9a5dd8 remove uses of @ArgType and @IntType 2020-02-24 23:39:03 +02:00
Andrew Kelley cdc5070f21 Merge remote-tracking branch 'origin/master' into llvm10 2020-02-10 00:26:33 -05:00
LemonBoy c4d0f97b4c compiler_rt: Fix clzsi2 implementation for Thumb1
The LUT contains the number of bits set, not the number of leading zeros
as we're subtracting from the total number of bits in a word.

Closes #4415
2020-02-09 14:12:01 -05:00
Andrew Kelley 9e5b248991 remove workarounds for Windows native CPU features
bug fixed in LLVM 10

closes #508
2020-02-07 12:41:46 -05:00
Andrew Kelley 9dffc369f1 Merge remote-tracking branch 'origin/master' into layneson-cpus_and_features 2020-01-25 23:25:29 -05:00
Andrew Kelley c86589a738 disable f128 compiler_rt tests failing on windows
These were never working with native CPU features. In this branch,
we fix native CPU features not being enabled on Windows, and regress
f128 language features. In the llvm10 branch, all this is fixed,
and the tests are re-enabled.
2020-01-23 02:05:24 -05:00
Michael Dusan 357f42da6c compiler_rt: fix mulsi3 test typo 2020-01-22 20:17:38 -05:00
LemonBoy 69c72e24d4 compiler-rt: Port __mulsi3 builtin 2020-01-22 13:04:45 -05:00
LemonBoy 861724bcf0 Fix some tests broken by the renamed files 2020-01-19 09:31:45 +01:00
LemonBoy 5fbc1c2812 Nuke some more code 2020-01-19 00:12:27 +01:00