On 25/01/18 12:53, Tom Marchant wrote:
You can't find any of the more than 1100 instructions in the
z/Architecture instruction set that are more powerful than any C
language constructs?

ISO C includes a construct for inline assembler: so in terms
of individual instructions, C is as powerful as assembler.

On 25/01/18 04:54, Paul Raulerson wrote:
In fact it optimized it so much it simply generated a LHI of a
register with 100000000 in it.

This is an extreme example, of course, but consider the more
usual case of a loop or loops which could be optimised
by strength reduction, code motion, fusion, fission, permutation,
unrolling, inversion, splitting, peeling, tiling,
unswitching, etc. etc. As an assembler programmer,
do you write the optimised version of the loop
(which will be hard to understand and maintain)
or the readable version of the loop (which may have
very poor performance)? As a C programmer, there is no problem:
you write the most readable and maintainable version
of the loop and allow the optimiser to generate efficient code.

--
                        Martin

Dr Martin Ward | Email: [email protected] | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4

Reply via email to