What’s the relative speed of floating point add vs. floating point multiply

It also depends on instruction mix. Your processor will have several computation units standing by at any time, and you’ll get maximum throughput if all of them are filled all the time. So, executing a loop of mul’s is just as fast as executing a loop or adds – but the same doesn’t hold if … Read more

How to Calculate Jump Target Address and Branch Target Address?

(In the diagrams and text below, PC is the address of the branch instruction itself. PC+4 is the end of the branch instruction itself, and the start of the branch delay slot. Except in the absolute jump diagram.) 1. Branch Address Calculation In MIPS branch instruction has only 16 bits offset to determine next instruction. … Read more

What is the difference between unconditional branch and unconditional jump (instructions in MIPS)?

Branches allow for conditions. But allowing for conditions takes up more bits in the instruction. Therefore, a branch’s address is only 2^16 bits and only allows you to branch 2^15 – 1 instructions backward or 2^15 instructions forward. A jump is unconditional and the bits saved by leaving out the condition can be used for … Read more

CMake: The C Compiler is not able to compile a simple test program

CMake tries to compile an executable using “standard” (as per what CMake thinks is standard) compiler options and tries to run that executable, so to see if the compiler is working. The executable is simple like int main(int argc, char *argv[]) { return argc – 1; }. You can’t do that when cross-compiling. Because usually … Read more

Why is x86 ugly? Why is it considered inferior when compared to others? [closed]

Couple of possible reasons for it: x86 is a relatively old ISA (its progenitors were 8086s, after all) x86 has evolved significantly several times, but hardware is required to maintain backwards compatibility with old binaries. For example, modern x86 hardware still contains support for running 16 bit code natively. Additionally, several memory-addressing models exist to … Read more

Error “gnu/stubs-32.h: No such file or directory” while compiling Nachos source code

You’re missing the 32 bit libc dev package: On Ubuntu it’s called libc6-dev-i386 – do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04. On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner’s comment). On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck’s comment). On CentOS … Read more