aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/common.zig
AgeCommit message (Collapse)Author
2025-11-15compiler_rt: fix and simplify additional Windows exportsMatthew Lugg
Simplifies the logic, clarifies the comment, and fixes a minor bug, which is that we exported the Windows ABI name *instead* of the standard compiler-rt name, but it's meant to be exported *in addition* to the standard name (this is LLVM's behavior and it is more useful).
2025-08-30llvm: switch to native f16 IR type for all hexagon targetsAlex Rønne Petersen
This was fixed in LLVM 21, in particular for targets older than v68.
2025-08-30llvm: switch to native f16 IR type for s390xAlex Rønne Petersen
LLVM 21 added support for this.
2025-08-30compiler-rt: use native f16 type for loongarchAlex Rønne Petersen
This ABI changed in LLVM 21.
2025-08-25start adding big endian RISC-V supportAlex Rønne Petersen
The big endian RISC-V effort is mostly driven by MIPS (the company) which is pivoting to RISC-V, and presumably needs a big endian variant to fill the niche that big endian MIPS (the ISA) did. GCC already supports these targets, but LLVM support will only appear in 22; this commit just adds the necessary target knowledge and checks on our end.
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-06-23remove `spirv` cpu archAli Cheraghi
2025-06-19coff: add hack to build a compiler-rt dynamic libraryJacob Young
This is not meant to be a long-term solution, but it's the easiest thing to get working quickly at the moment. The main intention of this hack is to allow more tests to be enabled. By the time the coff linker is far enough along to be enabled by default, this will no longer be required.
2025-06-05std.Target: Introduce Cpu convenience functions for feature tests.Alex Rønne Petersen
Before: * std.Target.arm.featureSetHas(target.cpu.features, .has_v7) * std.Target.x86.featureSetHasAny(target.cpu.features, .{ .sse, .avx, .cmov }) * std.Target.wasm.featureSetHasAll(target.cpu.features, .{ .atomics, .bulk_memory }) After: * target.cpu.has(.arm, .has_v7) * target.cpu.hasAny(.x86, &.{ .sse, .avx, .cmov }) * target.cpu.hasAll(.wasm, &.{ .atomics, .bulk_memory })
2025-05-29compiler-rt: Fix some exports for *-windows-none.Alex Rønne Petersen
2025-05-19compiler-rt: Add a comment explaining why we currently need weak linkage.Alex Rønne Petersen
2025-05-19compiler-rt, zigc: Use hidden visibility except when testing.Alex Rønne Petersen
This prevents symbols from these libraries from polluting the dynamic symbol tables of binaries built with Zig. The downside is that we no longer deduplicate the symbols at run time due to weak linkage. Closes #7935. Closes #13303. Closes #19342.
2025-04-04llvm: Update the list of targets that use native f16/f128.Alex Rønne Petersen
Closes #22003. Closes #22013.
2025-02-22Merge pull request #22606 from dweiller/memmove-optAndrew Kelley
compiler-rt: memmove optimisation
2025-02-17std.Target: Remove functions that just wrap component functions.Alex Rønne Petersen
Functions like isMinGW() and isGnuLibC() have a good reason to exist: They look at multiple components of the target. But functions like isWasm(), isDarwin(), isGnu(), etc only exist to save 4-8 characters. I don't think this is a good enough reason to keep them, especially given that: * It's not immediately obvious to a reader whether target.isDarwin() means the same thing as target.os.tag.isDarwin() precisely because isMinGW() and similar functions *do* look at multiple components. * It's not clear where we would draw the line. The logical conclusion before this commit would be to also wrap Arch.isX86(), Os.Tag.isSolarish(), Abi.isOpenHarmony(), etc... this obviously quickly gets out of hand. * It's nice to just have a single correct way of doing something.
2025-02-16compiler-rt: Use Windows Arm ABI routines for UEFI for now.Alex Rønne Petersen
Until #21630 is addressed. Closes #22893.
2025-01-30compiler-rt: optimize memmovedweiller
2025-01-25compiler-rt: More accurately export Windows Arm functions.Alex Rønne Petersen
2025-01-24compiler_rt: upgrade to new panic interfacemlugg
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-10-15compiler-rt: Always use f16 as the half type for riscv.Alex Rønne Petersen
2024-10-03Merge pull request #21504 from alexrp/android-softfpAlex Rønne Petersen
`std.Target`: Introduce `Abi.androideabi` to distinguish the soft float case.
2024-09-26embrace panic helpersAndrew Kelley
Introduces `std.builtin.Panic` which is a complete interface for panicking. Provide `std.debug.FormattedPanic` and `std.debug.SimplePanic` and let the user choose, or make their own.
2024-09-26remove formatted panicsAndrew Kelley
implements #17969
2024-09-24std.Target: Introduce Abi.androideabi to distinguish the soft float case.Alex Rønne Petersen
Abi.android on its own is not enough to know whether soft float or hard float should be used. In the C world, androideabi is typically used for the soft float case, so let's go with that. Note that Android doesn't have a hard float ABI, so no androideabihf. Closes #21488.
2024-09-23compiler-rt: Export extra soft float libcall names for thumb-windows-gnu.Alex Rønne Petersen
2024-09-19compiler_rt: strong linkage when compiling to .cAndrew Kelley
This works around a problem that started happening with LLD around version 18.1.8: ``` lld-link: error: duplicate symbol: .weak.__nexf2.default >>> defined at CMakeFiles/zig2.dir/compiler_rt.c.obj >>> defined at compiler_rt.lib(compiler_rt.lib.obj) ```
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-27compiler,lib,test,langref: migrate `@setCold` to `@branchHint`mlugg
2024-08-01std.Target: Rework isPPC()/isPPC64() functions.Alex Rønne Petersen
* Rename isPPC() -> isPowerPC32(). * Rename isPPC64() -> isPowerPC64(). * Add new isPowerPC() function which covers both. There was confusion even in the standard library about what isPPC() meant. This change makes these functions work how I think most people actually expect them to work, and makes them consistent with isMIPS(), isSPARC(), etc. I chose to rename from PPC to PowerPC because 1) it's more consistent with the other functions, and 2) it'll cause loud rather than silent breakage for anyone who might have been depending on isPPC() while misunderstanding it.
2024-07-28std.Target.Cpu.Arch: Remove the `aarch64_32` tag.Alex Rønne Petersen
This is a misfeature that we inherited from LLVM: * https://reviews.llvm.org/D61259 * https://reviews.llvm.org/D61939 (`aarch64_32` and `arm64_32` are equivalent.) I truly have no idea why this triple passed review in LLVM. It is, to date, the *only* tag in the architecture component that is not, in fact, an architecture. In reality, it is just an ILP32 ABI for AArch64 (*not* AArch32). The triples that use `aarch64_32` look like `aarch64_32-apple-watchos`. Yes, that triple is exactly what you think; it has no ABI component. They really, seriously did this. Since only Apple could come up with silliness like this, it should come as no surprise that no one else uses `aarch64_32`. Later on, a GNU ILP32 ABI for AArch64 was developed, and support was added to LLVM: * https://reviews.llvm.org/D94143 * https://reviews.llvm.org/D104931 Here, sanity seems to have prevailed, and a triple using this ABI looks like `aarch64-linux-gnu_ilp32` as you would expect. As can be seen from the diffs in this commit, there was plenty of confusion throughout the Zig codebase about what exactly `aarch64_32` was. So let's just remove it. In its place, we'll use `aarch64-watchos-ilp32`, `aarch64-linux-gnuilp32`, and so on. We'll then translate these appropriately when talking to LLVM. Hence, this commit adds the `ilp32` ABI tag (we already have `gnuilp32`).
2024-07-22compiler_rt: wasm miss float exceptionsPavel Verigo
2024-03-11std.builtin: make global linkage fields lowercaseTristan Ross
2024-01-04Enable gnu_f16_abi on x86_64Anubhab Ghosh
2023-10-31std.builtin.Endian: make the tags lower caseAndrew Kelley
Let's take this breaking change opportunity to fix the style of this enum.
2023-10-01x86_64: implement float compare and cast builtinsJacob Young
2023-09-19compiler_rt: fix arm hard-float f16 abiJacob Young
Closes #16848
2023-09-19compiler_rt: fight off `@as` invasionJacob Young
Importantly, fixes incorrectly annotated types in `__aeabi_?2h`.
2023-06-24all: migrate code to new cast builtin syntaxmlugg
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-04-15compiler_rt: use default visibility for non-exported symbolsAndrew Kelley
2023-04-05compiler_rt: change the abi of f16 on mac to depend on the other typeJacob Young
2023-04-05compiler_rt: attempt to fix f16 abi on mac with llvm 16Jacob Young
2023-02-24compiler_rt: declutter int.zig, add mulXi3 tests (#14623)matu3ba
- Combine mulXi3 routines for follow-up cleanup. - DRY up Dwords and Twords - rename both to HalveInt and use instance * Justification: Not all processors have word size 32 bit. * remove test file from CMakeLists * DRY things.
2022-12-28compiler-rt: Set the symbol visibilityLuuk de Gram
When we're compiling compiler_rt for any WebAssembly target, we do not want to expose all the compiler-rt functions to the host runtime. By setting the visibility of all exports to `hidden`, we allow the linker to resolve the symbols during linktime, while not expose the functions to the host runtime. This also means the linker can properly garbage collect any compiler-rt function that does not get resolved. The symbol visibility for all target remains the same as before: `default`.
2022-12-06compiler_rt: don't use the llvm windows v2u64 abi with the C backendJacob Young
2022-11-04all: rename i386 to x86Ali Chraghi
2022-10-30compiler_rt: fix gnu_f16_abi for i386-windowsAndrew Kelley
closes #13333
2022-10-21Support compiling for the android NDK (#13245)Louis Pearson
2022-09-20std: add return address parameter to panic fnVeikka Tuominen
2022-08-29Merge remote-tracking branch 'origin/master' into llvm15Andrew Kelley