Path: utzoo!attcan!uunet!husc6!ukma!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: << (was Re: "for" loops in C ...) Message-ID: <14447@mimsy.UUCP> Date: 9 Nov 88 19:38:10 GMT References: <867@cernvax.UUCP> <645@quintus.UUCP> <339@igor.Rational.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 In article <339@igor.Rational.COM> dsb@Rational.COM (David S. Bakin) writes: >[What's going on? The article I'm replying to was signed by Chris Torek of > uunet!mimsy!chris but the headers say it is from ok@quintus.uucp???] I have no idea why that happened. >... The operator << is defined in C as a left shift, what >does that have to do with a particular VAX instruction, ASHL, that happens >to mask its operand to the low-order 5 bits. Doesn't this merely mean that >on the VAX when the argument of the left shift is not a known constant that >the single instruction ASH sequence must be replaced by a multiple >instruction sequence that does the right thing? Were it defined that way, that would be the case. But (as a concession to weird machines like the VAX, and all those others that also `happen' to use just low order bits) the dpANS defines << such that the VAX ASHL instruction can be used, and so you can expect that the ASHL instruction *will* be used (even on other machines); and so you should beware of shifting integers by too many bits. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris