Re:XOR'ing a register with itself is the idiom for zeroing i...
by wongarsu on Wednesday April 22, 2026 @09:31AM
(#47863365)
In a clockless cpu design you'd indeed expect xor to be faster. But in a regular CPU with a clock you either waste a bit of xor performance by making xor and sub both take the same number of ticks, or you speed up the clock enough that the speed difference between xor and sub justifies sub being at least a full tick slower
The former just seems way more practical
Re:XOR'ing a register with itself is the idiom for zeroing i...
by dbdr on Wednesday April 22, 2026 @09:57AM
(#47863724)
Even if they take the same number of ticks, shouldn't xor fundamentally needing less work also mean it can be performed while drawing less power/heating less, which is just as much an improvement in the long run?
I think this might just be due to not realizing just how far back in CPU history this goes.