aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt
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-11-14represent Mac Catalyst as aarch64-maccatalyst-none rather than ↵Alex Rønne Petersen
aarch64-ios-macabi Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct OS target. Earlier, when DriverKit support was added to LLVM, it was represented a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in the target triple is beyond me. But this isn't the first time they've ignored established target triple norms (see: armv7k and aarch64_32) and it probably won't be the last. While doing this, I also audited all Darwin OS prongs throughout the codebase and made sure they cover all the tags.
2025-11-12compiler-rt: remove dead codeMatthew Lugg
`__addosi4`, `__addodi4`, `__addoti4`, `__subosi4`, `__subodi4`, and `__suboti4` were all functions which we invented for no apparent reason. Neither LLVM, nor GCC, nor the Zig compiler use these functions. It appears the functions were created in a kind of misunderstanding of an old language proposal; see https://github.com/ziglang/zig/pull/10824. There is no benefit to these functions existing; if a Zig compiler backend needs this operation, it is trivial to implement, and *far* simpler than calling a compiler-rt routine. Therefore, this commit deletes them. A small amount of that code was used by other parts of compiler-rt; the logic is trivial so has just been inlined where needed. I also chose to quickly implement `__addvdi3` (a standard function) because it is trivial and we already implement the `sub` parallel.
2025-10-27fix: make `compiler_rt` and `std.Io.Writer` compile on 16-bit platforms.GasInfinity
2025-10-18tweak tests to avoid timeoutsmlugg
2025-10-06improve impl of `__sqrth`, `sqrtf`, `sqrt`, `__sqrtx` and `sqrtq` (#25416)Zhenming Lin
The previous version (ported from musl) used bit-by-bit calculations and was slow, but the current version (also ported from musl) uses lookup tables combined with Goldschmidt iterations to significantly improve the speed.
2025-09-24improve impl of `__floorh`, `__floorx`, `__ceilh` and `__ceilx`Zhenming-Lin
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-09-11compiler-rt: export __aeabi_read_tp for arm-freebsdAlex Rønne Petersen
FreeBSD normally provides this symbol in libc, but it's in the FBSDprivate_1.0 namespace, so it doesn't get included in our abilists file. Fortunately, the implementation is identical for Linux and FreeBSD, so we can just provide it in compiler-rt. It's interesting to note that the same is not true for NetBSD where the implementation is more complex to support older Arm versions. But we do include the symbol in our abilists file for NetBSD libc, so that's fine. closes #25215
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-30compiler-rt: move strlen from libzigc to hereAlex Rønne Petersen
LLVM 21 has started recognizing strlen-like idioms and optimizing them to strlen calls, so we need this function provided in compiler-rt for libc-less compilations.
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-08-03zig fmt: apply new cast builtin orderJustus Klausecker
2025-07-22aarch64: add new from scratch self-hosted backendJacob Young
2025-07-17Merge pull request #20069 from LewisGaul/math-tests-simplifiedAndrew Kelley
Math tests simplified (exp and log functions) with bugfixes
2025-07-17compiler_rt: export all the chkstk variations on MinGWkcbanner
2025-07-17Make sure to test the sign of the zero resultsLewis Gaul
2025-07-17Add tests for log10()Lewis Gaul
2025-07-17Add tests for log2()Lewis Gaul
2025-07-17Add tests for log(), with bugfix for 64-bit boundary caseLewis Gaul
2025-07-17Add tests for exp(), noting last-bit discrepancy for exp(1.0) with math.eLewis Gaul
2025-07-17Add tests for exp2(), with bugfix for 64-bit boundary caseLewis Gaul
2025-07-16canonicalize loongarch clobbersAndrew Kelley
2025-07-16fix mips inline asmAndrew Kelley
wtf are these dollar signs?
2025-07-16zig fmtAndrew Kelley
2025-07-07compiler-rt: Implement __clear_cache() for mips-netbsdAlex Rønne Petersen
2025-07-07compiler-rt: Export __emutls_get_address for OpenHarmonyAlex Rønne Petersen
2025-06-23remove `spirv` cpu archAli Cheraghi
2025-06-20This commit enables fmax and fmin to differentiate between 0.0 andKoki Ueha
-0.0, making it compatible with musl.
2025-06-19x86_64: increase passing test coverage on windowsJacob Young
Now that codegen has no references to linker state this is much easier. Closes #24153
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-19Target: pass and use locals by pointer instead of by valueJacob Young
This struct is larger than 256 bytes and code that copies it consistently shows up in profiles of the compiler.
2025-06-15libc: Prevent FCSEL instruction from being used to avoid raising an ↵Koki Ueha
unintended exception If you write an if expression in mem.doNotOptimizeAway like doNotOptimizeAway(if (ix < 0x00100000) x / 0x1p120 else x + 0x1p120);, FCSEL instruction is used on AArch64. FCSEL instruction selects one of the two registers according to the condition and copies its value. In this example, `x / 0x1p120` and `x + 0x1p120` are expressions that raise different floating-point exceptions. However, since both are actually evaluated before the FCSEL instruction, the exception not intended by the programmer may also be raised. To prevent FCSEL instruction from being used here, this commit splits doNotOptimizeAway in two.
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-06-04compiler-rt: Issue VALGRIND_DISCARD_TRANSLATIONS request in __clear_cache().Alex Rønne Petersen
Closes #24030.
2025-06-03Merge pull request #24013 from alexrp/test-matrixAndrew Kelley
More target coverage in the module test matrix
2025-06-01compiler-rt: add __addvsi3, __subvsi3, __mulvsi3, and __subvdi3Hilger Baumstark
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: Fix some exports to respect the common linkage and visibility.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-28compiler-rt: Add missing _Qp_sqrt export for sparc64.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/23716
2025-04-11compiler-rt: compute correct integer sizes from bits at runtimeJacob Young
Also, accepting `align(1)` pointers ensures that the alignment is safety checked rather than assumed.
2025-04-04compiler-rt: Fix names of some float/int conversion routines for hexagon.Alex Rønne Petersen
2025-04-04llvm: Update the list of targets that use native f16/f128.Alex Rønne Petersen
Closes #22003. Closes #22013.
2025-03-08compiler-rt: fix signed min int from floatJacob Young
2025-03-05Remove uses of deprecated callconv aliasesLinus Groh
2025-02-25compiler-rt: Add tests from llvm/llvm-project#119449.Alex Rønne Petersen