Article

From:
To:
Robert Lee
Subject:
Re: Cardinality of a set
Newsgroup:
borland.public.delphi.objectpascal

Re: Cardinality of a set

<<<PhR:
From way back, I see absolute as the normal complement for untyped params.
Can't say your pointer and assignment look like a convincing improvement.
>>>

<<Bob:
Absolute implies memory address.  However, many params don't have any
memory associated with them as they are values.
>>

Bob, perhaps you want to warn people away from using absolute
indiscriminately, but I said "untyped parameters", and these cannot be
passed by value, of course.

<<
Consequently, it is not the best generalized
approach to these types of loops.  Now since classes are actually
pointers it is easy to see that the preponderance of arrays fall into
this catagory, and so I believe that the compiler should handle them
differently.  This was my "wish".
>>

I suppose the array access by pointer incrementation is valid for While
loops too, so you're not saying the For is less optimized than the While,
but that in the former case there's an extra optimization available for the
most common use, and it is not put in.

<<
This is the counter + array iterator that I mentioned.  Using ecx is
just coincidental.
>>

My view on it is that it is historical. TP was happy to use the cx Intel had
provided for this (with the loop operator), and now that the optimizer is
smarter by a degree of magnitude, somehow this former, trivial, optimization
hasn't been removed to free a reg. Have I got this right?

    PhR
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Tue, 26 Nov 2024 11:40:01 UTC
Copyright © 2009-2024
HREF Tools Corp.