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,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.c:7800 comp.lang.ada:1026 Path: utzoo!yunexus!geac!daveb From: daveb@geac.UUCP (David Collier-Brown) Newsgroups: comp.lang.c,comp.lang.ada Subject: Re: Portable "asm" (Was: The D Programming Language) Summary: Interfaces are hard, but not impossible. Keywords: inline, interfaces, register transfer, optimization Message-ID: <2381@geac.UUCP> Date: 4 Mar 88 14:09:57 GMT Article-I.D.: geac.2381 Posted: Fri Mar 4 09:09:57 1988 References: <11702@brl-adm.ARPA> <243@eagle_snax.UUCP> <2245@geac.UUCP> <1988Feb25.203425.8925@utzoo.uucp> <689@l.cc.purdue.edu> <2738@mmintl.UUCP> <7401@brl-smoke.ARPA> Reply-To: daveb@geac.UUCP (David Collier-Brown) Followup-To: comp.lang.c Organization: The Geac Ada Misremberment Department List-Id: In article <7401@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: [re a discussion of "asm" in C] | A properly-designed system programming language should not have such | a feature at all. (It is not guaranteed in C, either.) The interface | between the optimized code produced for the HLL and the in-line | assembly code is quite problematic. Also, the compiler should not be | forced to have an assembler built-in just to handle such stuff... The interfaces are hard, but within state-of-practice (I hate the idea of assembler escapes for other reasons). As an example, in Honeywell's experimental ADAsil (an incomplete implementation of Ada[tm]), one could specify the interface to either a procedure or instruction, and whether its was to be placed inline or not. The compiler, having been informed about the restrictions on parameters via a pragma, arranged to do any register allocations and transfers required to execute the code. Specifically, one coded system calls by producing an object file containing the instruction (a trap), and placing the restrictions, the request to put it in-line and the requirements in pragmas preceding the call. The compiler would then insert the instruction, and make sure the registers were used properly around the instruction. Yes, its hard. But it was claimed to have been harder to write the pragma interpreter to find out what to do than to write the optimizer code to do it. --dave c-b ps: Corrections re difficulty and exact details welcome: this was some years ago! (Ada is old?) -- David Collier-Brown. {mnetor yunexus utgpu}!geac!daveb Geac Computers International Inc., | Computer Science loses its 350 Steelcase Road,Markham, Ontario, | memory (if not its mind) CANADA, L3R 1B3 (416) 475-0525 x3279 | every 6 months.