Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

It's 2016 and COMPILERS ARE STILL STUPID

Name: Cudder !cXCudderUE 2015-12-31 22:29

Just analysing a device driver for hardware few months old... as usual, it's as bloated as a week-old dead pig overall but then I come across pieces like this:

shl ecx, 4
mov edx, ecx
shr ecx, 2
xor eax, eax
rep stosd
mov ecx, edx
and ecx, 3
rep stosb


:facepalm:

Name: Cudder !cXCudderUE 2016-01-01 0:28

>>7
Which one? All I see is that the sequences in >>3,4 are creating more dependency chains than necessary, and I'll let you figure out what's wrong with >>1.

>>8
What the fuck are you blabbering on about? Your vague abstract bullshite means nothing. Are you one of those stupid academics who focuses on idiotic microbenchmark optimsations?

except ICC to a degree
Does the fact that ICC pwns the shit out of every other compiler mean anything? Maybe you should see what the real leaders are doing instead of sticking your head in the sand and preaching abour your theoretical "optimizations" that don't actually make a winner. Instruction count is always important for anything else. Incidentally, that's what lead to http://funroll-loops.info/

Here's another fun one I found:

movzx ecx, word [ecx]
mov eax, ecx
shr eax, 15
shl eax, 1
mov edx, ecx
shr edx, 14
and edx, 1
or eax, edx
mov edx, ecx
shr edx, 13
shl eax, 1
and edx, 1
or eax, edx
mov edx, ecx
shl eax, 9
shr edx, 4
and edx, 511
or eax, edx
shl eax, 4
and ecx, 15
or eax, ecx
ret


What does this 22-instruction-function do? Nothing. Absolutely nothing. I'll let the reader decide whether the compiler or programmer is the stupid one here...

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List