From b0cfcca9904a6c3d106edb2de2e8d14b805dda08 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 11 Dec 2005 03:48:09 +0000 Subject: [PATCH] fix AMD64 %fixnum* overflow --- library/compiler/basic-blocks.factor | 8 ++++++++ library/compiler/ppc/fixnum.factor | 2 +- library/compiler/x86/fixnum.factor | 2 +- library/test/compiler/intrinsics.factor | 10 ++++++---- native/s48_bignum.c | 15 +++++++++++++-- native/s48_bignum.h | 1 + 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/library/compiler/basic-blocks.factor b/library/compiler/basic-blocks.factor index d9488972ad..b1c3c5ad89 100644 --- a/library/compiler/basic-blocks.factor +++ b/library/compiler/basic-blocks.factor @@ -5,6 +5,14 @@ USING: arrays hashtables kernel lists math namespaces sequences ; ! Optimizations performed here: ! - combining %inc-d/%inc-r within a single basic block +! - if a literal is loaded into a vreg but the vreg is +! overwritten before being read, the literal load is deleted +! - if a %replace is writing a vreg to a stack location already +! holding that vreg, or a stack location that is not read +! before being popped, the %replace is deleted +! - if a %peek is reading a stack location into a vreg that +! already holds that vreg, or if the vreg is overwritten +! before being read, the %peek is deleted ! - removing dead loads of stack locations into vregs ! - removing dead stores of vregs into stack locations diff --git a/library/compiler/ppc/fixnum.factor b/library/compiler/ppc/fixnum.factor index 1aa2d39eb7..8d26dc9118 100644 --- a/library/compiler/ppc/fixnum.factor +++ b/library/compiler/ppc/fixnum.factor @@ -36,7 +36,7 @@ M: %fixnum* generate-node ( vop -- ) "end" get BNO >3-vop< MULHW 4 0 scratch MR - "s48_long_long_to_bignum" f compile-c-call + "s48_long_pair_to_bignum" f compile-c-call ! now we have to shift it by three bits to remove the second ! tag tag-bits neg 4 LI diff --git a/library/compiler/x86/fixnum.factor b/library/compiler/x86/fixnum.factor index 28c5495a9b..8081cd6d6f 100644 --- a/library/compiler/x86/fixnum.factor +++ b/library/compiler/x86/fixnum.factor @@ -44,7 +44,7 @@ M: %fixnum* generate-node ( vop -- ) 0 input-operand IMUL