1
\$\begingroup\$

I'm reading a book bottom up where it said:

The Arithmetic Logic Unit (ALU) is the heart of the CPU operation. It takes values in registers and performs any of the multitude of operations the CPU is capable of. All modern processors have a number of ALUs so each can be working independently. In fact, processors such as the Pentium (*emphasis by me) have both fast and slow ALUs; the fast ones are smaller (so you can fit more on the CPU) but can do only the most common operations, slow ALUs can do all operations but are bigger.

I started to find out how many and found that question https://stackoverflow.com/questions/29056968/how-many-alus-are-in-a-cpu where as far as understood many ALU referred to multi-threading, but Pentium is single threaded.

Here I've found Are 32-bit ALUs really just 32 1-bit ALUs in parallell?. So I guess what was meant in the book is kind of many parallel "small" ALUs - am I right?

\$\endgroup\$
1
  • \$\begingroup\$ It would be more beneficial to consider super-scalar architectures than multi-threaded programs. The number of cores and the number of execution units per core relates to hardware. Threads are a software concept. For many years all implementations of the x86 architecture have benefited from multiple execution units per core. \$\endgroup\$
    – David
    Sep 25, 2019 at 21:41

2 Answers 2

2
\$\begingroup\$

The Pentium processor has two execution units: the U and the V pipes. When two instructions execute in parallel in the two pipes, the two instructions are considered to have paired.

The U-pipe can execute any instruction in the Intel(R) architecture while the V-pipe can execute only simple instructions.

When two instructions pair, the instruction issued to the V-pipe is always the next sequential instruction after the one issued to the U-pipe.

Simple instructions are entirely hardwired; they do not require any microcode control and, in general, execute in one clock. The exceptions are the ALU mem, reg and ALU reg, mem instructions which are three and two clock operations respectively. Sequencing hardware is used to allow them to function as simple instructions.

Source: http://www.nacad.ufrj.br/online/intel/vtune/users_guide/mergedProjects/analyzer_ec/mergedProjects/reference_olh/pentium4_hh/lips/v_pipe.htm

enter image description here
Source: https://www.ques10.com/p/13341/explain-in-brief-pipeline-stages-on-pentium-proc-1/

So in answer to your question, one ALU can work while the other one is working, so it's not exactly multithreading, because if a thread need u-pipe and it's busy, it will have to wait.

\$\endgroup\$
1
  • \$\begingroup\$ Do you know if the Pentium (P5) is able to execute one FPU and one ALU instruction at same time ? I searched about it and could not find anything. I ask this because I read that "Quake used very cleverly optimized x86 code that interleaved FPU and integer instructions" which could explain why it run so badly on Cyrix CPUs. \$\endgroup\$
    – tigrou
    Feb 13 at 14:57
2
\$\begingroup\$

In fact, processors such as the Pentium (*emphasis by me) have both fast and slow ALUs; the fast ones are smaller (so you can fit more on the CPU) but can do only the most common operations, slow ALUs can do all operations but are bigger.

This is a rather imprecise description, and isn't especially accurate for modern processors.

Execution units (a more general term for what the book refers to as "ALUs") typically don't differ in speed so much as in their capabilities. A representative example of a modern CPU is Intel's Sandy Bridge microarchitecture, which has six execution units. Three of them handle integer and floating-point operations, with common operations available on all three and various other operations split between them; two more handle memory loads, and a sixth handles memory stores.

What's critical to note here is that there is no execution unit which can perform all operations! In particular, it is common for memory operations to be placed on dedicated EUs, as these operations are very common, and the hardware required to implement them is significantly different from that which is present on other EUs.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.