diff --git a/library/compiler/x86/fixnum.factor b/library/compiler/x86/fixnum.factor index 4baffd5de6..ad588a5607 100644 --- a/library/compiler/x86/fixnum.factor +++ b/library/compiler/x86/fixnum.factor @@ -4,17 +4,33 @@ IN: compiler-backend USING: assembler compiler errors kernel math math-internals memory namespaces words ; -: simple-overflow ( dest -- ) +: literal-overflow + #! If the src operand is a literal. + ! Untag the operand. + over tag-bits SAR + tag-bits neg shift ; + +: computed-overflow + #! If the src operand is a register. + ! Untag both operands. + 2dup tag-bits SAR tag-bits SAR ; + +: simple-overflow ( dest src inv word -- ) #! If the previous arithmetic operation overflowed, then we - #! turn the result into a bignum and leave it in EAX. This - #! does not trigger a GC if memory is full -- is that bad? + #! turn the result into a bignum and leave it in EAX. + >r >r