Commit Graph

25 Commits

Author SHA1 Message Date
Andrew Kelley
3fc6fc6812 std.builtin.Endian: make the tags lower case
Let's take this breaking change opportunity to fix the style of this
enum.
2023-10-31 21:37:35 -04:00
mlugg
f26dda2117 all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:

* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
2023-06-24 16:56:39 -07:00
Andrew Kelley
09c7f1bd7c musl: update libc.S to v1.2.4 2023-06-20 12:55:38 -04:00
Eric Joldasov
50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Jan Philipp Hafer
f043071cdf compiler_rt: add missing PPC routines
Adds conditional exports
- __fixkfti
- __fixunskfti
- __floattikf
- __negkf2
- __mulkc3
- __divkc3
- __powikf2
and adjusts tools/gen_stubs.zig.

From https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html:
"When long double transitions to __float128 on PowerPC in the future,
__ibm128 will remain for use in conversions between the two types."

Hence `__extendkftf2` and `__trunctfkf2` for conversion are superfluous
and only using f128 for `kf` routines is justified.

Closes #16057.
2023-06-16 23:37:50 -07:00
Ali Chraghi
3db3cf7790 std.sort: add pdqsort and heapsort 2023-05-23 17:55:59 -07:00
Andrew Kelley
aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Jan Philipp Hafer
e10c0eefde compiler_rt: add __powihf2, __powisf2, __powidf2, __powitf2, __powixf2
Implementation and tests ported from LLVM release 80.
Tests of __powihf2 created from __powisf2 tests with minor adjustments.
2023-02-12 00:10:27 +02:00
matu3ba
d976b4e4a5
compiler_rt: __divmodti4 for libgcc symbol compatibility
- Copy and adjust __divmodsi4 tests for __divmoddi4 and __divmodti4.
- Assuming d = a/b does not overflow (MIN/-1) or uses div by 0,
  then tmp = (d * b) = (a/b * b) = a does not overflow.
  => Remove wraparound for remainder in applicable routines.
2023-02-11 14:41:08 +02:00
matu3ba
1bda8be2a3
compiler_rt: __ashlsi3, __ashrsi3, __lshrsi3 for symbol compatibility
These are unused in LLVM, but in gcc used for example by rl78.
Move test files into common file, add tests for aforementioned routines
and missing ones for __lshrti3.
2023-02-11 14:25:01 +02:00
Jan Philipp Hafer
301a89849b tools: build all tools in ci to prevent bitrot
No LLVM assertions were triggered for me.
Closes #12015
Closes #12022
Closes #12223
2023-01-06 01:18:46 +02:00
Frank Denis
8d66aacb64
compiler-rt: implement __udivei4 and __umodei4 (#14023)
Allows dividing and formatting arbitrary-large unsigned integers.
2022-12-22 16:29:19 -05:00
Ali Chraghi
f5f1f8c666 all: rename i386 to x86 2022-11-04 00:09:27 +03:30
Veikka Tuominen
62ff8871ed stage2+stage1: remove type parameter from bit builtins
Closes #12529
Closes #12511
Closes #6835
2022-08-22 11:19:20 +03:00
Isaac Freund
2477a95d29
tools/gen_stubs: sort output by section/symbol name
This will make future diffs smaller and easier to review.
2022-05-04 18:38:45 +02:00
Isaac Freund
f4131cf8a6
musl: update to 1.2.3
This was a bit trickier than it should be due to symbol conflicts with
zig's compiler-rt implementation. We attempt to use weak linkage in
our compiler-rt, but this does not seem to be working in all cases. I
manually disabled export of the problematic compiler-rt math functions
in order to cross compile musl's libc.so for all targets as input to
`tools/gen_stubs.zig`.

Other than that, this update went fairly smoothly. Quite a few
additional symbols were added to the blacklist in `tools/gen_stubs.zig`
due to recent reorganization of zig's compiler-rt.
2022-05-04 01:00:57 +02:00
Andrew Kelley
da9542c0af tools/gen_stubs: add aarch64 and output preprocessor directives
Now it outputs libc.S which can be assembled with zig, and the small
differences per-architecture are handled with preprocessor directives.

There is also now a set of blacklisted symbols which contains
compiler-rt.
2021-12-09 01:21:30 -07:00
Andrew Kelley
04d44db6cc tools/gen_stubs: consolidate symbol properties into MultiSym 2021-12-08 23:45:25 -07:00
Andrew Kelley
808b9239a3 improve musl dynamic stubs file libc.s
tools/gen_stubs.zig now cuts out the middle man and operates directly on
the libc.so ELF file. it outputs accurate .size directives for objects.

std.elf gains an STV enum.
2021-12-08 22:32:31 -07:00
Lee Cannon
1093b09a98
allocgate: renamed getAllocator function to allocator 2021-11-30 23:32:47 +00:00
Lee Cannon
75548b50ff
allocgate: stage 1 and 2 building 2021-11-30 23:32:47 +00:00
Andrew Kelley
4d75382452 tools/gen_stubs.zig: better error message on invalid input 2021-11-08 15:31:14 -07:00
Julian Maingot
384ccaa27a stage2: use %type not @type for libc stubs
Missed a couple places last time so just doing the rest.
2021-01-18 11:04:33 -08:00
Isaac Freund
343249efd8 stage2: use %type not @type for libc stubs
Apparently ARM uses @ for comments. Everything seems to accept % here
though.
2020-12-13 23:19:23 -05:00
Isaac Freund
307d98dc35
stage2: support dynamically linking musl libc 2020-12-13 00:40:35 +01:00