aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-13 05:49:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-13 05:49:43 +0000
commitf3eb4b5e91dc453a12005fd5c69720b6bff42ef7 (patch)
tree0961a34f48b7d7e38dc427d5c9bdb42c754d074f /vm_insnhelper.h
parent9bc78006bb916f50dd66bdf27bf60ae667655899 (diff)
downloadruby-f3eb4b5e91dc453a12005fd5c69720b6bff42ef7.tar.gz
insns.def: float comparison
* insns.def (opt_lt, opt_le, opt_gt, opt_ge): optimize flonum and on-heap float comparison. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.h')
-rw-r--r--vm_insnhelper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm_insnhelper.h b/vm_insnhelper.h
index de2fc5bd39..33e3f434cd 100644
--- a/vm_insnhelper.h
+++ b/vm_insnhelper.h
@@ -166,6 +166,8 @@ enum vm_regan_acttype {
#else
#define FLONUM_2_P(a, b) 0
#endif
+#define FLOAT_HEAP_P(x) (!SPECIAL_CONST_P(x) && RBASIC_CLASS(x) == rb_cFloat)
+#define FLOAT_INSTANCE_P(x) (FLONUM_P(x) || FLOAT_HEAP_P(x))
#ifndef USE_IC_FOR_SPECIALIZED_METHOD
#define USE_IC_FOR_SPECIALIZED_METHOD 1