# New Ticket Created by  Klaas-Jan Stol 
# Please include the string:  [perl #58238]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58238 >


Parrot has an instruction called 'set_addr', that stores the address of a
label into an integer register.
IMCC (and pdd19_pir) defines a short-cut for this op, called 'addr'.

$I0 = addr XYZ


I propose to remove this shortcut; should anybody want to use it, just use
the full opname: $I0 = set_addr XYZ (or, which may look a bit better:
set_addr $I0, XYZ)
The rationale behind this proposal is as follows:

* This instruction is specially handled in the PIR compiler (IMCC). It is
true that IMCC needs to handle certain ops as a special case, where PASM and
PIR overlap; for instance, the 'if' op. No such overlap is present for
'addr'. Having special cases is fine if it's necessary, but otherwise it
makes the code more complex.
The rationale for having a special case for this instruction might lie in
the far history of Parrot; I seem to remember, years ago, that one needed
addresses to make sub calls. My memory may be wrong, though. Having a
special case for a much-used feature is, according to the Huffman coding
design principle, a good thing: make things that happen frequently
easier/shorter; but: (reason 2)

* A quick ack told me that this instruction is barely used, if any (did not
do any detailed inspection, though).

comments welcome, as always.
kjs

Reply via email to