When optimizations make the code worse, aka GCC and Clang are fucking retarded.

Both GCC and Clang are obsessed with constant / value range propagation. Unfortunately they are far too stupid to actually apply such optimizations appropriately. A common pattern that both compilers completely fuck up is testing a pointer for NULL and then returning NULL. Now anyone who is not completely retarded would realize that they had a nice NULL already sitting in the register and just return that but these so called smart optimizing compilers are so fucking stupid they explicitly set the register to NULL even though it was already NULL. This is only one example of hundreds of cases where the compiler does really retarded shit that even a literal retard would not do. Fuck, I spend more time fighting the stupid compiler than actually being productive. I have heard people say that modern compilers produce better assembly than humans but this is the biggest lump of shit that has ever been spouted from someones mouth. It would not be so bad if these issues happened only occasionally, but no, almost every function is effected and it drives me mental. Fix your stupid compilers.

void* test(void);
void* test2(void)
{
    void* tmp = test();
    if(tmp == NULL)
        return tmp;
    return test();
}

Output of GCC and Clang

test2:
        call    test
        testl   %eax, %eax
        je      .L1
        jmp     test
.L1:
        xorl    %eax, %eax
        ret

Output of MSVC for comparison.
This is how it should be compiled.

_test2  PROC
        call    _test
        test    eax, eax
        jne     SHORT $LN2@test2
        ret     0
$LN2@test2:
        jmp     _test
Posted in Uncategorized | Leave a comment

Whoever you are, I cast a thousand curses upon you

Once upon a time one could use WM_TIMER to execute an arbitrary callback in the gui thread. Then some fucking asshole decided that it was unacceptable, and implemented a the cursed function known as ValidateTimerCallback. Now only callbacks that came from real timers are permitted. Seriously, fuck you. If there is a god then he will send you straight to hell for what you have done.

Posted in Uncategorized | Leave a comment

Another reason why Microsoft is completely brain-dead

So recently I have updated my programming tools, I am now using Clang with the Universal windows C runtime, this new runtime improves standards compliance, and was a clean break from the mistakes of the past. Or so I thought. But it turns out in the places where it could have really made a difference, the utter shit of the past persists to this day.

execl("spawn_test", "test arg1", "test arg2", "test arg3", NULL);

Consider this, passing three arguments to a sub-process, not too much to ask it is. Works like a charm on Unix. But Microsoft in their infinite pool of retardation just dumbly concatenates these strings together with zero regards for the fact the arguments need to be quoted on windows, and this has never been fixed, not even in the New Universal C runtime. Seriously what the fuck, these functions are completely and utterly worthless and you still don’t fix them. Coding on windows is fucking bullshit.

Posted in Uncategorized | Leave a comment

On why the engineers at Intel deserve their eyes clawed out.

So I was recently inspecting some compiled assembly when I was confronted with this.

lea     r10, [r9+rdx]
add     r10, 20

Now in that instant I was thinking to myself, what the fuck is this retarded compiler doing, this should be a single lea instruction. But after further investigation I discovered something which pissed me off immensely. Intel did it again, fucking piece of shit Sandybrige, that sack of shit has a 3 cycle latency for 3 operand lea. Cpu designers are absolute fuckheads, how are people expected to optimize for this shit if you retards keep making random instructions fucking slow. Stop making instructions slow or I will come over there and pull your intestines out. Fucking cunts.

Posted in Uncategorized | Leave a comment

amd64: the biggest disaster in computing history

So recently I have been moving towards switching all my development to 64bits. And I am of increasing opinion that amd64 is an absolute disaster. The rex prefix and passing arguments in registers has completely ruined the code density. This absolute disaster amd saddled us with forever never had to be this way, all those opcodes they freed up could have been put to good use. 22 opcodes, 22 single byte opcodes wasted by these absolute retards. Imagine what could have been done with those 22 opcodes, so much wasted opportunity.

void test(void*, void*, long long, long long);

void test2(void* a, void* b)
{
    test(b, a, 1, 2);
}

mov     r9d, 2       [6]
mov     r8d, 1       [6]
mov     r10, rcx     [3]
mov     rcx, rdx     [3]
mov     rdx, r10     [3]
jmp     test         [5]

Those rex prefixes are pretty painful, but those small constants are what really kills it. 6 bytes to initialize a register with 1, absurd.
Imagine if just a few of those unused opcodes had been repurposed to encode some shorter 64bit operations.
Here are a few proposals.

[movq][reg|reg] – move 64bit register to register : 2 bytes
[movq][reg|000|sign][imm] – set 64bit register to 9 bit signed immediate : 3 bytes
With just these two simple instructions we could have saved 7 bytes from this function call.
Imagine what savings could have been made with careful use of all 22 spare opcodes
But of course we live in the worst timeline where everything has to suck
Fuck you amd, you fucked us all.

Posted in Uncategorized | Leave a comment

I just learned something about batch files, and it shocked me.

It turns out the move command in batch always overwrites the destination by default, how fuck have I been using windows for 20 years without ever discovering this? I have written so many batch files over the years, how could such a simple behavior have avoided my attention for so long, also WTF.  Overwrite the default? There is not even a proper way to move a file without overwrite, the standard solution is this abomination.
Echo n|MOVE /-y c:\file1.txt c:\dir\file1.txt
Also who the fuck thought it was a good idea to change the behavior of a command when running in a batch file, I bet many thousands of people have lost data over the years to this retardation. Commands in batch should not work differently to executing directly in the command prompt, utter retards.

Posted in Uncategorized | 1 Comment

Windows 7 is such a piece of shit, part 3

The permissions UI is so profoundly awful, for some retarded reason they decided that it would be read only by default and to actually edit the permissions you have to click edit, which brings up a second identical dialog to the one you were already on but enabled for edit. What the fuck, this thing is so confusing, it took me so long to figgure out what the fuck was going on. Why did they do this, the longer I use this piece of shit the more things I notice are fucked up. I just feel less effective using this piece of crap because of all the stupid brain-damaged changes. Seriously what the fuck were they thinking, almost every change made since xp is objectively worse. Using this thing makes me want to self immolate.

Posted in Uncategorized | 1 Comment

Windows 7 is such a piece of shit, part 2

So I just found out that windows 7 does not support the MPU-401 midi port. What fucking retarded bullshit is this. I have a fucking song I composed sitting in the memory of my fucking keyboard and now I learn that there is absolutely no way to retrieve it because some fucking cunt decided to remove fundamental hardware support. I fucking hate this shit so fucking much, I wish every person who worked on vista/7 would fucking burst into flames and die ahhhhh.

 

Posted in Uncategorized | Leave a comment

Windows 7 is such a piece of shit, part 1

So I have been using windows 7 at the moment after destroying my good computer. My god this thing is such an absolute piece of shit. One particularly bad part is the file search functionality. It is almost useless, absolute piece of crap, it is objectively worse than the search in pre-vista windows. What the fuck were they thinking, I can see no angle in which this could be considered any kind of improvement, its just shit.

There is a special spot reserved in hell for whichever fuckhead was responsible for this abomination, you know who you are, euthanize yourself right now.

Posted in Uncategorized | Leave a comment

C’s biggest mistake

Now C has taken much criticism over the years, and justly so, it has many faults. But there is one problem with the C standard which I think is far worse than all others, it has caused decades of pain and it still hurts to this day.

The FILE stream. This piece of shit can only be used with files. If they had just included but a single callback function, this thing could have been so useful. Streams are used everywhere in software and they are so useful, you can have the same code seamlessly operate on multiple sources of data, but in C we do not have that for the lack of a single function pointer.

I crave functional streams for C, one could of course make their own stream but that is totally incompatible with the rest of the C file libraries and also incompatible with other code that reads and writes files. Why has nobody even proposed to fix this travesty in all this time, the world shall be not but shit until this is corrected.

When I become leader of this world, I will of course correct this abomination. I will retroactively correct the C standard to implement proper streams, all existing software irregardless of age shall be corrected to reflect the change, all documents refereeing the original will be altered, and all historic records of this event will be expunged. In the future historians will never know of the travesty that was corrected.

 

Posted in Uncategorized | Leave a comment