From mboxrd@z Thu Jan 1 00:00:00 1970 From: lm@mcvoy.com (Larry McVoy) Date: Sat, 6 May 2017 08:53:44 -0700 Subject: [TUHS] Discuss of style and design of computer programs from a In-Reply-To: <20170506155124.GK12539@yeono.kjorling.se> References: <20170506144011.GF28787@mcvoy.com> <20170506150913.57571411A@lod.com> <20170506152053.GI12539@yeono.kjorling.se> <20170506152411.GJ28787@mcvoy.com> <20170506155124.GK12539@yeono.kjorling.se> Message-ID: <20170506155344.GK28787@mcvoy.com> On Sat, May 06, 2017 at 03:51:24PM +0000, Michael Kj??rling wrote: > On 6 May 2017 08:24 -0700, from lm at mcvoy.com (Larry McVoy): > >> I would absolutely not say that doing something like that is standard > >> practice in modern programming. Even in microcontrollers, where > >> program and data memory can be scarce even today, I would argue that > >> the costs would not outweigh the benefits by a long shot. > > > > It strikes as being similar to Duff's device (1). Which is a niche thing > > but I still use that from time to time. Not to save memory, just because > > as a C programmer it seems pretty natural to do it. > > > > --lm > > > > (1) https://en.wikipedia.org/wiki/Duff's_device > > I disagree; loop unrolling and jumping to the beginning of some > instruction inside that unrolled loop is not at all the same thing as > jumping _into the middle of a machine language instruction_. That's fine, I feel no need to argue about it. Seemed similar to me but I'm not the sharpest tool in the shed :)