! Copyright (C) 2005 Slava Pestov. ! See http://factor.sf.net/license.txt for BSD license. IN: compiler-backend USING: arrays assembler compiler errors kernel kernel-internals math math-internals memory namespaces words ; : literal-overflow ( -- dest src ) #! Called if the src operand is a literal. #! Untag the dest operand. dest/src over tag-bits SAR tag-bits neg shift ; : computed-overflow ( -- dest src ) #! Called if the src operand is a register. #! Untag both operands. dest/src 2dup tag-bits SAR tag-bits SAR ; : simple-overflow ( inverse word -- ) #! If the previous arithmetic operation overflowed, then we #! turn the result into a bignum and leave it in EAX.