4 ms·
Simultaneous Multi-Threading (hyper-threading as Intel calls it). I'm not a cpu guy, but I think the ALU used for subtraction would be a more valuable resource
by recursivecaveat 6mo ago
Simultaneous Multi-Threading (hyper-threading as Intel calls it). I'm not a cpu guy, but I think the ALU used for subtraction would be a more valuable resource to leave available to the other thread than whatever implements a xor. Hence you prefer to use the xor for zeroing and conserve the ALU for other threads to use.
- tliltocatl 6mo agoI don't think that's how it works. - Normally ALU implements all "light" operations (i. e. add/sub/and/or/xor) in a single block, separating them would result in far more interconnect overhead. Often, CPUs have specialized adder-only units for address generation, but never a xor-specialized block. - All CPUs that implement hyper-threading also optimize a XOR EAX,EAX into MOV EAX,ZERO/SET FLAGS (where ZERO is an invisible zero register just like on Itanium and RISCs). This helps register renaming and eliminates a spurious dependency. - The XOR trick is about as old as 8086 if not older.
- Symmetry 6mo agoRight. Keeping down the number of slots the scheduler and bypass network need to worry about is an important design pressure.
- fredoralive 6mo agoBy the time you get to a CPU complex enough to be to have SMT it is likely to detect these “clear register” patterns and special case them. XOR would also be handled by the ALU, the L is for logic.
- IshKebab 6mo agoMost CPU use the same ALU for xor and sub.