10 Commits

Author SHA1 Message Date
Jan Philipp Hafer
476bdc8b0b compiler_rt: restructure compiler_rt.zig according to README.md
Justifications
- compiler_rt base routines are almost finished, so make 1:1
mapping of code and documentation.
- Make adjustments to code + documentation simpler to prevent technical or
  documentation debt.
2023-02-19 14:00:55 -05:00
flexicoding
c993af6234
compiler_rt: remove unexported functions 2023-02-18 17:07:35 +00:00
matu3ba
1fa2b37d29
compiler_rt: document math functions (#14552)
This documents the currently implemented math functions in alphabetical
order and sorts the remaining items.
2023-02-13 02:18:26 -05:00
Jan Philipp Hafer
e10c0eefde compiler_rt: add __powihf2, __powisf2, __powidf2, __powitf2, __powixf2
Implementation and tests ported from LLVM release 80.
Tests of __powihf2 created from __powisf2 tests with minor adjustments.
2023-02-12 00:10:27 +02:00
matu3ba
d976b4e4a5
compiler_rt: __divmodti4 for libgcc symbol compatibility
- Copy and adjust __divmodsi4 tests for __divmoddi4 and __divmodti4.
- Assuming d = a/b does not overflow (MIN/-1) or uses div by 0,
  then tmp = (d * b) = (a/b * b) = a does not overflow.
  => Remove wraparound for remainder in applicable routines.
2023-02-11 14:41:08 +02:00
matu3ba
1bda8be2a3
compiler_rt: __ashlsi3, __ashrsi3, __lshrsi3 for symbol compatibility
These are unused in LLVM, but in gcc used for example by rl78.
Move test files into common file, add tests for aforementioned routines
and missing ones for __lshrti3.
2023-02-11 14:25:01 +02:00
Manlio Perillo
c1f71963a9 compiler_rt: fix and improve documentation
- In Integer Bit Operations, use zeros consistently and fix the
    incorrect function descriptions
  - In ucmp, fix the incorrect signedness of the operands
  - In Integer Arithmetic, document the signedness of the operands in
    div, udiv, mod, umod, udivmod and divmod as it is done in LLVM
    documentation
  - In Float Conversion, replace "int_to_float" to "int to float" and
    "uint_to_float" to "uint to float"
2023-02-04 17:23:03 +02:00
Jan Philipp Hafer
03cdb4fb58 compiler_rt: make README visually nice and improve explanations
This commit makes the text more dense with sources, noes the outstanding
audit and adds an explanation of the table before converting everything
to markdown tables.

For the status a checkmark or cross in utf8 encoding are used and the
input and output sizes of all operations are given inclusive comments for
understanding of the routines.

This should document all compiler_rt integer and float routines, but
does not include a documentation of existing ieee floating and math
routines.
2023-02-02 17:45:38 -05:00
Jan Philipp Hafer
776f7de967 update compiler_rt README and prettify it
This documents status of routines and adds the next work item
"Decimal float library routines", which are only recommended for
binary data. Complete absence of tests is also documented.
This does not document the various aliases, e.g. those for ARM.

Missing Integer library routines:
- __addvsi3
- __addvdi3
- __addvti3
- __addvdi3
- __addvti3
- __subvsi3
- __subvdi3
- __subvti3
- __subvdi3
- __subvti3
- __mulvsi3
- __mulvdi3
- __mulvti3
- __mulvdi3
- __mulvti3

Missing floating library routines:
- __powisf2
- __powidf2
- __powitf2
- __powixf2

Missing routines for symbol-level compatibility to gcc:
- __ashlsi3
- __ashrsi3
- __lshrsi3
2022-10-22 09:23:50 -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