aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix JIT link failuresTakashi Kokubun2021-01-181-8/+2
| | | | forgotten in https://github.com/ruby/ruby/pull/4018
* Improve performance some Float methods [Feature #17498] (#4018)S.H2021-01-011-53/+1
|
* Allow inlining Integer#-@ and #~Takashi Kokubun2020-12-221-30/+4
| | | | | | | | | | | | | | | | | | | | | | ``` $ 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 ```
* Move docs for Integer#bit_length [ci skip]Alan Wu2020-12-141-45/+0
|
* Remove unused function declarationsS-H-GAMELINKS2020-12-121-4/+0
|
* Fix ArithmeticSequence#last and ArithmeticSequence#each for non-integer ↵Kenta Murata2020-12-091-24/+29
| | | | | | sequences (#3870) [Bug #17218] [ruby-core:100312]
* renameS-H-GAMELINKS2020-11-201-3/+3
|
* fix codeS-H-GAMELINKS2020-11-201-14/+4
|
* add flo_prev_or_next funcS-H-GAMELINKS2020-11-201-8/+21
|
* numeric.c, range.c: prohibit zero stepKenta Murata2020-10-231-3/+6
| | | | | | | | | * numeric.c: prohibit zero step in Numeric#step * range.c: prohibit zero step in Range#step * Fix ruby-spec [Feature #15573]
* Don't redefine #rb_intern over and over againStefan Stüben2020-10-211-6/+3
|
* Hoisted out ensure_cmp which checks the comparison succeededNobuyoshi Nakada2020-10-021-9/+13
|
* Ensure that the comparison succeeded [Bug #17205]Nobuyoshi Nakada2020-10-021-1/+3
|
* Fix unsigned int overflow in error message for chrPeter Zhu2020-09-301-1/+1
| | | | | | | | | | | | | | | | | | The error message has an integer overflow because it treats an unsigned int as a signed int. Before: ``` > 3_000_000_000.chr -1294967296 out of char range (RangeError) ``` After: ``` > 3_000_000_000.chr 3000000000 out of char range (RangeError) ``` Redmine ticket: https://bugs.ruby-lang.org/issues/17186
* [DOC] Use oracle url instead of sun urlS-H-GAMELINKS2020-08-051-1/+1
| | | | [ci skip]
* Use https instead of httpKazuhiro NISHIYAMA2020-07-281-1/+1
|
* fix MJIT link error卜部昌平2020-07-131-1/+1
|
* inline Primitive.cexpr!卜部昌平2020-07-131-0/+12
| | | | | We can obtain the verbatim source code of Primitive.cexpr!. Why not paste that content into the JITed program.
* add UNREACHABLE_RETURN卜部昌平2020-06-291-0/+1
| | | | | | Not every compilers understand that rb_raise does not return. When a function does not end with a return statement, such compilers can issue warnings. We would better tell them about reachabilities.
* fix_pow: do not goto into a branch卜部昌平2020-06-291-31/+26
| | | | | I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
* int_pow: do not goto into a branch卜部昌平2020-06-291-7/+9
| | | | | I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
* flo_to_s: do not goto into a branch卜部昌平2020-06-291-11/+14
| | | | | I'm not necessarily against every goto in general, but jumping into a branch is definitely a bad idea. Better refactor.
* Mark some Integer methods as inline (#3264)Takashi Kokubun2020-06-271-73/+0
|
* Make Integer#zero? a separated method and builtin (#3226)Takashi Kokubun2020-06-201-7/+17
| | | | | | | A prerequisite to fix https://bugs.ruby-lang.org/issues/15589 with JIT. This commit alone doesn't make a significant difference yet, but I thought this commit should be committed independently. This method override was discussed in [Misc #16961].
* Remove unused else if statements in int_even_p func (#3220)S.H2020-06-161-10/+6
| | | | | | | * remove else if & rb_funcall * fix int_even_p impl * fix rb_int_odd_p implementation
* Add static modifier for rb_int_ceil & rb_int_floor (#3217)S.H2020-06-161-4/+4
|
* numeric.c: optimize `float ** 2` case by fastpathYusuke Endoh2020-05-121-1/+5
| | | | | | It would be a relatively frequent case. It is still slower than `float * float` because `*` has a dedicated VM instruction (opt_mult), though.
* sed -i 's|ruby/impl|ruby/internal|'卜部昌平2020-05-111-1/+1
| | | | To fix build failures.
* sed -i s|ruby/3|ruby/impl|g卜部昌平2020-05-111-1/+1
| | | | This shall fix compile errors.
* Added more NORETURN declarationsNobuyoshi Nakada2020-05-111-0/+2
|
* numeric.c: Remove unreachable codeYusuke Endoh2020-04-091-4/+1
| | | | b cannot be <= 0 here. Found by Coverity Scan
* Suppress C4244 "possible loss of data" warningsNobuyoshi Nakada2020-04-081-1/+1
|
* Suppress -Wswitch warningsNobuyoshi Nakada2020-04-081-0/+2
|
* Merge pull request #2991 from shyouhei/ruby.h卜部昌平2020-04-081-4/+16
| | | Split ruby.h
* Removed non-RUBY_INTEGER_UNIFICATION codeNobuyoshi Nakada2020-03-211-6/+0
|
* Remove Float::ROUNDSJeremy Evans2020-03-091-20/+0
| | | | Fixes [Bug #16044]
* Check the encoding of `half:` optionNobuyoshi Nakada2020-01-271-0/+1
|
* decouple internal.h headers卜部昌平2019-12-261-4/+18
| | | | | | | | | | | | | | | | | | Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies).
* add several __has_something macro卜部昌平2019-12-261-11/+11
| | | | | | | With these macros implemented we can write codes just like we can assume the compiler being clang. MSC_VERSION_SINCE is defined to implement those macros, but turned out to be handy for other places. The -fdeclspec compiler flag is necessary for clang to properly handle __has_declspec().
* make functions static卜部昌平2019-11-191-3/+4
| | | | | | | These functions are used from within a compilation unit so we can make them static, for better binary size. This changeset reduces the size of generated ruby binary from 26,590,128 bytes to 26,584,472 bytes on my macihne.
* Use FIX2LONG instead of FIX2INT like 26843cbcd0NARUSE, Yui2019-11-071-4/+4
|
* Use FIX2LONG to avoid unexpected exceptionNARUSE, Yui2019-11-071-1/+1
| | | | | Though it won't happen in the real world in this context, FIX2INT may raise an exception and it cause to generate extra code.
* Suppress keyword argument warning from #stepNobuyoshi Nakada2019-09-301-1/+1
| | | | | | * numeric.c (num_step): pass the extracted argument from keyword argument, not the last argument itself which should have been warned already.
* Inspect dynamic symbol as well as static symbolNobuyoshi Nakada2019-08-251-1/+1
|
* Expanded f_quoNobuyoshi Nakada2019-08-101-3/+3
|
* Deprecate Float::ROUNDS, which should not be a constantNobuyoshi Nakada2019-08-071-1/+4
| | | | [Bug #16044]
* Predefine some IDsNobuyoshi Nakada2019-08-031-7/+6
|
* Expanded f_ceilNobuyoshi Nakada2019-08-021-1/+8
|
* Adjust styles and indentsNobuyoshi Nakada2019-07-191-1/+2
|
* numeric.c (fix_cmp): remove a unreachable return statementYusuke Endoh2019-07-141-1/+0
|