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

"Favor readability over bare-metal."

Name: Anonymous 2015-05-20 2:31

Name: Anonymous 2015-05-20 3:05

>>1
This is only a problem for people who don't statically link their binaries. If you statically link, it gets optimized down.

Name: Anonymous 2015-05-20 6:11

>>2
The compiler is free to replace strcmp with a builtin even before the executable is linked.

Static linking for performance reasons is a waste of effort. If a code path is hot enough that eliminating PLT or GOT lookups makes a difference, it is just badly written. Procedure calls and non-local data accesses in statically linked binaries aren't free either.

Name: Anonymous 2015-05-20 10:26

strcmp
Bat that's unsafe.

Name: Batman 2015-05-20 10:31

Living is unsafe

Name: Anonymous 2015-05-20 16:32

Disgusting.

Name: Anonymous 2015-05-20 18:27

lets see these guys implement diff

Name: Anonymous 2015-05-20 18:47

sgit

Name: Anonymous 2015-05-20 22:38

preprocessor macros, you fucking niggers

Name: Cudder !cXCudderUE 2015-05-22 4:51

What a bunch of wankers. Those shouldn't even be considered "handrolled strcmp()s".

if(*(u16*)*argv == 45)

That is "bare-metal".

Name: Anonymous 2015-05-22 5:56

if (postnum/10%10 == postnum%10)
puts("check 'em");

Name: Anonymous 2015-05-22 8:24

>>11
That's some serious ``bare-metal'' dubs, if I've ever seen some.

Name: Cudder !cXCudderUE 2015-05-22 15:10

>>11,12
; eax = postnum
push 10
pop ecx
cdq
idiv ecx
push edx
idiv ecx
pop eax
cmp eax, edx
jnz notdubs

14 bytes. The best gcc could do was 18 bytes, with maximum size optimisation. How disappointing.

This is not even considering the stupid way it makes function calls and saves and restores registers that don't even need to be touched, otherwise it'd be even worse.

Name: Anonymous 2015-05-22 21:36

>>13
Use a better compiler.

Name: Anonymous 2015-05-22 22:24

>>13
Why do you talk like it's the end of the world every fscking time? Hush, hush!

Name: Anonymous 2015-05-23 2:41

>>13
This is not even considering the stupid way it makes function calls and saves and restores registers that don't even need to be touched, otherwise it'd be even worse.

So are you just trolling or is gcc actually saving registers that are not required by the calling convention? I'm betting you wouldn't be happy with any C compiler that produces linkable code.

Name: Anonymous 2015-05-23 2:59

>>10
Thank you cudder.

Name: Cudder !cXCudderUE 2015-05-23 5:21

>>16
gcc is free, try it out for yourself.

>>15
If VN elitists get to complain about machine translations, I get to complain about compiler output.

Name: Anonymous 2015-05-23 5:58

>>18
Not the same at all. Your shitty machine translations make me waste my fucking time downloading things before realizing it's garbage. Compiler's pushing EAX when it doesn't strictly need to is a wastes of nanoseconds of the computer's time, which I don't give an eighth of a shit about.

By not saving, say two, registers, we save 10 cycles (to be generous). Suppose the processor is 2.5Ghz and there are a thousand calls per second, over the next thousand years we save a whole THIRTY SIX MINUTES in CPU time. That's not worth adding a single second to compilation time, much less programming time.

Name: Anonymous 2015-05-23 6:24

It's a death of a thousand cuts.

Name: Anonymous 2015-05-23 9:30

>>13
Your code is bloated and does not follow any calling convention.

Here, this follows X86_64 convention and only takes 13 bytes.

; first arg: pointer to null terminated string to check for dubs
; return value: 0 if dubs, non 0 if not dubs
dubs:
push rax
lodsb
test al, al
jz .L1
pop rdx
jmp dubs
.L1: pop rax
xor al, dl
ret

Name: Cudder !cXCudderUE 2015-05-23 12:32

>>21
I don't give a shit about any calling conventions. Those are for the mindless HLL sheep. Another way to say it is, the only calling convention I care about is the one I make up, the one that fits the situation the best.

More importantly, you moved the goalposts. The code in >>11 uses an integer, you used a string. But two can play at that game...!

xor ecx, ecx
salc
dec ecx
repnz scasb
mov eax, [edi-3]
sub al, ah
ret

12 bytes.

Your move.

Name: Anonymous 2015-05-23 15:50

>>22

Language such as yours is provocative, dim, and useless in the context of a genuine technical conversation. If this is your preferred method of expressing your frustrations, then if you decide to spend the rest of your life coding in Java, I tend to doubt that you would be much missed.

Warm Regards.

Name: Anonymous 2015-05-23 17:28

>>22
salc
Stopped reading there. Not all have those luxury Pentium Pros yet :(

Name: Anonymous 2015-05-23 17:44

>>22
I am your biggest fan.

Name: Anonymous 2015-05-23 17:54

Another way to say it is, the only calling convention I care about is the one I make up, the one that fits the situation the best.
I can only imagine what kind of horrifying spaghetti code that leads to. It's no wonder you've never been able to write anything more sophisticated than a FizzBuzz.

Name: Anonymous 2015-05-23 17:56

You want bare metal? Just use this: https://www.fpcomplete.com/blog/2015/05/inline-c

Today we are releasing inline-c, a package for writing mixed C/Haskell source code that seamlessly invokes native and foreign functions in the same module. No FFI required.

Name: Anonymous 2015-05-23 17:58

JACKSON 52 GET

Name: Anonymous 2015-05-23 18:03

prime get

Name: Anonymous 2015-05-23 18:36

>>28
Is this some insane kind of meta trolling?

Name: sage 2015-05-23 18:57

>>30
This is an insane kind of meta-saging.

Name: Anonymous 2015-05-23 19:00

>>31
Fuck off with your obsessive sage back to the imageboards, please.

Name: Anonymous 2015-05-23 19:01

>>32
Fuck off with your obsessive non-doubled post numbers back to the imageboards, please.

Name: Anonymous 2015-05-23 19:37

fibs get

Name: Anonymous 2017-01-20 18:24

>>11
What exactly does this do? It looks to me like it's checking to see if the first 16 bits of argv[0], reinterpreted as a 16-bit unsigned integer, equal the decimal number 45. What's the purpose of that? And if it's supposed to check for a specific character pattern, wouldn't that be dependent on endianness and character encoding?

Name: Anonymous 2017-01-20 18:38

Name: Anonymous 2017-01-20 18:38

lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff
lets see these guys implement diff

Name: Anonymous 2017-01-20 18:42

>>37
(Post truncated)
Stopped reading there.

Name: Anonymous 2017-01-21 13:17

lets see these guys implement diff

Name: Anonymous 2017-01-22 4:29

>>39
lets see you implement diff

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