diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-23 16:12:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-23 16:12:38 +0000 |
commit | 7019187067b9cc611f09ccf1445f484d9f609e2d (patch) | |
tree | b3c14e668251ecc98b8e19bf72b1d2cfec896fba | |
parent | 0b58675868978bbde67c25eec1223b8de05aba34 (diff) | |
download | ruby-7019187067b9cc611f09ccf1445f484d9f609e2d.tar.gz |
* insns.def (opt_minus): inline float operation.
* insns.def (opt_lt, opt_gt): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | insns.def | 45 |
2 files changed, 51 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Tue Feb 24 00:54:16 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * insns.def (opt_minus): inline float operation. + + * insns.def (opt_lt, opt_gt): ditto. + Tue Feb 24 00:24:13 2009 Yukihiro Matsumoto <matz@ruby-lang.org> * range.c (range_each): check #succ only when it is really @@ -1376,8 +1376,23 @@ opt_minus val = rb_big_minus(rb_int2big(a), rb_int2big(b)); } } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_MINUS)) { + val = DBL2NUM(RFLOAT_VALUE(recv) - RFLOAT_VALUE(obj)); + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } else { /* other */ + INSN_LABEL(normal_dispatch): PUSH(recv); PUSH(obj); CALL_SIMPLE_METHOD(1, idMINUS, recv); @@ -1654,7 +1669,22 @@ opt_lt val = Qfalse; } } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_LT)) { + val = RFLOAT_VALUE(recv) < RFLOAT_VALUE(obj) ? Qtrue : Qfalse; + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } else { + INSN_LABEL(normal_dispatch): PUSH(recv); PUSH(obj); CALL_SIMPLE_METHOD(1, idLT, recv); @@ -1713,7 +1743,22 @@ opt_gt val = Qfalse; } } + else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) { + if (0) { + } +#if 1 + else if (HEAP_CLASS_OF(recv) == rb_cFloat && + HEAP_CLASS_OF(obj) == rb_cFloat && + BASIC_OP_UNREDEFINED_P(BOP_GT)) { + val = RFLOAT_VALUE(recv) > RFLOAT_VALUE(obj) ? Qtrue : Qfalse; + } +#endif + else { + goto INSN_LABEL(normal_dispatch); + } + } else { + INSN_LABEL(normal_dispatch): PUSH(recv); PUSH(obj); CALL_SIMPLE_METHOD(1, idGT, recv); |