aboutsummaryrefslogtreecommitdiffstats
path: root/internal/numeric.h
Commit message (Collapse)AuthorAgeFilesLines
* Allow inlining Integer#-@ and #~Takashi Kokubun2020-12-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | ``` $ benchmark-driver -v --rbenv 'before --jit;after --jit' benchmark/mjit_integer.yml --filter '(comp|uminus)' before --jit: ruby 3.0.0dev (2020-12-23T05:41:44Z master 0dd4896175) +JIT [x86_64-linux] after --jit: ruby 3.0.0dev (2020-12-23T06:25:41Z master 8887d78992) +JIT [x86_64-linux] last_commit=Allow inlining Integer#-@ and #~ Calculating ------------------------------------- before --jit after --jit mjit_comp(1) 44.006M 70.417M i/s - 40.000M times in 0.908967s 0.568042s mjit_uminus(1) 44.333M 68.422M i/s - 40.000M times in 0.902255s 0.584603s Comparison: mjit_comp(1) after --jit: 70417331.4 i/s before --jit: 44005980.4 i/s - 1.60x slower mjit_uminus(1) after --jit: 68422468.8 i/s before --jit: 44333371.0 i/s - 1.54x slower ```
* Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer ↵Kenta Murata2020-12-091-0/+2
| | | | | | sequences (#3870) [Bug #17218] [ruby-core:100312]
* include/ruby/backward/2/r_cast.h: deprecate卜部昌平2020-08-271-1/+1
| | | | | Remove all usages of RCAST() so that the header file can be excluded from ruby/ruby.h's dependency.
* fix MJIT link error卜部昌平2020-07-131-1/+2
|
* inline Primitive.cexpr!卜部昌平2020-07-131-1/+3
| | | | | We can obtain the verbatim source code of Primitive.cexpr!. Why not paste that content into the JITed program.
* add #include guard hack卜部昌平2020-04-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | According to MSVC manual (*1), cl.exe can skip including a header file when that: - contains #pragma once, or - starts with #ifndef, or - starts with #if ! defined. GCC has a similar trick (*2), but it acts more stricter (e. g. there must be _no tokens_ outside of #ifndef...#endif). Sun C lacked #pragma once for a looong time. Oracle Developer Studio 12.5 finally implemented it, but we cannot assume such recent version. This changeset modifies header files so that each of them include strictly one #ifndef...#endif. I believe this is the most portable way to trigger compiler optimizations. [Bug #16770] *1: https://docs.microsoft.com/en-us/cpp/preprocessor/once *2: https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-5/+5
| | | Split ruby.h
* internal/rational.h: insert assertions in RATIONAL_SET_{NUM,DEN}Kenta Murata2020-01-171-0/+12
|
* internal/numeric.h rework卜部昌平2019-12-261-34/+61
| | | | | Marked MJIT_FUNC_EXPORTED functions as such. Other changes are rather cosmetic.
* internal/fixnum.h rework卜部昌平2019-12-261-4/+1
| | | | Add #include lines, move FIXNUM_POSITIVE_P etc. from numeric.h.
* split internal.h into files卜部昌平2019-12-261-0/+213
One day, I could not resist the way it was written. I finally started to make the code clean. This changeset is the beginning of a series of housekeeping commits. It is a simple refactoring; split internal.h into files, so that we can divide and concur in the upcoming commits. No lines of codes are either added or removed, except the obvious file headers/footers. The generated binary is identical to the one before.