vm: using bignum>fixnum-strict in integer>fixnum-strict.
parent
d225bec128
commit
eeaa91d6c1
|
@ -502,6 +502,7 @@ tuple
|
||||||
{ "bignum>" "math.private" "primitive_bignum_greater" ( x y -- ? ) }
|
{ "bignum>" "math.private" "primitive_bignum_greater" ( x y -- ? ) }
|
||||||
{ "bignum>=" "math.private" "primitive_bignum_greatereq" ( x y -- ? ) }
|
{ "bignum>=" "math.private" "primitive_bignum_greatereq" ( x y -- ? ) }
|
||||||
{ "bignum>fixnum" "math.private" "primitive_bignum_to_fixnum" ( x -- y ) }
|
{ "bignum>fixnum" "math.private" "primitive_bignum_to_fixnum" ( x -- y ) }
|
||||||
|
{ "bignum>fixnum-strict" "math.private" "primitive_bignum_to_fixnum_strict" ( x -- y ) }
|
||||||
{ "fixnum-shift" "math.private" "primitive_fixnum_shift" ( x y -- z ) }
|
{ "fixnum-shift" "math.private" "primitive_fixnum_shift" ( x y -- z ) }
|
||||||
{ "fixnum/i" "math.private" "primitive_fixnum_divint" ( x y -- z ) }
|
{ "fixnum/i" "math.private" "primitive_fixnum_divint" ( x y -- z ) }
|
||||||
{ "fixnum/mod" "math.private" "primitive_fixnum_divmod" ( x y -- z w ) }
|
{ "fixnum/mod" "math.private" "primitive_fixnum_divmod" ( x y -- z w ) }
|
||||||
|
|
|
@ -67,10 +67,7 @@ M: fixnum (log2) fixnum-log2 { fixnum } declare ; inline
|
||||||
M: bignum >fixnum bignum>fixnum ; inline
|
M: bignum >fixnum bignum>fixnum ; inline
|
||||||
M: bignum >bignum ; inline
|
M: bignum >bignum ; inline
|
||||||
M: bignum integer>fixnum bignum>fixnum ; inline
|
M: bignum integer>fixnum bignum>fixnum ; inline
|
||||||
|
M: bignum integer>fixnum-strict bignum>fixnum-strict ; inline
|
||||||
M: bignum integer>fixnum-strict
|
|
||||||
dup bignum>fixnum
|
|
||||||
2dup number= [ nip ] [ drop out-of-fixnum-range ] if ; inline
|
|
||||||
|
|
||||||
M: bignum hashcode* nip bignum>fixnum ;
|
M: bignum hashcode* nip bignum>fixnum ;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,10 @@ void factor_vm::primitive_bignum_to_fixnum() {
|
||||||
ctx->replace(tag_fixnum(bignum_to_fixnum(untag<bignum>(ctx->peek()))));
|
ctx->replace(tag_fixnum(bignum_to_fixnum(untag<bignum>(ctx->peek()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void factor_vm::primitive_bignum_to_fixnum_strict() {
|
||||||
|
ctx->replace(tag_fixnum(bignum_to_fixnum_strict(untag<bignum>(ctx->peek()))));
|
||||||
|
}
|
||||||
|
|
||||||
void factor_vm::primitive_float_to_fixnum() {
|
void factor_vm::primitive_float_to_fixnum() {
|
||||||
ctx->replace(tag_fixnum(float_to_fixnum(ctx->peek())));
|
ctx->replace(tag_fixnum(float_to_fixnum(ctx->peek())));
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,8 @@ namespace factor {
|
||||||
_(bignum_divmod) _(bignum_eq) _(bignum_greater) _(bignum_greatereq) \
|
_(bignum_divmod) _(bignum_eq) _(bignum_greater) _(bignum_greatereq) \
|
||||||
_(bignum_less) _(bignum_lesseq) _(bignum_log2) _(bignum_mod) \
|
_(bignum_less) _(bignum_lesseq) _(bignum_log2) _(bignum_mod) \
|
||||||
_(bignum_gcd) _(bignum_multiply) _(bignum_not) _(bignum_or) \
|
_(bignum_gcd) _(bignum_multiply) _(bignum_not) _(bignum_or) \
|
||||||
_(bignum_shift) _(bignum_subtract) _(bignum_to_fixnum) _(bignum_xor) \
|
_(bignum_shift) _(bignum_subtract) _(bignum_to_fixnum) \
|
||||||
|
_(bignum_to_fixnum_strict) _(bignum_xor) \
|
||||||
_(bits_double) _(bits_float) _(byte_array) _(callback) _(callstack) \
|
_(bits_double) _(bits_float) _(byte_array) _(callback) _(callstack) \
|
||||||
_(callstack_bounds) _(callstack_for) _(callstack_to_array) \
|
_(callstack_bounds) _(callstack_for) _(callstack_to_array) \
|
||||||
_(check_datastack) _(clear_samples) _(clone) _(code_blocks) _(code_room) \
|
_(check_datastack) _(clear_samples) _(clone) _(code_blocks) _(code_room) \
|
||||||
|
|
|
@ -473,6 +473,7 @@ struct factor_vm {
|
||||||
|
|
||||||
// math
|
// math
|
||||||
void primitive_bignum_to_fixnum();
|
void primitive_bignum_to_fixnum();
|
||||||
|
void primitive_bignum_to_fixnum_strict();
|
||||||
void primitive_float_to_fixnum();
|
void primitive_float_to_fixnum();
|
||||||
void primitive_fixnum_divint();
|
void primitive_fixnum_divint();
|
||||||
void primitive_fixnum_divmod();
|
void primitive_fixnum_divmod();
|
||||||
|
|
Loading…
Reference in New Issue