[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Type propagation (was Re: [Gcl-devel] New random tester failures)

From: Paul F. Dietz
Subject: Type propagation (was Re: [Gcl-devel] New random tester failures)
Date: Sat, 11 Dec 2004 08:56:53 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803

Camm Maguire wrote:

Would appreciate comments as always.  Please note this is still a work
in progress.

I looked at what gets produced for functions like this one:

(declaim (optimize (speed 3) (safety 0) (debug 0) (compilation-speed 0) (space 

(defun foo (x y)
  (declare (type (integer 0 100) x y))
  (+ x y 123))

It doesn't unbox the arithmetic here, which tells me it isn't doing
the best job of type progation on + (it does unbox and do the arithmetic
inline if the intermediate and final results are asserted to be fixnums
with THE).  This operator should be such that if E1 and E2 have types
(INTEGER LO1 HI1) and (INTEGER LO2 HI2), then (+ E1 E2) has type
(INTEGER LO3 HI3), where LO3 = (+ LO1 LO2) and HI3 = (+ HI1 HI2).

This kind of fine grained type propagation is essential in many
cases, since just defining things to be fixnums makes most arithmetic
operations overflow.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]