Re: More on Lisp structures performance
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Probably you don’t compare to zero. Rather you look at the Minus bit in some control register, and branch when that first happens. Just needs to check a single bit to detect the end condition. > On Jan 23, 2026, at 11:37, Yuri Davidovsky <[email protected]> wrote: > > >> On 23 Jan 2026, at 17:36, David McClain <[email protected]> wrote: >> >> Also… the loop limit, as you describe being too large to plant in one immediate operand, is why, for more than 40 years, I have always striven to perform descending loop counts so that I can test against zero, plus or minus. Just have to compute the limit once, at the start, then just decrement and test against zero. > > That should actually work, as long as the compiler does not think of the 0 like a literal to be inlined, so you end up in a similar situation: it may try to write a zero into a register first, and then compare. > > I do not actually know if it would happen, I might test that too when revisiting the topic. _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html