develooper Front page | perl.perl6.internals | Postings from February 2002

padding of FLOATVALs in CONSTANT section of bytecode?

Thread Next
From:
Andy Dougherty
Date:
February 7, 2002 09:12
Subject:
padding of FLOATVALs in CONSTANT section of bytecode?
Message ID:
Pine.SOL.4.10.10202071158230.14419-100000@maxwell.phys.lafayette.edu
Ok, I'm knee-deep in packfile.c looking at alignment issues, and have a
two questions about storing FLOATVALs in the CONSTANTS section of the
bytecode: [First, thanks to Gregor Purdy for the self-documenting
packfile.c and the nice companion docs/parrotbyte.pod.]

In docs/parrotbyte.pod, under CONSTANTS, it says

    For number constants (S is constant, and is equal to C<sizeof(FLOATVAL)>):

      +----------+----------+----------+----------+
      |                                           |
      |             S' bytes of Data              |
      |                                           |
      +----------+----------+----------+----------+

    where

      S' = S + (S % 4) ? (4 - (S % 4)) : 0

    If S' E<gt> S, then the extra bytes are filled with zeros.

First, may I assume that '4' is supposed to be sizeof(opcode_t), not a plain
4?.

Second, this claims that FLOATVALS are supposed to be padded out to an
opcode_t boundary, but currently, in packfile.c, they are not.  One place
where this is an issue is gcc/x86, where sizeof(long long) = 8, but
sizeof(long double) = 12, so that FLOATVALS aren't automatically padded 
out to an opcode_t boundary.

Are they supposed to be padded?

-- 
    Andy Dougherty		doughera@lafayette.edu


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About