2

I've recently begun researching what it would take to program a JIT compiler. I've been studying on machine language, but I haven't been able to find what type of machine languages most standard PCs run on. I found this PDF which seems to explain a type of ML, but it says it's MIPS, which, after looking it up, seems to be some kind of old, videogame console/router machine language. So, my question is,

What machine language do most modern personal computers (i.e. laptops, desktops) run on?

Or, is it indeterminable? Are there many machine languages? Or maybe I'm wrong, and MIPS is standard?

Yosi Mor
  • 193
  • 9
Codesmith
  • 5,779
  • 5
  • 38
  • 50

1 Answers1

3

The machine language used by a given processor is a function of its instruction-set architecture ("ISA").

Most desktop and laptop computers today running Microsoft Windows use "64-bit" processors implementing the "x86-64" ISA, such as those in Intel's "Core i5" and "Core i7" processor families. Commonly referred to as "x64", this is the 64-bit extension (created by AMD) for the original "IA-32" ISA (created by Intel).

Both "IA-32" and "x64" are examples of Complex Instruction Set Computing ("CISC") architectures. On the other hand, MIPS is an example of the much simpler Reduced Instruction Set Computing ("RISC") style of architectures.

When talking about JIT compilers, it is important to distinguish between the ISA of the virtual machine running the byte-code and the ISA of the underlying physical processor. Most virtual machines are based upon RISC architectures, because of their relative simplicity. However, most likely this VM-plus-JIT-compiler will be physically running on an x64-compatible CISC processor.

Yosi Mor
  • 193
  • 9
  • 1
    Ok, I think I understand. Then how do 32-bit programs run on 64-bit processors? Or do modern computers have _both_ 64-bit and 32-bit processors? – Codesmith May 28 '13 at 19:53
  • x64 is an extension of the original IA-32 architectures, and all x64 processors today also support IA-32. Which of the actual ISA modes actually gets used is a function of which OS you are running. If you are running, for example, a "64-bit" version of Windows or Linux, then it will make use of the 64-bit capabilities of your x64 processor. If you are running a "32-bit" OS, then only the IA-32 portion of the processor will be used. – Yosi Mor May 28 '13 at 20:02
  • Ok, -- now I'm looking at http://en.wikipedia.org/wiki/X86_instruction_listings. How do I know which instructions computers support? – Codesmith May 28 '13 at 20:18
  • If you know for sure that you are dealing with some form of an x64-compatible processor, then you can assume the "core" set of original x86-64 instructions. (Later versions of x64 added a few new instructions, such as [SSE3](http://en.wikipedia.org/wiki/SSE3), but I doubt these minor differences should matter.) You can certainly always minimalistically assume the core instructions of the original IA-32 architecture! The exact version of the processor can be determined programmatically using the [CPUID](http://en.wikipedia.org/wiki/CPUID) instruction. – Yosi Mor May 28 '13 at 20:39
  • @YosiMor, I have a doubt, as you said x86-64 is an extension to IA-32, which means IA64 is an extension of IA-32 or?? – nmxprime Aug 05 '14 at 14:56
  • @YosiMor, another doubt; Similarly, if x86-64, being extension to IA-32,whant is the bus width of core i5, i7 processors, 32 or 64?? – nmxprime Aug 05 '14 at 14:58
  • 1
    @nmxprime: [1] The [IA-64](http://en.wikipedia.org/wiki/IA64) instruction-set architecture is TOTALLY different from and unrelated to that of x86-64! [2] The term "bus width" is too vague, and for a CPU it can generally refer to at least the address-bus or data-bus. Also, this is a property that can potentially be different for each specific processor [microarchitecture](http://en.wikipedia.org/wiki/Microarchitecture), even if they belong to the same ISA family. For data on specific Intel processors you can consult: http://ark.intel.com/ . – Yosi Mor Aug 05 '14 at 19:02