This patch moves integer constants to the constant table if the size chosen
for integers is not the same as the size chosen for opcodes. It will work
whether or not the size is greater or less. HOWEVER, I experience problems
on Tru64 when I set INTVAL to int instead of long because it wasn't large
enough to hold a pointer and the casts from pointer to INTVAL in memory.c,
strnative.c and register.c failed. That has nothing to do with this patch,
only that we do not check to see if the integer is as big as a pointer.
I'll try to patch that later. This patch, on the other hand, works fine on
CygWin, Solaris 5.8, and Tru64. I would like to get other people's feedback
on whether or not it works for some of the other systems.
Summary of what changed:
1.) All assembler pack types are now $pack_type{op} except for an explicit
intval. The intval pack type is only used in NON bytecode areas (such as
the constant table). All bytecode is $pack_type{op}.
2.) Integer and number constants are no longer changed to the form [nc:N],
but instead are just N as nothing acutally needed the [nc:N] format.
3.) Fixed some inconsistencies between PackFile and packfile.c in the way
the string constants were handled (it relied on op and intval to be the same
length)
4.) Used INT_CONST in basic_opcodes.ops wherever an ic was used.
5.) If sizeof('opcode') == sizeof('intval') then all integer constants are
inline, otherwise, they are out of line.
6.) The constant table still uses intval exclusively for its sizes and
such.
7.) Labels are still treated as integers and as such can now end up in the
constants table.
8.) Evaluating numeric and integer constants in the assembler is now
postponed until the type of the constant is known so that 0 can still become
a FLOATVAL constant without having to type 0.0
Any and all feedback is appreciated.
Thanks!
Tanton
patch.dat