Why is the loop instruction slow? Couldn’t Intel have implemented it efficiently?

In 1988, IBM fellow Glenn Henry had just come on board at Dell, which had a few hundred employees at the time, and in his first month he gave a tech talk about 386 internals. A bunch of us BIOS programmers had been wondering why LOOP was slower than DEC/JNZ so during the question/answer section … Read more

Why does Intel hide internal RISC core in their processors?

No, the x86 instruction set is certainly not deprecated. It is as popular as ever. The reason Intel uses a set of RISC-like micro-instructions internally is because they can be processed more efficiently. So a x86 CPU works by having a pretty heavy-duty decoder in the frontend, which accepts x86 instructions, and converts them to … Read more

Is there a compiler hint for GCC to force branch prediction to always go a certain way?

GCC supports the function __builtin_expect(long exp, long c) to provide this kind of feature. You can check the documentation here. Where exp is the condition used and c is the expected value. For example in you case you would want if (__builtin_expect(normal, 1)) Because of the awkward syntax this is usually used by defining two … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)