From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7d533acec91ae16 X-Google-Attributes: gid103376,public From: Corey Ashford Subject: Re: Question for the folks who designed Ada95 Date: 1999/04/29 Message-ID: <3727EC39.E460C803@rocketmail.com>#1/1 X-Deja-AN: 472170285 Content-Transfer-Encoding: 7bit References: <7g2qu4$ca4$1@usenet.rational.com> <7g3b5g$p92$1@nnrp1.dejanews.com> <7g4ae3$hjh2@ftp.kvaerner.com> <7g4mk7$upg$1@nnrp1.dejanews.com> <3726A2B1.5793E3BE@rocketmail.com> <7g6upj$v5c$1@nnrp1.dejanews.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Rational Software Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-04-29T00:00:00+00:00 List-Id: Robert Dewar wrote: > > In article <3726A2B1.5793E3BE@rocketmail.com>, > Corey Ashford wrote: > > I tried out this technique, by the way, on Apex. Works > > like a champ and inlines exactly as you said. > > Note that there is no requirement at all that this work, > but it is not surprising to find that it would work > (accidentally? is it documented, I am not sure that it > is properly documented for GNAT either come to think > about it) since it is an obvious way of implementing > things. > > All the more reason for the ARG to insist on it. > > There are issues of what types it can be applied to. Shift > operations applied for example to non-binary modular types > are quite a puzzle. > > In GNAT, we allow shifts to be applied to any signed or > binary unsigned integer type whose size is 8, 16, 32, or > 64 (i.e. natural machine sizes for which shifts make > sense). > > It would be interesting to know what restrictions other > compilers impose on this usage. > > -----------== Posted via Deja News, The Discussion Network ==---------- > http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own It seems to me that the way to handle it is the way "and", "or", etc, were dealt with on non power-of-two modular types. That is, do the operation, then do a mod operation afterward. I haven't tried a non power-of-two pragma import(intrinsic, ...) yet. I'll try it and let you know what happens. - Corey