zig/lib/std/special/compiler_rt
Andrew Kelley aecebf38ac stage2: progress towards ability to compile compiler-rt
* prepare compiler-rt to support being compiled by stage2
   - put in a few minor workarounds that will be removed later, such as
     using `builtin.stage2_arch` rather than `builtin.cpu.arch`.
   - only try to export a few symbols for now - we'll move more symbols
     over to the "working in stage2" section as they become functional
     and gain test coverage.
   - use `inline fn` at function declarations rather than `@call` with an
     always_inline modifier at the callsites, to avoid depending on the
     anonymous array literal syntax language feature (for now).
 * AIR: replace floatcast instruction with fptrunc and fpext for
   shortening and widening floating point values, respectively.
 * Introduce a new ZIR instruction, `export_value`, which implements
   `@export` for the case when the thing to be exported is a local
   comptime value that points to a function.
   - AstGen: fix `@export` not properly reporting ambiguous decl
     references.
 * Sema: handle ExportOptions linkage. The value is now available to all
   backends.
   - Implement setting global linkage as appropriate in the LLVM
     backend. I did not yet inspect the LLVM IR, so this still needs to
     be audited. There is already a pending task to make sure the alias
     stuff is working as intended, and this is related.
   - Sema almost handles section, just a tiny bit more code is needed in
     `resolveExportOptions`.
 * Sema: implement float widening and shortening for both `@floatCast`
   and float coercion.
   - Implement the LLVM backend code for this as well.
2021-09-21 23:21:07 -07:00
..
addXf3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
addXf3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
arm.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
ashldi3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
ashlti3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
ashrdi3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
ashrti3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
atomics.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
aulldiv.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
aullrem.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
clear_cache.zig zig fmt: respect trailing commas in inline assembly 2021-08-29 11:57:32 +02:00
clzdi2_test.zig compiler_rt: add __clzdi2 and __clzti2 2021-09-01 16:15:21 -04:00
clzsi2_test.zig compiler_rt: add __clzdi2 and __clzti2 2021-09-01 16:15:21 -04:00
clzti2_test.zig compiler_rt: add __clzdi2 and __clzti2 2021-09-01 16:15:21 -04:00
comparedf2_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
comparesf2_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
compareXf2.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
count0bits.zig compiler_rt: add __clzdi2 and __clzti2 2021-09-01 16:15:21 -04:00
divdf3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
divdf3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
divsf3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
divsf3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
divtf3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
divtf3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
divti3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
divti3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
emutls.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
extendXfYf2.zig stage2: progress towards ability to compile compiler-rt 2021-09-21 23:21:07 -07:00
extendXfYf2_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixdfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixdfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixdfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixdfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixdfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixdfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixint.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixint_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixsfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixsfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixsfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixsfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixsfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixsfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixtfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixtfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixtfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixtfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixtfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixtfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixuint.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunsdfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunsdfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunsdfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunsdfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunsdfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunsdfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunssfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunssfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunssfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunssfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunssfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunssfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunstfdi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunstfdi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunstfsi.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunstfsi_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
fixunstfti.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
fixunstfti_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatdidf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatdidf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatdisf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatditf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatditf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatsiXf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floattidf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floattidf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floattisf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floattitf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floattitf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatundidf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatundidf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatundisf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatunditf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatunditf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatunsidf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatunsisf.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatunsitf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatunsitf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatuntidf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatuntidf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatuntisf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatuntisf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatuntitf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
floatuntitf_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
floatXisf.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
int.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
lshrdi3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
lshrti3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
modti3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
modti3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
muldi3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
muldi3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
mulodi4.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
mulodi4_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
muloti4.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
muloti4_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
multi3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
multi3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
mulXf3.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
mulXf3_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
negXf2.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
popcountdi2.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
popcountdi2_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
README.md
shift.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
sparc.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
stack_probe.zig fix __chkstk on aarch64 2021-09-15 20:41:58 -04:00
truncXfYf2.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
truncXfYf2_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
udivmod.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
udivmoddi4_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
udivmodti4.zig std, compiler-rt: remove test names where applicable 2021-09-01 17:54:06 -07:00
udivmodti4_test.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
udivti3.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00
umodti3.zig remove redundant license headers from zig standard library 2021-08-24 12:25:09 -07:00

This compiler-rt library is ported from LLVM.

It's needed because LLVM emits library calls to compiler-rt when hardware lacks functionality, for example, 64-bit integer multiplication on 32-bit x86.

This library is automatically built as-needed for the compilation target and then statically linked and therefore is a transparent dependency for the programmer.

Any bugs should be solved by trying to duplicate the bug upstream.

  • If the bug exists upstream, get it fixed with the LLVM team and then port the fix downstream to Zig.
  • If the bug only exists in Zig, something went wrong porting the code, and you can run the C code and Zig code side by side in a debugger to figure out what's happening differently.