On Thursday 20 September 2001 05:12 am, Simon Cozens wrote:
> On Thu, Sep 20, 2001 at 10:05:00AM +0100, Leon Brocard wrote:
> > As it so happens, it strikes me that CONCAT Sx, Sx isn't
> > three-register code. I'd be much happier with CONCAT Sx, Sx, Sx - it'd
> > make it easier to generate code for and would fit in with the rest of
> > the instructions. Comments?
>
> It also means you *have* to allocate a new string each concat. That
> sucks.
>
It's no different than any of the other two-and-three register operands
(sans allocation, of course), except that you didn't bother creating a three
operand version.
(IOW, you have:
a += b
and
a = b + c
and
a ~= b
but not
a = b ~ c
)
Of course, that last is really:
a = b
a ~= c
anyway.
But that's two ops, vice one, and you may underallocate 'a' on the first op.
With 'a = b ~ c', you can allocate 'a' the correct length. (Assuming a bad
allocation scheme, the cuts the number of allocations of "@array" in half.)
If you're not going to have continuous string buffers, that's all moot. But
I would imagine that those would be handled via the PMC registers instead.
I wouldn't say that CONCAT Sx,Sx should be CONCAT Sx,Sx,Sx, but that CONCAT
Sx,Sx,Sx should be added. I'll patch (if warranted) when I find the time,
unless someone beats me to it.
--
Bryan C. Warnock
[EMAIL PROTECTED]