summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def27
1 files changed, 11 insertions, 16 deletions
diff --git a/insns.def b/insns.def
index 72ce1d998f..506bbe21a7 100644
--- a/insns.def
+++ b/insns.def
@@ -1431,29 +1431,24 @@ opt_mult
if (FIXNUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_MULT, FIXNUM_REDEFINED_OP_FLAG)) {
long a = FIX2LONG(recv);
- if (a == 0) {
- val = recv;
- }
- else {
#ifdef HAVE_INT128_T
- VALUE rb_int128t2big(int128_t n);
- int128_t r = (int128_t)a * FIX2LONG(obj);
- if (RB_FIXABLE(r)) {
+ VALUE rb_int128t2big(int128_t n);
+ int128_t r = (int128_t)a * (int128_t)FIX2LONG(obj);
+ if (RB_FIXABLE(r)) {
val = LONG2FIX((long)r);
- }
- else {
+ }
+ else {
val = rb_int128t2big(r);
- }
+ }
#else
- long b = FIX2LONG(obj);
- if (MUL_OVERFLOW_FIXNUM_P(a, b)) {
+ long b = FIX2LONG(obj);
+ if (MUL_OVERFLOW_FIXNUM_P(a, b)) {
val = rb_big_mul(rb_int2big(a), rb_int2big(b));
- }
- else {
+ }
+ else {
val = LONG2FIX(a * b);
- }
-#endif
}
+#endif
}
else if (FLONUM_2_P(recv, obj) &&
BASIC_OP_UNREDEFINED_P(BOP_MULT, FLOAT_REDEFINED_OP_FLAG)) {