From 7019187067b9cc611f09ccf1445f484d9f609e2d Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 23 Feb 2009 16:12:38 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 ++++++ insns.def | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/ChangeLog b/ChangeLog index aebe79fe78..944b258d36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 24 00:54:16 2009 Yukihiro Matsumoto + + * insns.def (opt_minus): inline float operation. + + * insns.def (opt_lt, opt_gt): ditto. + Tue Feb 24 00:24:13 2009 Yukihiro Matsumoto * range.c (range_each): check #succ only when it is really diff --git a/insns.def b/insns.def index 5534fb2479..78318940f6 100644 --- a/insns.def +++ b/insns.def @@ -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);