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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be920da40970e1c2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-01 13:00:21 PST Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: gnat/ppc and a32 blt transfers Date: Wed, 01 Nov 2000 20:52:10 GMT Organization: Deja.com - Before you buy. Message-ID: <8tpvpl$ige$1@nnrp1.deja.com> References: <3A007357.FF3475A0@mindspring.com> NNTP-Posting-Host: 205.232.38.240 X-Article-Creation-Date: Wed Nov 01 20:52:10 2000 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; I) X-Http-Proxy: 1.0 x73.deja.com:80 (Squid/1.1.22) for client 205.232.38.240 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:1693 Date: 2000-11-01T20:52:10+00:00 List-Id: In article <3A007357.FF3475A0@mindspring.com>, Al Johnston wrote: > I am having trouble with 64 bit accesses from the cpu to some of our > vme (slave) cards. The slaves do not like the MBLT (AM=0c) accesses > that the compilers code is causing to be used on the bus. > > So what I need to do is write my own ":=" and relational operators > that access the 64bit entity via two 32 bit reads/writes. If you need to control the exact instruction sequences that a compiler is generating, do it properly, with machine language inserts. Do not fiddle around with the compiler to try to get it to produce the code you want. That's a recipe for non-portable code. If you try to fool the compiler, then it is easily possible that some later version may be cleverer and undo your subterfuge. I have seen nothing but trouble caused by undocumented and unwarranted assumptions about the exact sequence of machine language instructions. One remarkable example with one of our customers was in the following situation: type x is array (integer range <>) of boolean; pragma Pack (x); subtype y is array (0 .. 31); z : y; for z use at ... ... z (4) := ....; The code malfunctioned when ported from VADS to GNAT. Why? Because VADS chose to do load-word/modify bit/store-word, and GNAT chose to do load-byte/modify bit/store-byte. Both are perfectly fine sequences of instructions, there is no reason to prefer one over the other from the compiler's point of view. UNFORTUNATELY: the address clause was placing the memory in some strange home brewed memory mapped I/O device, which only happened to recognize word accesses (this was on a 68K) and did not recognize byte accesses (but indeed simply did something weird, since the byte access case had been left as don't care since probably the hardware folks had been told -- don't worry we will only do word accesses. Easy enough to fix once found, but not at all easy to find. If you want to write in Ada, write in Ada, if you want to write machine code, write in machine code! > I was wondering if this would be an appropriate place you use > ada95's "controlled types"? No, it is not! Sent via Deja.com http://www.deja.com/ Before you buy.