From: "glen herrmannsfeldt" <[email protected]>
Sent: Wednesday, 31 August 2011 8:42 AM

Someone wrote:

Should we have machine instructions to compute a polynome of grade n?
I don't think so (but there were machines in the 60s which did just that,
and - in that period - they were faster by using such instructions).

VAX had polynomial evaluation in the 1980's, and it was well known
to be slower than doing it with separate instructions.  For that
reason, it was likely rarely used,

There's no justification for a comment like that.

even if it got faster in later versions.

The real question is whether it reduced programming time.
In the case of polynomial evaluation, a single instruction
is a lot easier to write, and would be less prone to error,
than a whole heap of instructions to evaluate the polynomial
the conventional way, using a loop.

The VAX instruction for doing subscript calculations, including
bounds checking, was also known to be slower than doing the same
thing without the special instruction.

Again, having the hardware do the checking
reduces programming effort.

RISC or CISC, if some operation is done often enough it makes
sense to have a special instruction.  As Blaauw did much of the
design of the S/360 architecture, in many cases he is criticizing
himself.  It would be rare for ED or EDMK to be used enough in
a program to make a significant contribution to the CPU usage.
(Most likely even in 1963.)

The instructions ED and EDMK weren't on the S/360 then.
In point of fact, the S/360 wasn't even built.

As to whether ED or EDMK  were "used enough", the same could
be said about many -- if not most -- of the S/360 instructions.

The question is not whether they were used enough,
but rather, whether (1) sufficient programming effort could be saved by
having those instructions available, and (2) how much saving
in run time by using those instructions in lieu of the equivalent in loops.

Because an ED or EDMK instruction takes little time,
any statement that it makes a "significant" contribution to CPU usage
is flawed.
If an instruction count is used as a basis for providing or omitting a 
particular
instruction, then that is flawed also :
for ED and EDMK, there would be only one execution
required of that, compared to 10 executions of about 5
instructions for the loop method.
Ed and EDMK would avoid the execution of around 60 instructions.

One ED saves writing about 10 instructions.
One instruction is easier to debug than 10 instructions.

The usual flawed argument based on instruction frequencies
says that ED is used once.  In another equivalent program,
not using ED, the instructions  D, AH, STC, BCT, etc are executed 10 times each;
thus, by comparison, ED is rarely used at all.

Note also that, as I already pointed out, in the case of ED and EDMK,
the one instruction can edit many numnbers.

Decisions that make sense one year might not the next.

That isn't usually the case in hardware design.

The S/360 instructions have done well over the years.

But in hindsight, not well-designed after all.

Reply via email to