comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: Ada case-statement
Date: Thu, 15 Mar 2018 09:56:52 +0200
Date: 2018-03-15T09:56:52+02:00	[thread overview]
Message-ID: <fguna4Fb0ugU1@mid.individual.net> (raw)
In-Reply-To: <p8d1q1$jub$1@gioia.aioe.org>

On 18-03-15 07:54 , J-P. Rosen wrote:
> Le 15/03/2018 à 04:10, Dan'l Miller a écrit :
>> For dense case statements that utilize all or most of an enumerated
>> type's enumerated values, a jump table is the most likely on most
>> processors to achieve O(1) growth [instead of if-statement-based O(n)
>> growth, where n is the quantity of enumerated values in an enumerated
>> type].
> Long time ago, as I was working on Ada/ED, my shelf had a PHD thesis
> entirely on how to generate code for case statements. Various techniques
> depending on the number of values, the density of mentionned values in
> the subtype, etc.
>
> Of course, you had the if/elsif and plain jump table techniques, but
> also hashed jump tables, jump tables indexed by intervals, various mixes
> (if/elsif to eliminate sparse cases, then tables for the rest)...

And soon we will have processors with the "Mill" architecture, which can 
execute up to five conditional jumps in _parallel_, in each CPU cycle... 
brings a whole new set of possibilities for case-statement codde :-)

https://millcomputing.com/docs/switches/

BTW, the Mill architecture would be good at running Ada programs: very 
good at controlling the handling arithmetic errors, also good at 
subprogram calling, threading, emphasis on security (octet-granularity 
memory protection), etc. As a statically scehduled processor, it _could_ 
also be the only hope left for a powerful architecture with somewhat 
deterministic execution timing, for use in critical real-time systems, 
although the Mill developers currently do not describe it as a real-time 
processor.

-- 
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
       .      @       .


  reply	other threads:[~2018-03-15  7:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 17:35 Ada case-statement Stephen Davies
2018-03-14 17:49 ` Dmitry A. Kazakov
2018-03-15  0:57   ` Robert I. Eachus
2018-03-15  3:10     ` Dan'l Miller
2018-03-15  5:54       ` J-P. Rosen
2018-03-15  7:56         ` Niklas Holsti [this message]
2018-03-15 12:21           ` Dan'l Miller
2018-03-15 17:22             ` Mill processor (Was: Re: Ada case-statement) Niklas Holsti
2018-03-15 21:50     ` Ada case-statement Randy Brukardt
2018-03-14 22:22 ` Mehdi Saada
2018-03-14 23:16 ` Randy Brukardt
2018-03-15  5:04   ` gautier_niouzes
2018-03-15  7:50   ` Jacob Sparre Andersen
2018-03-15 22:05     ` Randy Brukardt
2018-03-15  8:37   ` Dmitry A. Kazakov
2018-03-15 22:20     ` Randy Brukardt
2018-03-16  8:54       ` Dmitry A. Kazakov
2018-03-16 23:49         ` Randy Brukardt
2018-03-17  7:59           ` Dmitry A. Kazakov
2018-03-15 15:37   ` Stephen Davies
2018-03-15 16:33     ` J-P. Rosen
2018-03-15 17:01       ` Dmitry A. Kazakov
2018-03-15 18:41         ` Shark8
2018-03-15 21:12           ` Jeffrey R. Carter
2018-03-18  5:41             ` Robert I. Eachus
2018-03-18  6:57               ` Spiros Bousbouras
2018-03-18  9:17               ` Jeffrey R. Carter
2018-03-18 12:53                 ` Simon Wright
2018-03-15 18:50     ` Jere
2018-03-15 20:40       ` Anh Vo
2018-03-15 22:24     ` Randy Brukardt
2018-03-16  9:53       ` Stephen Davies
2018-04-03 17:56   ` marciant
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox