1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2009-02-23 16:12:38 +00:00
parent 0b58675868
commit 7019187067
2 changed files with 51 additions and 0 deletions

View file

@ -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

View file

@ -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);