-
Notifications
You must be signed in to change notification settings - Fork 6
/
llrb_insn_opt_gt.c
38 lines (36 loc) · 1002 Bytes
/
llrb_insn_opt_gt.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "cruby.h"
VALUE
llrb_insn_opt_gt(VALUE recv, VALUE obj)
{
if (FIXNUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_GT, INTEGER_REDEFINED_OP_FLAG)) {
SIGNED_VALUE a = recv, b = obj;
if (a > b) {
return Qtrue;
}
else {
return Qfalse;
}
}
else if (FLONUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
/* flonum is not NaN */
return RFLOAT_VALUE(recv) > RFLOAT_VALUE(obj) ? Qtrue : Qfalse;
}
//else if (!SPECIAL_CONST_P(recv) && !SPECIAL_CONST_P(obj)) {
// if (RBASIC_CLASS(recv) == rb_cFloat && RBASIC_CLASS(obj) == rb_cFloat &&
// BASIC_OP_UNREDEFINED_P(BOP_GT, FLOAT_REDEFINED_OP_FLAG)) {
// val = double_cmp_gt(RFLOAT_VALUE(recv), RFLOAT_VALUE(obj));
// }
// else {
// goto INSN_LABEL(normal_dispatch);
// }
//}
else {
//INSN_LABEL(normal_dispatch):
//PUSH(recv);
//PUSH(obj);
//CALL_SIMPLE_METHOD(recv);
return rb_funcall(recv, '>', 1, obj);
}
}