On Thursday 04 October 2001 12:05 pm, Dan Sugalski wrote:
> At 11:29 AM 10/4/2001 -0400, Bryan C. Warnock wrote:
> >Just the fact that we needed this patch in the first place indicates that
> >we're not doing *nearly* enough talking beforehand of some of the
> >particulars of Dan's overall design.
>
> That's the thing, though--we *don't* need this patch, not for integer
> constants. It's actually detrimental to performance in many ways.
>
> Parrot guarantees you can embed 32-bit signed integer constants in the
> instruction stream, and that's it. These constants are used to load up
> integer registers, sure, but they're also used for jump offsets. Integer
> *variable* constants should go in the constant table. We don't have any of
> those yet, though. They come in with the PMC stuff.

Within t/, I count 42 instances of an integer constant being used as 
something other than a jump or branch offset.

So let's just work this out, shall we?

* A parrot bytecode entity.  (Each distinct item of an optree - the opcodes 
and its arguments).  

Constant size throughout the bytecode.  

Is it a fixed size across all platforms?  We've been saying 32 bits.  What 
about platforms that don't have a native 32 bit entity (both larger and 
smaller - Crays and embedded)

Is there a minimum size?  Absolute or relative.  (Absolute, like 16 bit, or 
relative, like size of the opcode)

Is there a maximum size? Absolute or relative.

Byte-order and bit-order.  Native or standardized.

* A parrot opcode.

Most of the same questions as above.  We'll talk about the actual opcode 
numbers separately.

* Opcode interval constants (how far between opcodes, for jumping and 
branching)

Fixed to size of a bytecode entity. 

Signed.

A minimum size would affect the sizes above.

What happens if a jump interval is larger than the type that contains it?

* Integer constants

Signed.

Minimum size?  (Size of bytecode or opcode, most likely.  But again, what 
about platforms where that may not be a native type.)

Maximum size?

What do we do if an integer constant fits inside a bytecode entity?

What do we do if an integer constant doesn't fit inside a bytecody entity, 
but fits inside an integer entity?

What do we do if an integer constant doesn't fit inside an integer entity?

* Numeric constants

Signed.

What do we do if a numerical constant fits inside a bytecode entity?  (a 32 
bit floating point type).

What do we do if a numerical constant doesn't fit inside a bytecody entity, 
but fits inside a numerical entity?

What do we do if a numerical constant doesn't fit inside a numerical entity?

Native or standardized?

* Constant table offsets

Unsigned.

What happens if (shudder) we have have an offset greater than the type that 
can represent it?

***

Yes, some of them are right silly questions, but since computer programs are 
"default allow', we've got to address them.  Limits are a good thing, and 
even better if we define what they are, (particularly because we're going to 
so much trouble to make Perl limitless.)

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to