A discovery about GCC's unidirectional rotation algorithm

Posted by soheilpro 6 days ago

Counter41Comment18OpenOriginal

Comments

Comment by throwaway81523 1 day ago

I thought the cool way to do this was reverse each sub-block in place, and then reverse the whole vector. If you draw a few diagrams you can see that accomplishes the rotation. Yes it moves everything twice, but it has near perfect cache locality, so at least on large blocks tends to be faster than cycle decomposition or other juggling tricks. It's discussed in one of Bentley's "Programming Pearls" books.

Comment by jdw64 2 days ago

Looking at this, I feel that while there seem to be many different actual implementations, they really boil down to just a few similar core principles

Comment by srean 2 days ago

'Shocking', 'striking', 'disappointing', 'will shock you' -- the article is padded with hyperbole.

Comment by jraph 2 days ago

This is obviously humor.

You stopped at the lexicon, check how it's used more thoroughly!

Comment by srean 2 days ago

Struck by (his) Poes I suppose.

Comment by jraph 1 day ago

Happens to the best of us :-)

Comment by DonHopkins 2 days ago

He found that gambling was going on in here!

Comment by saagarjha 2 days ago

Gee I wonder why Raymond would do that

Comment by srean 2 days ago

I have no context. Was that sarcasm ? I have no idea if this is expected or unexpected of Raymond.

Comment by dataflow 2 days ago

Try again? You don't really need context here.

Blog said: "As with all shocking discoveries, this one will <strike>shock</strike> disappoint you."

You complained: "'Shocking', 'striking', 'disappointing', 'will shock you' -- the article is padded with hyperbole."

Comment by jraph 2 days ago

Damn, reader mode doesn't keep the strike, I thought it was an English idiom I didn't know about xD

Comment by DonHopkins 1 day ago

Comment by comex 1 day ago

Not that Raymond.

Comment by DonHopkins 1 day ago

The Catarrhal and the Bizarre

Comment by sylware 1 day ago

gcc is gone, like clang. Those are c++ abominations. Not worth more than /opt.

Prefer, tinycc, cproc, scc, assembly.

Comment by vbezhenar 1 day ago

Sometimes I want to design a simpler C-like language and build toolchain for it from the scratch, with no historical baggage. Obviously optimization story will be very poor, gcc carries hundreds of super-qualified man-years of optimization work. But I wonder if it'll be that bad. Modern computers are fast.

Comment by DonHopkins 1 day ago

James Gosling beat you to it.

Comment by sylware 21 hours ago

cproc/qbe, on my heavy CPU benchmarks (compression), I get 70% of gcc speed (then probably clang). cproc is mostly one person, like qbe.

In other words, on modern CPUs, the fact that such compilers (cproc/qbe is only one alternative, probably near "real-life") are orders of magnitude smaller, are _not_ written in one of the worst computer languages ever (c++), mean that gcc (and clang) is a problem for open source. That's why the people need _lean_ open source now.

Moving gcc to c++ was probably one of the worst mistakes in open source, ever. Basically the only reason I can see for this disaster would be to force gcc devs to deal with this brain damaged computer language to force gcc to have a 'real-life' support of it. Because some critical, for some users, software is c++ written (and that was a mistake in the first place).

That said, the real end game here, is a "wolrdwide standard CPU ISA" with very performant implementations, assembly written software (without abuse of a macro-preprocessor), probably with a set of very high languages interpreters written themselves in assembly. Currently, RISC-V is taking shape, slowly because the "market" is already "saturated" and state of the art production lines are hogged by IP locked ISAs (and mistakes _will_ be made which is going to slow it down even further). In this kind of realm, even ISO will have a hard time generating cycles of computer language syntax planned obsolescence.