Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!decvax!decwrl!sun!wdl1!mas1!jda From: jda@mas1.UUCP (James Allen) Newsgroups: comp.lang.c Subject: Re: Paying attention to parentheses Message-ID: <157@mas1.UUCP> Date: Fri, 17-Apr-87 12:49:26 EST Article-I.D.: mas1.157 Posted: Fri Apr 17 12:49:26 1987 Date-Received: Sun, 19-Apr-87 17:48:46 EST References: <15958@sun.uucp> <5716@brl-smoke.ARPA> <532@omepd> <2094@mmintl.UUCP>, <1002@ubc-cs.UUCP> Lines: 46 In <1002@ubc-cs.UUCP> manis@ubc-cs.UUCP (Vincent Manis) writes: > Do all the people who are flaming on this subject understand that there are > machines which don't do floating-point operations in the order specified, > even if you write the code in assembly language? (Larger 370's certainly ^^^^^^^^^ > fall into this category; there is a certain type of NOP you write in order > to establish a sequence point in assembly language). I am not nearly so certain of this as Dr. Manis. In fact the larger multi megabuck 370's were required to give the same answers as the pocket calculater models IBM sold for a mere $150,000. There is a special NOP but it has nothing to do with floating-point. This NOP is usually meaningless to the applications programmer; here's an exception: /* ** Warning: this fragment helps explain the "special NOP", but is ** otherwise wrong. For one thing, any system call will do the equivalent ** of the special NOP; hence "signal" eliminates the need for the NOP ** in a Unix implementation. */ signal (SIGBUS, SIG_IGN); /* ignore memory violation in next function */ strcpy (might_be_corrupted_pointer, "hi earth"); the_special_NOP (); signal (SIGBUS, SIG_DFL); Without NOP, the access violation in strcpy may not show up until after the second call to signal(). During the special NOP, all memory writes logically issued by this CPU are physically completed. Special hardware eliminates the obvious programming problems: black = white; if (black != white) printf ("Impossible...even though storage \ location BLACK may contain old data, hardware comparators \ have made this obsolete data invisible to us."); The NOP therefore is required only for cpu-cpu, cpu-channel, and cpu-acccess_violation_hardware synchronization. The 370/165 Model I, by the way, treated the special NOP as an ordinary NOP and could not be made deterministic in this fashion. There's one or two other things I know about 370's, so if anyone else out there is "certain" about their behavior, I may be willing to book a bet... -- Nick the Greek