Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!mnetor!seismo!cmcl2!phri!roy From: roy@phri.UUCP Newsgroups: net.lang.c Subject: Re: Compiler Specific Operators Message-ID: <2386@phri.UUCP> Date: Sat, 12-Jul-86 14:36:11 EDT Article-I.D.: phri.2386 Posted: Sat Jul 12 14:36:11 1986 Date-Received: Sun, 13-Jul-86 07:02:44 EDT References: <1825@uw-beaver> Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 24 Summary: Isn't asm() what you're looking for? In article <1825@uw-beaver> golde@uw-beaver.UUCP (Helmut Golde) writes: > What do people think about allowing compilers to have their own > compiler/machine specific operators, in a standardized format. [...] > a $rol$= 5; /* rotate a left 5 bits */ If you want to do that sort of stuff (gross, but admitedly sometimes worth the big efficiency win), what's wrong with the following? # ifdef MY_FAVORITE_CPU asm ("rol a, #5"); /* Use nifty built-in rotate left instruction */ # elseif a = rol_func (a); /* Don't have that instruction? do it in software */ # endif If you wanted to be cynical, you could always claim that we already do have exactly what you are talking about :-) a <<= 5; /* use nifty pdp-11 shift-left instruction */ b = *--p; /* use nifty pdp-11 auto-decrement mode */ -- Roy Smith, {allegra,philabs}!phri!roy System Administrator, Public Health Research Institute 455 First Avenue, New York, NY 10016