missing ->= operator
Henry Spencer
henry at zoo.toronto.edu
Wed May 1 08:30:00 AEST 1991
In article <1991Apr30.165110.4165 at unhd.unh.edu> jwm712 at unhd.unh.edu (Jonathan W Miner) writes:
>It is my opinion that the +=, &= etc operators were implemented on systems,
>such as DEC VAX that has two operand instructions...
No; they date to B on the pdp7, which had *one*-operand instructions.
These operators (and ++ and --) were always meant primarily as programming
conveniences, with the secondary possibility of more efficient code.
>Now for my question: how do the below operators compare speedwise?
> a++;
> a += 1;
> a = a + 1;
Any C compiler which compiles different code for these is pretty stupid
(assuming that the evaluation of `a' has no side effects). Modern compilers
will give you exactly the same code, running at the same speed, for all
of them.
--
And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology
"beans are more important". | henry at zoo.toronto.edu utzoo!henry
More information about the Comp.lang.c
mailing list