Commit Graph

30 Commits

Author SHA1 Message Date
Andrew Kelley
2a96209c40
Merge pull request #12574 from Vexu/remove-bit-op-type-param
stage2+stage1: remove type parameter from bit builtins
2022-08-24 15:57:44 -04:00
Jakub Konka
d852894dcf skip failing compiler-rt divxf3 tests on Windows 2022-08-23 22:59:11 +02:00
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
Veikka Tuominen
d75fa86d70 stage2: implement @setFloatMode 2022-07-23 15:40:12 +03:00
Andrew Kelley
35e7011124 LLVM: implement signext/zeroext attributes
For calling convention ABI purposes, integer attributes and return
values need to have an LLVM attribute signext or zeroext added
sometimes. This commit implements that logic.

It also implements a proof-of-concept of moving the F16T type from
being a compiler_rt hack to being how the compiler lowers f16 in
functions that need to match certain calling conventions.

Closes #12054
2022-07-13 11:14:46 -07:00
Veikka Tuominen
122c76a167 Sema: allow void as an extern union field & fix invalid extern unions 2022-07-11 20:30:16 +03:00
Cody Tapscott
bb8971150c compiler_rt: Slightly re-factor exports for Windows x86-64
This is just a cosmetic change. The goal is to keep the export logic
relatively flat and centralized.
2022-07-10 20:51:34 -07:00
Cody Tapscott
680419c407 compiler_rt: Update Windows ABI for float<->int conversion routines
Starting with LLVM 14, the Libcalls to these functions are now lowered
using a Vec(2, u64) instead of the standard ABI for i128 integers, so
our compiler-rt implementation needs to be updated to expose the same
ABI on Windows.
2022-07-10 20:51:34 -07:00
Andrew Kelley
8e492f7d47 compiler_rt: enable __clear_cache for stage2 2022-07-07 20:47:43 -07:00
Andrew Kelley
38e3063296 compiler_rt: RISC-V does not want gnu_f16_abi 2022-07-06 02:29:54 -07:00
Andrew Kelley
d8fc8d0118 compiler_rt: work around LLVM optimizing __muloti4 to call itself
This is a workaround for
https://github.com/llvm/llvm-project/issues/56403
2022-07-05 21:28:39 -07:00
Andrew Kelley
6bc6e47b15 stage2: lower float negation explicitly
Rather than lowering float negation as `0.0 - x`.

 * Add AIR instruction for float negation.
 * Add compiler-rt functions for f128, f80 negation

closes #11853
2022-06-30 00:02:00 -07:00
Jakub Konka
b4f2c0dcb9 compiler-rt: fix logic for choosing __gnu_{f2h,h2f}_ieee
Similar to wasm32-wasi-musl, Apple targets also want standard
symbol names.
2022-06-19 15:12:08 +02:00
Andrew Kelley
30ef033693 compiler-rt: fix logic for choosing __gnu_{f2h,h2f}_ieee
wasm32-wasi-musl wants the standard symbol names however Linux requires
the `__gnu_*` flavors. I did not find any authoritative source on what
decides which symbol flavors to use. If we run into more trouble in the
future we can go back to having both.
2022-06-17 20:25:17 -07:00
Andrew Kelley
ebab5288c3 compiler-rt: fix aeabi logic
Before, compiler-rt would have the wrong symbols for ARM targets.
2022-06-17 18:22:35 -07:00
Andrew Kelley
0556a2ba53 compiler-rt: finish cleanups
Finishes cleanups that I started in other commits in this branch.

 * Use common.linkage for all exports instead of redoing the logic in
   each file.
 * Remove pointless `@setRuntimeSafety` calls.
 * Avoid redundantly exporting multiple versions of functions. For
   example, if PPC wants `ceilf128` then don't also export `ceilq`;
   similarly if ARM wants `__aeabi_ddiv` then don't also export
   `__divdf3`.
 * Use `inline` for helper functions instead of making inline calls at
   callsites.
2022-06-17 18:10:00 -07:00
Andrew Kelley
3efc229bbf compiler-rt: musl ABI also needs __gnu_f2h_ieee etc 2022-06-17 16:42:50 -07:00
Andrew Kelley
bcf3a7d600 compiler-rt: gedf2 and gesf2 2022-06-17 16:40:25 -07:00
Andrew Kelley
bbc6103398 compiler-rt: fix tests 2022-06-17 16:38:59 -07:00
Andrew Kelley
a8a7f15106 compiler-rt: use callconv(.AAPCS) on all __aeabi_ functions 2022-06-17 16:38:59 -07:00
Andrew Kelley
25671f5a97 compiler-rt: move SPARC functions into appropriate compilation units 2022-06-17 16:38:59 -07:00
Andrew Kelley
c99c085d70 compiler-rt: break up functions even more
The purpose of this branch is to switch to using an object file for each
independent function, in order to make linking simpler - instead of
relying on `-ffunction-sections` and `--gc-sections`, which involves the
linker doing the work of linking everything and then undoing work via
garbage collection, this will allow the linker to only include the
compilation units that are depended on in the first place.

This commit makes progress towards that goal.
2022-06-17 16:38:59 -07:00
Jakub Konka
57c530155f compiler_rt: correctly export allrem and aullrem for i386-windows-msvc 2022-06-17 16:38:59 -07:00
Jakub Konka
2259d629d3 compiler_rt: use single cache for libcompiler_rt.a static lib 2022-06-17 16:38:59 -07:00
Jakub Konka
80790be309 compiler_rt: compile each unit separately for improved archiving 2022-06-17 16:38:59 -07:00
Veikka Tuominen
9aae4d57cb compiler_rt: fix infinite loop 2022-06-03 14:27:45 +03:00
alice
70b6b98e91
Simplify Copysign 2022-05-17 21:55:22 +01:00
Koakuma
fb0692334e target: Rename sparcv9 -> sparc64
Rename all references of sparcv9 to sparc64, to make Zig align more with
other projects. Also, added new function to convert glibc arch name to Zig
arch name, since it refers to the architecture as sparcv9.

This is based on the suggestion by @kubkon in PR 11847.
(https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2022-05-13 16:43:59 -04:00
Andrew Kelley
cd019ee502 compiler_rt: avoid weak aliases on Windows
When exporting math functions for Windows, we provide weak exports of
'l' variants rather than weak aliases. We still use aliases on other
operating systems so that the 'l' variants have one less jump
instruction in this case.
2022-05-08 13:06:21 -07:00
Andrew Kelley
ec95e00e28 flatten lib/std/special and improve "pkg inside another" logic
stage2: change logic for detecting whether the main package is inside
the std package. Previously it relied on realpath() which is not portable.
This uses resolve() which is how imports already work.

 * stage2: fix cleanup bug when creating Module
 * flatten lib/std/special/* to lib/*
   - this was motivated by making main_pkg_is_inside_std false for
     compiler_rt & friends.
 * rename "mini libc" to "universal libc"
2022-05-06 22:41:00 -07:00