147 releases
0.1.156 | Apr 22, 2025 |
---|---|
0.1.152 | Mar 20, 2025 |
0.1.140 | Dec 26, 2024 |
0.1.139 | Nov 3, 2024 |
0.1.2 | Nov 26, 2018 |
#53 in Rust patterns
857,118 downloads per month
Used in 92 crates
(87 directly)
1MB
21K
SLoC
compiler-builtins
This crate provides external symbols that the compiler expects to be available
when building Rust projects, typically software routines for basic operations
that do not have hardware support. It is largely a port of LLVM's
compiler-rt
.
It is distributed as part of Rust's sysroot. compiler-builtins
does not need
to be added as an explicit dependency in Cargo.toml
.
Contributing
See CONTRIBUTING.md.
Progress
- aarch64/chkstk.S
- adddf3.c
- addsf3.c
- arm/addsf3.S
- arm/aeabi_dcmp.S
- arm/aeabi_fcmp.S
- arm/aeabi_idivmod.S
- arm/aeabi_ldivmod.S
- arm/aeabi_memcpy.S
- arm/aeabi_memmove.S
- arm/aeabi_memset.S
- arm/aeabi_uidivmod.S
- arm/aeabi_uldivmod.S
- arm/chkstk.S
- arm/divmodsi4.S (generic version is done)
- arm/divsi3.S (generic version is done)
- arm/modsi3.S (generic version is done)
- arm/softfloat-alias.list
- arm/udivmodsi4.S (generic version is done)
- arm/udivsi3.S (generic version is done)
- arm/umodsi3.S (generic version is done)
- ashldi3.c
- ashrdi3.c
- avr/divmodhi4.S
- avr/divmodqi4.S
- avr/mulhi3.S
- avr/mulqi3.S
- avr/udivmodhi4.S
- avr/udivmodqi4.S
- bswapdi2.c
- bswapsi2.c
- bswapti2.c
- clzdi2.c
- clzsi2.c
- clzti2.c
- comparedf2.c
- comparesf2.c
- ctzdi2.c
- ctzsi2.c
- ctzti2.c
- divdf3.c
- divdi3.c
- divmoddi4.c
- divmodsi4.c
- divmodti4.c
- divsf3.c
- divsi3.c
- extendsfdf2.c
- fixdfdi.c
- fixdfsi.c
- fixsfdi.c
- fixsfsi.c
- fixunsdfdi.c
- fixunsdfsi.c
- fixunssfdi.c
- fixunssfsi.c
- floatdidf.c
- floatdisf.c
- floatsidf.c
- floatsisf.c
- floatundidf.c
- floatundisf.c
- floatunsidf.c
- floatunsisf.c
- i386/ashldi3.S
- i386/ashrdi3.S
- i386/chkstk.S
- i386/divdi3.S
- i386/lshrdi3.S
- i386/moddi3.S
- i386/muldi3.S
- i386/udivdi3.S
- i386/umoddi3.S
- lshrdi3.c
- moddi3.c
- modsi3.c
- muldf3.c
- muldi3.c
- mulodi4.c
- mulosi4.c
- mulsf3.c
- powidf2.c
- powisf2.c
- riscv/muldi3.S
- riscv/mulsi3.S
- subdf3.c
- subsf3.c
- truncdfsf2.c
- udivdi3.c
- udivmoddi4.c
- udivmodsi4.c
- udivsi3.c
- umoddi3.c
- umodsi3.c
- x86_64/chkstk.S
These builtins are needed to support 128-bit integers.
- ashlti3.c
- ashrti3.c
- divti3.c
- fixdfti.c
- fixsfti.c
- fixunsdfti.c
- fixunssfti.c
- floattidf.c
- floattisf.c
- floatuntidf.c
- floatuntisf.c
- lshrti3.c
- modti3.c
- muloti4.c
- multi3.c
- udivmodti4.c
- udivti3.c
- umodti3.c
These builtins are needed to support f16
and f128
, which are in the process
of being added to Rust.
- addtf3.c
- comparetf2.c
- divtf3.c
- extenddftf2.c
- extendhfsf2.c
- extendhftf2.c
- extendsftf2.c
- fixtfdi.c
- fixtfsi.c
- fixtfti.c
- fixunstfdi.c
- fixunstfsi.c
- fixunstfti.c
- floatditf.c
- floatsitf.c
- floattitf.c
- floatunditf.c
- floatunsitf.c
- floatuntitf.c
- multf3.c
- powitf2.c
- subtf3.c
- truncdfhf2.c
- truncsfhf2.c
- trunctfdf2.c
- trunctfhf2.c
- trunctfsf2.c
These builtins are used by the Hexagon DSP
- hexagon/common_entry_exit_abi1.S
- hexagon/common_entry_exit_abi2.S
- hexagon/common_entry_exit_legacy.S
- hexagon/dfaddsub.S~~
- hexagon/dfdiv.S~~
- hexagon/dffma.S~~
- hexagon/dfminmax.S~~
- hexagon/dfmul.S~~
- hexagon/dfsqrt.S~~
- hexagon/divdi3.S~~
- hexagon/divsi3.S~~
- hexagon/fastmath2_dlib_asm.S~~
- hexagon/fastmath2_ldlib_asm.S~~
- hexagon/fastmath_dlib_asm.S~~
- hexagon/memcpy_forward_vp4cp4n2.S~~
- hexagon/memcpy_likely_aligned.S~~
- hexagon/moddi3.S~~
- hexagon/modsi3.S~~
- hexagon/sfdiv_opt.S~~
- hexagon/sfsqrt_opt.S~~
- hexagon/udivdi3.S~~
- hexagon/udivmoddi4.S~~
- hexagon/udivmodsi4.S~~
- hexagon/udivsi3.S~~
- hexagon/umoddi3.S~~
- hexagon/umodsi3.S~~
Unimplemented functions
These builtins are for x87 f80
floating-point numbers that are not supported
by Rust.
extendxftf2.cfixunsxfdi.cfixunsxfsi.cfixunsxfti.cfixxfdi.cfixxfti.cfloatdixf.cfloattixf.cfloatundixf.cfloatuntixf.ci386/floatdixf.Si386/floatundixf.Sx86_64/floatdixf.cx86_64/floatundixf.S
These builtins are for IBM "extended double" non-IEEE 128-bit floating-point numbers.
ppc/divtc3.cppc/fixtfdi.cppc/fixtfti.cppc/fixunstfdi.cppc/fixunstfti.cppc/floatditf.cppc/floattitf.cppc/floatunditf.cppc/gcc_qadd.cppc/gcc_qdiv.cppc/gcc_qmul.cppc/gcc_qsub.cppc/multc3.c
These builtins are for 16-bit brain floating-point numbers that are not supported by Rust.
truncdfbf2.ctruncsfbf2.ctrunctfxf2.c
These builtins involve complex floating-point types that are not supported by Rust.
divdc3.cdivsc3.cdivtc3.cdivxc3.cmuldc3.cmulsc3.cmultc3.cmulxc3.cpowixf2.c
These builtins are never called by LLVM.
absvdi2.cabsvsi2.cabsvti2.caddvdi3.caddvsi3.caddvti3.carm/aeabi_cdcmp.Sarm/aeabi_cdcmpeq_check_nan.carm/aeabi_cfcmp.Sarm/aeabi_cfcmpeq_check_nan.carm/aeabi_div0.carm/aeabi_drsub.carm/aeabi_frsub.carm/aeabi_memcmp.Sarm/bswapdi2.Sarm/bswapsi2.Sarm/clzdi2.Sarm/clzsi2.Sarm/comparesf2.Sarm/restore_vfp_d8_d15_regs.Sarm/save_vfp_d8_d15_regs.Sarm/switch16.Sarm/switch32.Sarm/switch8.Sarm/switchu8.Scmpdi2.ccmpti2.cffssi2.cffsdi2.c- this is called by gcc though!ffsti2.cmulvdi3.cmulvsi3.cmulvti3.cnegdf2.cnegdi2.cnegsf2.cnegti2.cnegvdi2.cnegvsi2.cnegvti2.cparitydi2.cparitysi2.cparityti2.cpopcountdi2.cpopcountsi2.cpopcountti2.cppc/restFP.Sppc/saveFP.Ssubvdi3.csubvsi3.csubvti3.cucmpdi2.cucmpti2.cudivmodti4.c
Rust only exposes atomic types on platforms that support them, and therefore does not need to fall back to software implementations.
arm/sync_fetch_and_add_4.Sarm/sync_fetch_and_add_8.Sarm/sync_fetch_and_and_4.Sarm/sync_fetch_and_and_8.Sarm/sync_fetch_and_max_4.Sarm/sync_fetch_and_max_8.Sarm/sync_fetch_and_min_4.Sarm/sync_fetch_and_min_8.Sarm/sync_fetch_and_nand_4.Sarm/sync_fetch_and_nand_8.Sarm/sync_fetch_and_or_4.Sarm/sync_fetch_and_or_8.Sarm/sync_fetch_and_sub_4.Sarm/sync_fetch_and_sub_8.Sarm/sync_fetch_and_umax_4.Sarm/sync_fetch_and_umax_8.Sarm/sync_fetch_and_umin_4.Sarm/sync_fetch_and_umin_8.Sarm/sync_fetch_and_xor_4.Sarm/sync_fetch_and_xor_8.Sarm/sync_synchronize.Satomic.catomic_flag_clear.catomic_flag_clear_explicit.catomic_flag_test_and_set.catomic_flag_test_and_set_explicit.catomic_signal_fence.catomic_thread_fence.c
Miscellaneous functionality that is not used by Rust.
aarch64/fp_mode.caarch64/lse.S(LSE atomics)aarch64/sme-abi-init.c(matrix extension)aarch64/sme-abi.S(matrix extension)aarch64/sme-libc-routines.c(matrix extension)apple_versioning.carm/fp_mode.cavr/exit.Sclear_cache.ccpu_model/aarch64.ccpu_model/x86.ccrtbegin.ccrtend.cemutls.cenable_execute_stack.ceprintf.cfp_mode.c(float exception handling)gcc_personality_v0.ci386/fp_mode.cint_util.cloongarch/fp_mode.cos_version_check.criscv/fp_mode.criscv/restore.S(callee-saved registers)riscv/save.S(callee-saved registers)trampoline_setup.cve/grow_stack.Sve/grow_stack_align.S
Floating-point implementations of builtins that are only called from soft-float code. It would be better to simply use the generic soft-float versions in this case.
i386/floatdidf.Si386/floatdisf.Si386/floatundidf.Si386/floatundisf.Sx86_64/floatundidf.Sx86_64/floatundisf.Sx86_64/floatdidf.cx86_64/floatdisf.c
Unsupported in any current target: used on old versions of 32-bit iOS with ARMv5.
arm/adddf3vfp.Sarm/addsf3vfp.Sarm/divdf3vfp.Sarm/divsf3vfp.Sarm/eqdf2vfp.Sarm/eqsf2vfp.Sarm/extendsfdf2vfp.Sarm/fixdfsivfp.Sarm/fixsfsivfp.Sarm/fixunsdfsivfp.Sarm/fixunssfsivfp.Sarm/floatsidfvfp.Sarm/floatsisfvfp.Sarm/floatunssidfvfp.Sarm/floatunssisfvfp.Sarm/gedf2vfp.Sarm/gesf2vfp.Sarm/gtdf2vfp.Sarm/gtsf2vfp.Sarm/ledf2vfp.Sarm/lesf2vfp.Sarm/ltdf2vfp.Sarm/ltsf2vfp.Sarm/muldf3vfp.Sarm/mulsf3vfp.Sarm/nedf2vfp.Sarm/negdf2vfp.Sarm/negsf2vfp.Sarm/nesf2vfp.Sarm/subdf3vfp.Sarm/subsf3vfp.Sarm/truncdfsf2vfp.Sarm/unorddf2vfp.Sarm/unordsf2vfp.S
License
Usage is allowed under the MIT License and the Apache License, Version 2.0 with the LLVM exception.
Contribution
Contributions are licensed under the MIT License, the Apache License, Version 2.0, and the Apache-2.0 license with the LLVM exception.
See LICENSE.txt for full details.